Reputation: 992
I have an application base on wxwidgets, using the boost and pcre lib. Inside the makefile I have normally to put compiler and linker paths by using the CXXFLAGS variable etc.
I wrote this:
CXXFLAGS := -I. -I/path/boost/prod -I/path/pcre/include $(shell path/wxWidgets/bin/wx-config --unicode=yes --static=yes --cxxflags) -DPCRE_STATIC -O3
CPPFLAGS := -I. -I/path/boost/prod -I/path/pcre/include $(shell path/wxWidgets/bin/wx-config --unicode=yes --static=yes --cppflags) -DPCRE_STATIC -O3
LDFLAGS := -L. -L/path/pcre/lib -L/path/wxWidgets/lib $(shell $path/wxWidgets/bin/wx-config --unicode=yes --static=yes --optional-libs html,aui,stc,xml,adv,core,base) -lpcre -O3
EXEC_POST
From what I now, wx-config tells me which libraries I need.
When I try to link my compiled files, the linker puts an error for not finding e.g. the library "gio-2.0", which is one of the libraries wx-config stated. I can now install all of those not found libraries manually and it work, but normally all this demanded libs should be part of wxwidgets.... I think I messed up with the parts in the above written makefile configuration. What do you think?
Upvotes: 0
Views: 1411
Reputation: 22688
You should be using --libs
instead of --optional-libs
.
Also, you don't need the explicit -L/path/wxWidgets/lib
, this is already output by wx-config
.
Upvotes: 1