This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Simple Cygwin Application Linking Problem
- From: Greg Chicares <gchicares at sbcglobal dot net>
- To: cygwin at cygwin dot com
- Date: Thu, 07 Oct 2010 14:15:48 +0000
- Subject: Re: Simple Cygwin Application Linking Problem
- References: <54726.1286459553@cc.hs-owl.de>
[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