Open wxtrac opened 4 years ago
Check libtool verbose output, something strange is going on here because libtool link line shows that liba.a
comes before -lwwxregexu-3.1
but this error should only happen if it comes afterwards (because when using static libraries link order matters).
Also, you're mixing up CPP (C preprocessor) and CXX flags, you really should be using CXXFLAGS
and --cxxflags
instead.
In any case, I really don't think this is a problem with wxWidgets, but rather with your build system (even if I don't see what it is, immediately).
It's something strange for me too. I tested the code on both Xubuntu-19.10 and SimplyLinux-rc-8.990 with same result. The --cxxflags option is really necessary for this, but as far as I know, CXXFLAGS sends an option to the compiler, not the preprocessor.
Issue migrated from trac ticket # 18701
component: build | priority: normal | keywords: wxRegEx libtool
2020-03-18 13:08:42: anhsoft created the issue
To reproduce it, I am prepare a minimal source tree:
-*/configure.ac:**
-*/Makefile.am** (PROGRAM makefile):
-*/main.cpp** (PROGRAM):
-*/a/a.cpp** ('a' LTLIBRARY):
-*/a/Makefile.am** ('a' LTLIBRARY makefile):
-*Commands to prepare and configure (clarification: statically compiled wxWidgets is assumed in '/mnt/sda4/projects/linux/luna/build_wx_debug')**
Here are the wxWidgets configs separately. Output of 'wx-config --static=yes --cppflags':
Output of 'wx-config -static=yes --libs':
And on make the aforementioned link error occur:
However, if I simply include the code containing the wxRegEx class from /a/a.cpp to /main.cpp then a linking process ends successfully.
The new /main.cpp (PROGRAM) that doesn't cause an error:
-*make** output at last case: