Sunday, 8 September 2013

Error when linking with POCO library compiled with i686-w64-mingw32

Error when linking with POCO library compiled with i686-w64-mingw32

I am using i686-w64-mingw32 downloaded from sf to compile POCO libraries.
Libraries are compiled and libPoco*.a files are created (with some
warnings). Now when I want to use those files (e.g. in a small sample
project which converts string to integer), linker throws error saying:
./Debug/main.o:main.cpp:(.text+0xab): undefined reference to
`imp__ZN4Poco12NumberParser5parseERKSs'
The strange thing is that if I do compilation for both sides (lib and test
app) using TDM-MinGW-4.7.1 everything is fine!
I tried setting "-march=i386;-m32" on both compilations but no luck. Here
is log of linker when I try to build my test app:
g++ -o ./Debug/testpoco @"testpoco.txt" -L. -Lc:/poco/lib/
-lPocoFoundationmtd -v
Using built-in specs.
COLLECT_GCC=g++
...
Target: i686-w64-mingw32
...
Thread model: win32
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)
...
COLLECT_GCC_OPTIONS='-o' './Debug/testpoco.exe' '-L.' '-Lc:/poco/lib/'
'-v' '-shared-libgcc' '-mtune=generic' '-march=i686'
...
./Debug/main.o:main.cpp:(.text+0xab): undefined reference to
`_imp___ZN4Poco12NumberParser5parseERKSs'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/testpoco] Error 1
testpoco.mk:77: recipe for target 'Debug/testpoco' failed

No comments:

Post a Comment