On Nov 9, 2009, at 7:18 PM, Teo Fonrouge wrote:

Hello Viktor,

Seems that parsing (at least in -ldflag) is removing wrongly the "extension" of lib files, please see the output below:

$ wx-config --libs
-pthread -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 - lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 - lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 - lwx_baseu_net-2.8 -lwx_baseu-2.8

and when linking using `wx-config --libs` is required:

$ hbmk2 -cflag=`wx-config --cflags` -ldflag=`wx-config --libs` ... (intentionally reduced) test.prg
hbmk2: Error: Running linker. 1
gcc test.o hbmk_0pc3he.o -pthread -Wl,--start-group - lwx_gtk2u_richtext-2 -lwx_gtk2u_aui-2 -lwx_gtk2u_xrc-2 - lwx_gtk2u_qa-2 -lwx_gtk2u_html-2 -lwx_gtk2u_adv-2 -lwx_gtk2u_core-2 - lwx_baseu_xml-2 -lwx_baseu_net-2 -lwx_baseu-2 -lhbcplr -lhbdebug - lharbour -Wl,--end-group -otest -L/usr/lib/harbour


As you see, the ".8" is removed from the libnames.

Hello Viktor,

Seems that enclosing the parameter inside of "" is required, so changing the above command to:

$ hbmk2 -cflag=`wx-config --cflags` -ldflag="`wx-config --libs`" ... (intentionally reduced) test.prg

Makes the thing work ok as it's expected.


However, something that is source of little confusing is that in the .hbc file the ldflag parameter is in the form:

ldflags={unix&gcc}"`wx-config --libs`"

and the command line help from hbmk2 states that "-ldflag" (without the final "s" ) is required, so if you enter:

-ldflag="`wx-config --libs`"

you get the parameter ignored.

I have the impression that "-ldflags" and "-cflags" are more natural than "-ldflag" and "-cflag"


best regards,

Teo

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to