This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linker switches


On Tue, Jun 1, 2010 at 10:25 PM, James Rome  wrote:
> I am doing a C project in NetBeans 6.9RC1, in Windows 7 64-bits.
> gcc.exe ? ? -o dist/Debug-Cygwin/Cygwin_4.x-Windows/tkfpush
> build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o
> build/Debug-Cygwin/Cygwin_4.x-Windows/src/tkfPusher.o: In function `main':
> /cygdrive/c/Users/jar/GraphiC2/tkfPush/src/tkfPusher.c:173: undefined
> reference to `_WSAStartup@8'

As an alternative to Larry Hall's suggestion,
If you want to build a Windows program from Cygwin, you need to pass
-mno-cygwin to gcc during compilation and probably also during
linking. You need to use gcc 3 for this to work.
Also, you need to pass the names of the Windows libraries in the
linking step; in this case perhaps -lwsock32

-- 
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]