Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

Linker errors, building Win/MinGW/CodeBlocks of Nightly v20150422?

$
0
0

@sdaau wrote:

I use CodeBlocks 12.11, but at the moment, I replaced its toolchain executables (compiler) to refer to mingw-w64\i686-4.9.3-posix-dwarf-rt_v4-rev1\mingw32, which is to say, g++ version 4.9.3. Otherwise, I also use a git-bash.exe shell. I tried the following experiment:

I looked at the (currently deprecated) page http://www.openframeworks.cc/nightlybuilds.html, and got the latest from there, 22 April 2015 Nightly version:

wget http://www.openframeworks.cc/versions/nightly/of_v20150422_win_cb_nightly.zip
unzip of_v20150422_win_cb_nightly.zip
ls of_v20150422_win_cb_release/scripts/win_cb/template/emptyExample.*

Inside CodeBlocks, I open the emptyExample.workspace last listed, so the openFrameworks library can be automatically built on first build of emptyExample. Before I can start building though, I must do this:

mkdir -p of_v20150422_win_cb_release/libs/openFrameworksCompiled/project/win_cb/obj/Release/openFrameworks/{3d,app,communication,events,gl,graphics,math,sound,types,utils,video}
mkdir -p of_v20150422_win_cb_release/scripts/win_cb/template/obj/Release/src

... because CodeBlocks seemingly cannot create directories needed for object files, but instead it prefers to fail with "No such file or directory".

With this in place, I run Build for the emptyExample project in CodeBlocks (in Release), which triggers the build of the openFrameworks library - which builds succesfully. Then emptyExample continues building - and it likewise compiles succesfully, - however, it does not link; I get a ton of linker errors like these:

...
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: corrupt .drectve at end of def file
../../../libs/openFrameworksCompiled/lib/win_cb/openFrameworks.lib(ofAppRunner.o):ofAppRunner.cpp:(.text+0x33e): undefined reference to `_imp___ZN4Poco12ErrorHandlerC2Ev'
../../../libs/openFrameworksCompiled/lib/win_cb/openFrameworks.lib(ofAppRunner.o):ofAppRunner.cpp:(.text+0x34d): undefined reference to `_imp___ZN4Poco12ErrorHandler3setEPS0_'
../../../libs/openFrameworksCompiled/lib/win_cb/openFrameworks.lib(ofAppRunner.o):ofAppRunner.cpp:(.text+0x63e): undefined reference to `_imp___ZN4Poco12ErrorHandlerC2Ev'
../../../libs/openFrameworksCompiled/lib/win_cb/openFrameworks.lib(ofAppRunner.o):ofAppRunner.cpp:(.text+0x64d): undefined reference to `_imp___ZN4Poco12ErrorHandler3setEPS0_'
...

Apparently, this has to do with symbols in the Poco library; here's a brief check:

$ nm of_v20150422_win_cb_release/libs/poco/lib/win_cb/libPocoFoundation.a | grep ErrorHandlerC2E
00000148 T __ZN4Poco12ErrorHandlerC2Ev
$ nm of_v20150422_win_cb_release/libs/openFrameworksCompiled/project/win_cb/obj/Release/openFrameworks/app/ofAppRunner.o | grep ErrorHandlerC2E
         U __imp___ZN4Poco12ErrorHandlerC2Ev

or, in other words:

  • the ofAppRunner.o I just built, wants a symbol __imp___ZN4Poco12ErrorHandlerC2Ev - but,
  • the libPocoFoundation.a that follows with OF offers "only" the __ZN4Poco12ErrorHandlerC2Ev symbol (i.e., not prefixed with __imp_)

So - what would be the correct procedure, to build this example without the linking errors? Is it dependent on the g++ compiler version?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles