Trigve wrote: > > > > ----- Original Message ---- > From: Tim Prince <n8tm@xxxxxxx> > To: trigves@xxxxxxxxx > Cc: tprince@xxxxxxxxxxxx; gcc-help@xxxxxxxxxxx > Sent: Thursday, April 19, 2007 3:30:49 PM > Subject: Re: undefined reference with -pg option > > trigves@xxxxxxxxx wrote: >> >> ----- Original Message ---- >> From: Tim Prince <tprince@xxxxxxxxxxxxx> >> To: Trigve <trigves@xxxxxxxxx> >> Sent: Tuesday, April 17, 2007 2:44:56 PM >> Subject: Re: undefined reference with -pg option >> >> Trigve wrote: > >> g++ -v -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC >> -fexceptions -pthread -Wl,--rpath -Wl,/usr/local/lib -pg -o codeblocks >> app.o appglobals.o compilersettingsdlg.o crashhandler.o dlgabout.o >> dlgaboutplugin.o environmentsettingsdlg.o main.o prefix.o printdlg.o >> scriptconsole.o scriptingsettingsdlg.o splashscreen.o startherepage.o >> -pthread -L/usr/local/lib -L/usr/home/dodes/codeblocks/src/src/wxAUI >> /usr/home/dodes/codeblocks/src/src/wxAUI/.libs/libwxaui.a >> /usr/local/lib/libgtk-x11-2.0.so /usr/local/lib/libgdk-x11-2.0.so >> /usr/local/lib/libatk-1.0.so /usr/local/lib/libgdk_pixbuf-2.0.so >> /usr/local/lib/libpangocairo-1.0.so /usr/local/lib/libXinerama.so >> /usr/local/lib/libXi.so /usr/local/lib/libXrandr.so >> /usr/local/lib/libXext.so /usr/local/lib/libXcursor.so >> /usr/local/lib/libXfixes.so /usr/local/lib/libcairo.so >> /usr/local/lib/libglitz.so -lpng /usr/local/lib/libXrender.so >> /usr/local/lib/libpangoft2-1.0.so /usr/local/lib/libfontconfig.so >> /usr/local/lib/libexpat.so > >> /usr/local/lib/libfreetype.so -lz /usr/local/lib/libpango-1.0.so -lm >> /usr/local/lib/libX11.so /usr/local/lib/libXau.so >> /usr/local/lib/libXdmcp.so -lrpcsvc /usr/local/lib/libgobject-2.0.so >> /usr/local/lib/libgmodule-2.0.so /usr/local/lib/libglib-2.0.so -licui18n >> /usr/local/lib/libintl.so -L/usr/home/dodes/codeblocks/src/sdk >> -lcodeblocks -pthread /usr/local/lib/libiconv.so -lwx_gtk2u_xrc-2.6 >> -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6 -lwx_gtk2u_adv-2.6 >> -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 -lwx_baseu_net-2.6 -lwx_baseu-2.6 >> -lpthread -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib >> >> The output of command is: >> >> Using built-in specs. >> Configured with: FreeBSD/i386 system compiler >> Thread model: posix >> gcc version 3.4.6 [FreeBSD] 20060305 >> /usr/bin/ld -V -dynamic-linker /libexec/ld-elf.so.1 -o codeblocks >> /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib >> -L/usr/home/dodes/codeblocks/src/src/wxAUI >> -L/usr/home/dodes/codeblocks/src/sdk -L/usr/lib --rpath /usr/local/lib >> app.o appglobals.o compilersettingsdlg.o crashhandler.o dlgabout.o >> dlgaboutplugin.o environmentsettingsdlg.o main.o prefix.o printdlg.o >> scriptconsole.o scriptingsettingsdlg.o splashscreen.o startherepage.o >> /usr/home/dodes/codeblocks/src/src/wxAUI/.libs/libwxaui.a >> /usr/local/lib/libgtk-x11-2.0.so /usr/local/lib/libgdk-x11-2.0.so >> /usr/local/lib/libatk-1.0.so /usr/local/lib/libgdk_pixbuf-2.0.so >> /usr/local/lib/libpangocairo-1.0.so /usr/local/lib/libXinerama.so >> /usr/local/lib/libXi.so /usr/local/lib/libXrandr.so >> /usr/local/lib/libXext.so /usr/local/lib/libXcursor.so >> /usr/local/lib/libXfixes.so /usr/local/lib/libcairo.so >> /usr/local/lib/libglitz.so -lpng /usr/local/lib/libXrender.so >> /usr/local/lib/libpangoft2-1.0.so >> /usr/local/lib/libfontconfig.so /usr/local/lib/libexpat.so >> /usr/local/lib/libfreetype.so -lz /usr/local/lib/libpango-1.0.so >> /usr/local/lib/libX11.so /usr/local/lib/libXau.so >> /usr/local/lib/libXdmcp.so -lrpcsvc /usr/local/lib/libgobject-2.0.so >> /usr/local/lib/libgmodule-2.0.so /usr/local/lib/libglib-2.0.so -licui18n >> /usr/local/lib/libintl.so -lcodeblocks /usr/local/lib/libiconv.so >> -lwx_gtk2u_xrc-2.6 -lwx_gtk2u_qa-2.6 -lwx_gtk2u_html-2.6 >> -lwx_gtk2u_adv-2.6 -lwx_gtk2u_core-2.6 -lwx_baseu_xml-2.6 >> -lwx_baseu_net-2.6 -lwx_baseu-2.6 -lpthread --rpath /usr/local/lib >> --rpath /usr/local/lib -lstdc++_p -lm -lgcc_p -lpthread_p -lc_p -lgcc_p >> /usr/lib/crtend.o /usr/lib/crtn.o >> /usr/local/lib/libicuuc.so.36: undefined reference to `wcstombs' >> /usr/local/lib/libxml2.so.5: undefined reference to `isinf' >> /usr/local/lib/libicuuc.so.36: undefined reference to `modf' >> /usr/local/lib/libtiff.so.4: undefined reference to `lfind' >> >> And yes I have installed the profiling version of libraries. >> > > Now I am out of my territory. Do you know that -g and -pg can be used > together with your linker? Are all 5 of those _p libraries present in > /usr/local/lib ? > > ------------------------------------- > > I don't think that -pg -g can't be used together... All of those profiling > libraries are in /usr/lib (system default library directory)... > I have used -pg -g with other apps without problem. > > thanks > > Trigve > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > So finally I've played with ld command and solved it with removing all "-lxxxx_p" options and leave only "not-profiled-versions" (without _p) Now everything compile and also I've got gmon output Trigve -- View this message in context: http://www.nabble.com/undefined-reference-with--pg-option-tf3589503.html#a10127898 Sent from the gcc - Help mailing list archive at Nabble.com.