http://cygwin.com/acronyms/#PPIOSPE. I've redirected your query to the
appropriate list and set the Reply-To: header -- please make sure your
mailer honors it.
Ugh, top-posting... Reformatted.
On Mon, 12 May 2008, Jesús Oliva wrote:
I have a pure Win32 console program which I am trying to compile under
Cygwin. I am
including the following libraries
-lws2_32 -lrpcrt4 -luuid -lrpcns4 -lpsapi -liphlpapi
and am using a host of Win32 calls for threading, sockets, semaphores,
I know that I need to compile with the option -mno-cygwin to be able to
the program on
a computer without the cygwin.dll, which is what I want, however, when I
this option I
get the following linker error:
undefined reference to `___getreent'
This is my linker statement:
g++ -g -O2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D WIN32 -D CYGWIN -D
CoreMain.o CoreLibrary.a -Wl,--rpath -Wl,/usr/local/lib -o CoreTest
-lrpcrt4 -luuid -lrpcns4 -lpsapi -liphlpapi
I have found that I get this for every line in the code where I use either
and when I comment out these the error goes away, but jumps to the next
or file where
I use this or something like it. I must admit that I have not tried
of them, just the first 15 or so...
I have tried to include all sorts of libraries instead of the cygwin.dll
when I include the -lpthread it compiles, but then the program crashes
I start using
threads and semaphores...
As I mentioned above, when I do not state -mno-cygwin, everything works
program runs perfectly! But then it needs the cygwin.dll, of course...
I found a few references to this on the web, mostly promoting the compiler
which I have tried, but to no avail...
Below is a snippet of output from the linker. I hope this will make sense
there, who can tell me what to include in my linker statement...
Thank you very much in advance!
[Linker output snipped]
You have to use -mno-cygwin for the whole compilation, not just for the
link line, otherwise the wrong headers get picked up. IOW, don't add
-mno-cygwin to LDFLAGS -- instead, redefine CXX='g++ -mno-cygwin' (and
CC='gcc -mno-cygwin') and rebuild everything from scratch.
I have a similar problem that the one related below, but when I try to
compile everything with the -mno-cygwin option, I get many errors such
'error: u_int32_t has not been declared
I suppose that, if I don´t want to use cygwin.dll, I should add some
libraries to the compiling and linking process, but I don´t know wich.
Could you help me??
Thank you very much,
You may need headers that define the above types, or you may be unable to
compile the code with -mno-cygwin if those headers are not present in
Remember, -mno-cygwin means no Cygwin -- you're using MinGW, and will
only be able to compile programs that MinGW has enough support for.
Further questions about this should really be directed to a MinGW list...
|\ _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
That which is hateful to you, do not do to your neighbor. That is the whole
Torah; the rest is commentary. Go and study it. -- Rabbi Hillel
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html