Web lists-archives.com

Re: [Mingw-users] How do I write native windows code with MinGW? POSIX calls are compiling?.

> Date: Thu, 16 Mar 2017 19:33:05 -0400
> From: kk.mingw@xxxxxxxxxxxxxxx
> How do I write native windows code with MinGW? Getting POSIX calls to 
> compile.

There's no single answer to that, it depends on the APIs you need.
But as a rule of thumb, mots Posix APIs are absent.

> Exactly what I want – Let me explain. I followed the directions for a 
> new instillation. I have a Linux program that works in Linux. It will 
> also work in Cygwin. The program has several POSIX calls that I know 
> windows does NOT support (getopt(), glob(), ...). I tried compiling this 
> program with MinGW expecting errors --- but to my surprise it compiles, 
> links, and runs. Clearly, it has linked with some libs that provide 
> POSIX – how do I get Windows and nothing but windows?

MinGW adds a small set of popular Posix functions in the libmingwex
library that is scanned by default by the linker when linking
programs.  If you want to know which additional functions are
available, use something like 'nm -A libmingwex.a | grep " T "', and
you will see them.  Most of them are math functions, but some, like
getopt and glob, are not.

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe