undefined reference to functions zzip_*

Problems building or running the engine, queries about how to use features etc.
martin_g
Gnoblar
Posts: 4
Joined: Sun Dec 22, 2013 6:15 pm

undefined reference to functions zzip_*

Post by martin_g »

Hello,

I'm entirely new to Ogre and VERY rusty with C++, so bear with me.

I'm on Windows 7 64-bit. I compiled boost, Ogre 1.8.1 and it's dependencies according to this article http://www.ogre3d.org/tikiwiki/tiki-ind ... +and+MinGW
Everything worked fine and I seem to have a fully compiled boost and Ogre SDK residing in:
d:\Programs\boost\boost_1_55_0 (all *.a and *.dll libraries were copied into lib)
d:\Programs\ogre3d\build\dependencies
d:\Programs\ogre3d\build\ogre-sdk

I still keep the sources in:
d:\Programs\boost\boost_1_55_0\boost
d:\Programs\ogre3d\source (includes Dependencies)

I want to use Eclipse for development. So I went to set up a first-time test project according to the textual description in http://www.ogre3d.org/tikiwiki/tiki-ind ... se+-+Linux . I disregarded the pictures in that article as they really don't tell why I should bother - and I don't intend to use CMake for now. I downloaded the Tutorial Framework for Windows from http://www.ogre3d.org/tikiwiki/tiki-ind ... +Framework .

This is my configuration within Eclipse:
- environment variables
OGRE_LOC - d:\Programs\ogre3d\source

- C/C++ Build, Settings -> Include paths:
"${OGRE_LOC}\OgreMain\include"
"d:\Programs\ogre3d\build\dependencies\include"
"d:\Programs\ogre3d\build\ogre-sdk\include"
"d:\Programs\boost\boost_1_55_0"
"d:\Programs\ogre3d\build\ogre-sdk\include\OGRE"
"d:\Programs\ogre3d\build\ogre-sdk\include\OIS"
"${OGRE_LOC}\Samples\Common\include"
"d:\Programs\ogre3d\Dependencies\src\ois\includes"

- MinGW C++ Linker -> Libraries -> Libraries:
zziplib
zlib
OgreMainStatic
boost_system-mgw48-mt-1_55
boost_thread-mgw48-mt-1_55
FreeImage
freetype
OIS

- MinGW C++ Linker -> Libraries -> Library search path:
"d:\Programs\ogre3d\build\dependencies\lib\Release"
"d:\Programs\boost\boost_1_55_0\lib"
"d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo"
"d:\Programs\ogre3d\build\ogre-sdk\lib"

PROBLEM
The project compiles, but the linker throws following errors:

Code: Select all

g++ "-Ld:\\Programs\\ogre3d\\build\\dependencies\\lib\\Release" "-Ld:\\Programs\\boost\\boost_1_55_0\\lib" "-Ld:\\Programs\\ogre3d\\build\\ogre-sdk\\lib\\RelWithDebInfo" "-Ld:\\Programs\\ogre3d\\build\\ogre-sdk\\lib" -o ogre_test.exe TutorialApplication.o BaseApplication.o -lzziplib -lzlib -lOgreMainStatic -lboost_system-mgw48-mt-1_55 -lboost_thread-mgw48-mt-1_55 -lFreeImage -lfreetype -lOIS 
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre13ZipDataStream4skipEl':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:347: undefined reference to `zzip_seek'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:352: undefined reference to `zzip_seek'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre13ZipDataStream4seekEj':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:364: undefined reference to `zzip_seek'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZNK4Ogre13ZipDataStream4tellEv':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:375: undefined reference to `zzip_tell'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre13ZipDataStream5closeEv':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:390: undefined reference to `zzip_file_close'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:390: undefined reference to `zzip_file_close'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre13ZipDataStream4readEPvj':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:322: undefined reference to `zzip_file_read'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:324: undefined reference to `zzip_dirhandle'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:325: undefined reference to `zzip_strerror_of'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre10ZipArchive6existsERKSs':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:261: undefined reference to `zzip_dir_stat'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre10ZipArchive6unloadEv':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:127: undefined reference to `zzip_dir_close'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZN4Ogre10ZipArchive4loadEv':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:90: undefined reference to `zzip_dir_open_ext_io'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:95: undefined reference to `zzip_dir_read'
d:\Programs\ogre3d\build\ogre-sdk\lib\RelWithDebInfo/libOgreMainStatic.a(OgreZip.cpp.obj): In function `ZNK4Ogre10ZipArchive4openERKSsb':
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:142: undefined reference to `zzip_file_open'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:167: undefined reference to `zzip_dir_stat'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:156: undefined reference to `zzip_error'
D:/Programs/ogre3d/source/OgreMain/src/OgreZip.cpp:150: undefined reference to `zzip_file_open'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(libraw_cxx.cpp.obj):libraw_cxx.cpp:(.text+0x4e20): undefined reference to `htons@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x2f95): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x4825): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x4947): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x4a34): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x4c0c): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x4efe): more undefined references to `ntohs@4' follow
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x11b7a): undefined reference to `htonl@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x11dfd): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x11e8a): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x1ba4b): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x1bf8b): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x1d8af): undefined reference to `ntohs@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x282a5): more undefined references to `ntohs@4' follow
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x2fc76): undefined reference to `htonl@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x3096a): undefined reference to `htonl@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x30a4a): undefined reference to `ntohl@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x31637): undefined reference to `htons@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x31680): undefined reference to `htonl@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x3283e): undefined reference to `htons@4'
d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj):dcraw_common.cpp:(.text+0x329a0): undefined reference to `ntohl@4'
d:/programs/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: d:\Programs\ogre3d\build\dependencies\lib\Release/libFreeImage.a(dcraw_common.cpp.obj): bad reloc address 0x0 in section `.rdata'
collect2.exe: error: ld returned 1 exit status
How do I get rid of the undefined references to zzip_* functions? Notice that I have the linker settings bind to the libraries zlib and zziplib and they are also on the search path d:\Programs\ogre3d\build\dependencies\lib\Release as libzlib.a and libzziplib.a.

EDIT: I just installed the newly available pre-built Ogre 1.8.1 for MinGW and built the same Eclipse project against this - and it worked. So I assume I must have made a mistake when compiling the dependencies. Is there a way to build them statically into Ogre? The pre-compiled Ogre seems to have statically linked dependencies.

Thanks in advance for any help.