Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
BugGlobal flag to mark a deviation from expected behaviour
Description
Describe the bug
After CMake configure and generate the build fails with the error ld: library not found for -lminizip. As can be seen in the screen shot below CMake has found libminizip.dylib. And as can be seen in the link command given in Additional Context there is no option to add /opt/local/lib as a place to search for libaries. So it is not surprising the link fails.
To Reproduce
Steps to reproduce the behavior:
- Install minizip via macports -
sudo port install minizip - Run CMake GUI. Configure - selecting default build tools (Xcode), and selecting only importers (no tools, no exporters).
- Generate project
cd <directory with generated project>; cmake --build . --config Release- See error
Expected behavior
I expect the build to succeed.
Screenshots
Screenshot of CMake GUI showing it found libminizip.dylib in /opt/local/lib:
Platform (please complete the following information):
- OS: macOS
- Browser: n/a
- Version 11.4 (Big Sur)
Additional context
Here is the link command and output:
Ld /Users/mark/Projects/github/assimp/macOS/bin/Release/libassimp.5.0.1.dylib normal (in target 'assimp' from project 'Assimp')
cd /Users/mark/Projects/github/assimp/assimp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos11.3 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -L/Users/mark/Projects/github/assimp/macOS/bin/Release -F/Users/mark/Projects/github/assimp/macOS/bin/Release -filelist /Users/mark/Projects/github/assimp/macOS/code/Assimp.build/Release/assimp.build/Objects-normal/x86_64/assimp.5.0.1.LinkFileList -install_name /libassimp.5.0.1.dylib -Xlinker -rpath -Xlinker /Users/mark/Projects/github/assimp/macOS/bin/Release -dynamiclib -Wl,-headerpad_max_install_names -install_name @rpath/libassimp.5.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libz.tbd /Users/mark/Projects/github/assimp/macOS/bin/Release/libdraco.1.dylib -lminizip -Xlinker -no_adhoc_codesign -compatibility_version 5.0.0 -current_version 5.0.1 -Xlinker -dependency_info -Xlinker /Users/mark/Projects/github/assimp/macOS/code/Assimp.build/Release/assimp.build/Objects-normal/x86_64/assimp.5.0.1_dependency_info.dat -o /Users/mark/Projects/github/assimp/macOS/bin/Release/libassimp.5.0.1.dylib
ld: library not found for -lminizip
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Activity
MarkCallow commentedon Jun 9, 2021
Can I get some help here. I am completely stalled.
I started trying to update my libassimp build because the latest clang versions give lots of warnings about deprecated copy constructors with the assimp headers of the version I was using. Unfortunately, but not surprisingly, if I compile my app with the latest headers but link it to the older version of the library, it crashes when run.
MarkCallow commentedon Jul 2, 2021
Can anyone build this library for macOS? I'm still failing. Don't the authors care?
ryandesign commentedon Feb 21, 2022
Yeah if assimp wants to link with MacPorts minizip, it's going to have to use either
-L/opt/local/lib -lminizip, or use-lminizipand have/opt/local/libinLIBRARY_PATH, or use the full path/opt/local/lib/libminizip.dylib. I don't know how assimp is deciding what flags to use, but it would have gotten a working set of flags if it had used, say,pkg-config:If you want something that just works, you can install assimp with MacPorts.
tellypresence commentedon Apr 15, 2025
@MarkCallow Is this still a problem?
MarkCallow commentedon Apr 16, 2025
I don't use MacPorts any more so I can't say. I'm using vcpkg now for my dependencies, so I get libraries that can be bundled with my app, and vcpkg is building assimp without a problem.
I'll close this as "not planned."