Linking problem with compression functions

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking problem with compression functions

chris86
1>C:\Program Files (x86)\PCL 1.7.2\3rdParty\FLANN\include\flann/util/saving.h(67): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt\string.h(129): note: see declaration of 'strcpy'
1>C:\Program Files (x86)\PCL 1.7.2\3rdParty\FLANN\include\flann/util/logger.h(66): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt\stdio.h(205): note: see declaration of 'fopen'
1>  util3d_transforms.cpp
Hi everybody,

I want to build the rtabmap framework for windows with visual studio 2015.
The preparation steps went well, linke compiling opencv, pcl, etc.
But when I want to build the rtabmap_core project the following linking error occurs:

[...]
1>  Unknown compiler version - please run the configure tests and report the results
1>  Generating Code...
1>     Creating library [...]/rtabmap-master/lib/rtabmap_core.lib and object [...]/Tests/rtabmap-master/lib/rtabmap_core.exp
1>Compression.obj : error LNK2019: unresolved external symbol _compress referenced in function "class cv::Mat __cdecl rtabmap::compressData2(class cv::Mat const &)" (?compressData2@rtabmap@@YA?AVMat@cv@@ABV23@@Z)
1>Compression.obj : error LNK2019: unresolved external symbol _compressBound referenced in function "class cv::Mat __cdecl rtabmap::compressData2(class cv::Mat const &)" (?compressData2@rtabmap@@YA?AVMat@cv@@ABV23@@Z)
1>Compression.obj : error LNK2019: unresolved external symbol _uncompress referenced in function "class cv::Mat __cdecl rtabmap::uncompressData(unsigned char const *,unsigned long)" (?uncompressData@rtabmap@@YA?AVMat@cv@@PBEK@Z)
1>[...]\rtabmap-master\bin\rtabmap_core.dll : fatal error LNK1120: 3 unresolved externals

Has anybody an idea to solve the problem?
Thany you.
Best, Chris
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

matlabbe
Administrator
Hi,

Which zlib version did you install? The linker doesn't find some methods in the linked library.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

chris86
Thank you for your quick response.
I used zlib-1.2.8 from https://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz/download?use_mirror=netix&download= and compile without any errors.
Do you need further information?
Chris
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

matlabbe
Administrator
Can you show the cmake terminal output? Also, how did you build/install zlib?
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

chris86
After downloading zlib I call "cmake-gui.exe ." in the zlib-folder. Then I do configure, generate and build debug and release with visual studio 2015.

In rtabmap cmake configuration I set ZLIB_INLUDE_DIR to zlib-1.2.8 and ZLIB_LIBRARY_RELEASE to zlib-1.2.8/Release

Note:
I think the problem with the compression funktions don't come from zlib. This functions like "compressData2" are defined in rtabmap_core.


Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

matlabbe
Administrator
You can look if ZLIB_LIBRARIES is correctly set, like adding MESSAGE(STATUS "ZLIB_LIBRARIES=${ZLIB_LIBRARIES}") in this CMake file.

You error messages say:
- unresolved external symbol _compress
- unresolved external symbol _compressBound
- unresolved external symbol _uncompress

which are functions from zlib that the compiler cannot find. It is most likely (as you are using the same version than in build instructions) that zlib libraries are not correctly added to rtabmap core lib.
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

chris86
Thank you for the hint.
I add MESSAGE(STATUS "ZLIB_LIBRARIES=${ZLIB_LIBRARIES}") at the end of the cmakefile of the rtabmap.

Output:
ZLIB_LIBRARIES=optimized;[...]/zlib-1.2.8/Release;debug;[...]/zlib-1.2.8/Debug
Configuring done

It seems to bee ok!?
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

matlabbe
Administrator
ZLIB_LIBRARIES should contain the library path, not the directory. Mine gives:
ZLIB_LIBRARIES=/usr/lib/x86_64-linux-gnu/libz.so
but I am on linux. On Windows, it would be something like
ZLIB_LIBRARIES=[...]/zlib-1.2.8/Release/lib/zlib.lib
Not sure about optimized (release) and debug notation though. I'll give a try on Windows soon.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Linking problem with compression functions

chris86
You'r right! Thank you for you help.
Chris