assimp / assimp

The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.
https://www.assimp.org
Other
10.9k stars 2.91k forks source link

CMake PkgConfig and ZLIB errors #120

Closed kimkulling closed 10 years ago

kimkulling commented 11 years ago

I checked out the latest svn revision (1298), opened up CMake v2.8.9, pointed it to the assimp source code folder, hit "configure" and got the following output: Check for working C compiler using: Visual Studio 10 Check for working C compiler using: Visual Studio 10 -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler using: Visual Studio 10 Check for working CXX compiler using: Visual Studio 10 -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Boost version: 1.51.0 Looking for ZLIB... Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could not locate ZLIB compiling zlib from souces Looking for sys/types.h Looking for sys/types.h - found Looking for stdint.h Looking for stdint.h - found Looking for stddef.h Looking for stddef.h - found Check size of off64_t Check size of off64_t - failed Looking for fseeko Looking for fseeko - not found Looking for unistd.h Looking for unistd.h - not found Looking for DirectX... DirectX_PREFIX_PATH changed. Found DirectX: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86/d3d9.lib DX lib dir: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86 Configuring done The project compiles and runs just fine. Even the static lib version compiles. But when I try to link to the static lib, I get the following output: Warning 1 warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification Warning 2 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library Error 3 error LNK2001: unresolved external symbol _inflateEnd assimpD_static.lib(XGLLoader.obj) Error 4 error LNK2001: unresolved external symbol _inflateEnd assimpD_static.lib(BlenderLoader.obj) Error 5 error LNK2001: unresolved external symbol _inflateEnd assimpD_static.lib(unzip.obj) Error 6 error LNK2001: unresolved external symbol _inflateEnd assimpD_static.lib(XFileParser.obj) Error 7 error LNK2001: unresolved external symbol _inflate assimpD_static.lib(XGLLoader.obj) Error 8 error LNK2001: unresolved external symbol _inflate assimpD_static.lib(BlenderLoader.obj) Error 9 error LNK2001: unresolved external symbol _inflate assimpD_static.lib(unzip.obj) Error 10 error LNK2001: unresolved external symbol _inflate assimpD_static.lib(XFileParser.obj) Error 11 error LNK2001: unresolved external symbol inflateInit2 assimpD_static.lib(XGLLoader.obj) Error 12 error LNK2001: unresolved external symbol inflateInit2 assimpD_static.lib(BlenderLoader.obj) Error 13 error LNK2001: unresolved external symbol inflateInit2 assimpD_static.lib(unzip.obj) Error 14 error LNK2001: unresolved external symbol inflateInit2 assimpD_static.lib(XFileParser.obj) Error 15 error LNK2001: unresolved external symbol _get_crc_table assimpD_static.lib(unzip.obj) Error 16 error LNK2001: unresolved external symbol _crc32 assimpD_static.lib(unzip.obj) Error 17 error LNK2001: unresolved external symbol _inflateSetDictionary assimpD_static.lib(XFileParser.obj) Error 18 error LNK2001: unresolved external symbol _inflateReset assimpD_static.lib(XFileParser.obj) Error 19 error LNK1120: 7 unresolved externals This leads me to believe that zlib was not properly linked into assimp.lib, since most of those are zlib functions and the CMake output said it failed to find zlib. This occurs on a Windows 7 64-bit machine (compiling for 32-bit) in VC10. If there is a way I could fix this, please let me know!

see: https://sourceforge.net/p/assimp/bugs/90/

kimkulling commented 10 years ago

Deprecated.

micdoodle8 commented 9 years ago

I know this issue is exactly 1 year old, but if anyone is having similar issues, setting "Link Library Dependencies" to Yes in "Assimp Project Properties > Librarian > All Options" and rebuilding will solve it.

xubaoquan33 commented 7 years ago

i met a similar issue a few days ago. when i use cmake to configure, it can find ZLIB which is carried by cmake. but when i build the sln , i get the same output, the same error. after i tryed the solution of above, it didn't work .So i deleted the ZLIB of my computer and let cmake to compiling ZLIB from source, it work.The error disappear! (i used the version 3.1.1)

asingh12203 commented 7 years ago

I am facing another issue, that is solution is compiling successfully. But I am unable to find the build libraries. It is not found in the "Win32/Debug" folder. I am using the latest 4.0.1 version. And also while creating "sln" file I am facing following error:-

The C compiler identification is MSVC 19.0.24215.1 The CXX compiler identification is MSVC 19.0.24215.1 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done CMake Warning (dev) at C:/Users/ayush.rastogi/Downloads/cmake-3.9.3-win64-x64/cmake-3.9.3-win64-x64/share/cmake-3.9/Modules/FindOpenMP.cmake:212 (if): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Quoted variables like "MSVC" will no longer be dereferenced when the policy is set to NEW. Since the policy is not set the OLD behavior will be used. Call Stack (most recent call first): C:/Users/ayush.rastogi/Downloads/cmake-3.9.3-win64-x64/cmake-3.9.3-win64-x64/share/cmake-3.9/Modules/FindOpenMP.cmake:324 (_OPENMP_GET_FLAGS) CMakeLists.txt:147 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

Found OpenMP_C: -openmp (found version "2.0") Found OpenMP_CXX: -openmp (found version "2.0") Looking for DirectX... DirectX_PREFIX_PATH changed. Could not locate DirectX Looking for ZLIB... Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could not locate ZLIB compiling zlib from souces Looking for sys/types.h Looking for sys/types.h - found Looking for stdint.h Looking for stdint.h - found Looking for stddef.h Looking for stddef.h - found Check size of off64_t Check size of off64_t - failed Looking for fseeko Looking for fseeko - not found Looking for unistd.h Looking for unistd.h - not found Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Could NOT find rt (missing: RT_LIBRARY) Enabled formats: AMF 3DS AC ASE ASSBIN ASSXML B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD Disabled formats: Could NOT find IL (missing: IL_LIBRARIES IL_INCLUDE_DIR) CMake Warning at CMakeLists.txt:390 (MESSAGE): Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: Qt5 DevIL

Configuring done

xubaoquan33 commented 7 years ago

If you build the sln successfully,you will find the library by the follow path:..\code\Release....You will see the assimp.dll assimp.lib