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]

what is the difference of these two compile methods ?


source file is a very simple cpp file like "hello world" whose name is main.cpp
when i compile it with:
g++ -o test.exe main.cpp
it works fine

but when i compile it with:
 g++  -c -o main.o main.cpp
 ld -o test.exe main.o
it will report "undefined reference" error at step 2, it looks like ld
can not locate any library, if i replace ld with g++, it works fine.

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


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