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: Simple Cygwin Application Linking Problem


[please see http://cygwin.com/acronyms/#PCYMTWLL ]

On 2010-10-07 13:52Z,  Michael JÃger wrote:
> 
> INCCYGSTDABS      = C:/cygwin/usr/include             

It's generally preferable to use posix paths with cygwin tools. This
one would be simply /usr/include for example.

> LIBCYGSTDABS      = C:/cygwin/usr/include/d/3.4.4/std/c

The compiler knows where to find its own libraries. It's better to let
it manage this itself. Then, when you upgrade to another version of
gcc, you won't have to edit the makefile.

> test.exe: target.o
>       ld $(LCOMP) target.o

'ld' is the linker, but it's better not to invoke it directly. Use
'gcc' to link C programs, and 'g++' for C++. They'll call the linker
for you, automatically specifying the startup code and runtime library
that are lacking here:

> target.o:test.c(.text+0x12): undefined reference to â__mainâ
> target.o:test.c(.text+0x1e): undefined reference to âprintfâ

--
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]