HI All,
I very new to 3D programming and to Collada…
I compiled collada Dom and its third party libraries using Mingw…
I am compiling the below example program using DEV-C++.
i am using pcre 7.7, zlib123 and GNU Make 3.81… while compiling the below program i am recieving errors …
[Linker error] undefined reference to inflateInit2_' [Linker error] undefined reference to
get_crc_table’
[Linker error] undefined reference to crc32' [Linker error] undefined reference to
inflate’
and many more… i downloaded latest external libs specified in the page Building_third_party_libraries_for_the_COLLADA_DOM and compiled it…
i am able to solve some linker problems… but still it is giving errors…
#include <iostream>
#include <dae.h>
#include <dom/domCOLLADA.h>
using namespace std;
int main() {
DAE dae;
printf(“heloo World”);
return 0;
}
i am adding compile log…
Compiler: Default compiler
Building Makefile: “C:\Documents and Settings\Bhimu\Desktop\devcpp\Makefile.win”
Executing make…
make.exe -f “C:\Documents and Settings\Bhimu\Desktop\devcpp\Makefile.win” all
g++.exe -c colladatest.cpp -o colladatest.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"D:/Innovation/zlib123" -I"D:/Innovation/zlib123/contrib/minizip" -I"D:/Innovation/pcre-7.7" -I"D:/Innovation/collada-dom/dom/include/1.4"
g++.exe colladatest.o -o “Colladatest.exe” -L"C:/Dev-Cpp/lib" -L"D:/Innovation/collada-dom/dom/build/mingw-1.4" …/…/…/…/Dev-Cpp/lib/libcollada14dom.a D:/Innovation/collada-dom/dom/external-libs/boost/lib/mingw/libboost_filesystem.a D:/Innovation/collada-dom/dom/external-libs/boost/lib/mingw/libboost_system.a D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcre.a D:/Innovation/collada-dom/dom/external-libs/libxml2/mingw/lib/libz.a D:/Innovation/collada-dom/dom/external-libs/tinyxml/lib/mingw/libtinyxml.a …/…/…/…/Dev-Cpp/lib/libxml2.lib D:/Innovation/zlib123/projects/libminizip.a …/…/…/…/Dev-Cpp/lib/libpcre.a D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcre.a D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a
D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x1a38):unzip.c: undefined reference to inflateInit2_' D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x1abe):unzip.c: undefined reference to
get_crc_table’
D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x1fcf):unzip.c: undefined reference to crc32' D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x206d):unzip.c: undefined reference to
inflate’
D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x20b9):unzip.c: undefined reference to crc32' D:/Innovation/zlib123/projects/libminizip.a(unzip.o)(.text+0x235b):unzip.c: undefined reference to
inflateEnd’
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x2f):pcrecpp.cc: undefined reference to pcre_config' D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x14a):pcrecpp.cc: undefined reference to
pcre_exec’
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x1bf):pcrecpp.cc: undefined reference to pcre_fullinfo' D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x1aef):pcrecpp.cc: undefined reference to
pcre_compile’
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x1bf1):pcrecpp.cc: undefined reference to pcre_compile' D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x1e54):pcrecpp.cc: undefined reference to
pcre_free’
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a(pcrecpp.o)(.text+0x1e67):pcrecpp.cc: undefined reference to `pcre_free’
collect2: ld returned 1 exit status
make.exe: *** [Colladatest.exe] Error 1
Execution terminate
Thanks,
Bhimesh
marcus
December 22, 2009, 12:15pm
3
Those are linker errors. Since you are statically linking, I think you need to order your library dependencies so that references are resolved correctly.
For example libpcrecpp.a needs to come before libpcre.a.
Regards,
Marcus
Thanks Marcus…
I am able to solve linker errors by reordering the library dependencies…
but find an error, again saying zlib1.dll missing… i downloaded zlib123.dll’s and now its working fine…
Thanks for your reply
This is the order of the library dependencies i am using… may be usefull if someone is looking for…
…/…/…/…/Dev-Cpp/lib/libcollada14dom.a
D:/Innovation/collada-dom/dom/external-libs/boost/lib/mingw/libboost_filesystem.a
D:/Innovation/collada-dom/dom/external-libs/boost/lib/mingw/libboost_system.a
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcre.a
D:/Innovation/zlib123/projects/libminizip.a
D:/Innovation/collada-dom/dom/external-libs/libxml2/mingw/lib/libz.a
D:/Innovation/collada-dom/dom/external-libs/tinyxml/lib/mingw/libtinyxml.a
…/…/…/…/Dev-Cpp/lib/libxml2.lib
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcrecpp.a
D:/Innovation/collada-dom/dom/external-libs/pcre/lib/mingw/libpcre.a
Thanks,
Bhimesh