tag:blogger.com,1999:blog-17958827.post1189322101298614146..comments2024-02-05T15:01:20.672+08:00Comments on Archimedes' Lever: g++ != gcc (arrrrrrgh!)Anonymoushttp://www.blogger.com/profile/12760673999356987827noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-17958827.post-27184375134251795262008-09-18T07:10:00.000+08:002008-09-18T07:10:00.000+08:00This link uses -L/opt/local/lib: jeffs-imac:Foo...This link uses -L/opt/local/lib:<BR/><BR/> jeffs-imac:Foo jeff$ g++ foo.o -L/opt/local/lib -lcppunit -o foo<BR/><BR/>That one works. This one uses -L/usr/local/lib (not the same lib):<BR/><BR/> jeffs-imac:Foo jeff$ g++ -I /opt/local/include -I /opt/local/include/cppunit foo.cpp -L /usr/local/lib -lcppunit -o foo<BR/> ld: in /usr/local/lib, can't map file, errno=22<BR/> collect2: ld returned 1 exit status<BR/><BR/>So try this:<BR/><BR/>jeffs-imac:Foo jeff$ g++ -I /opt/local/include -I /opt/local/include/cppunit foo.cpp -L /opt/local/lib -lcppunit -o fooAnonymousnoreply@blogger.com