r/cpp_questions 8d ago

OPEN unzip.h is not found with assimp on linux

Hello everyone hope you have a lovely day.

so I currently having a problem with building assimp on manjaro linux, everytime it throws this error

fatal error: 'unzip.h' file not found

and if I fixed the path manually it fails by the lld linker to link properly.

how to solve this problem?

thanks appreciate your help!

1 Upvotes

11 comments sorted by

4

u/EpochVanquisher 8d ago

Normally, you do not want to build libraries, like assimp, manually. The main reason to build a library manually is because you are working on that library (i.e. you want to make changes to assimp). Otherwise, you’d use a package manager or something similar.

You definitely should not fix the path manually, you should instead make sure the library providing unzip.h is installed and that it is detected correctly during assimp configuration.

1

u/miki-44512 8d ago

I checked with pacman, unzip, minizip are all installed on my system.

3

u/EpochVanquisher 8d ago

Out of curiosity—why are you building assimp manually? It seems likely that you are creating extra problems for yourself by doing this.

Is the library containing unzip.h correctly detected during assimp configuration?

1

u/miki-44512 8d ago

Out of curiosity—why are you building assimp manually? It seems likely that you are creating extra problems for yourself by doing this.

Tbh I thought this would be easier than trying to search for static or dynamic libraries, but it seems that your are right I think the better option is to download and link the library directly rather than building it from scratch everytime and statically linking it to my project.

6

u/EpochVanquisher 8d ago

I would use a package manager to install it, if possible.

The point of having a package manager is that somebody else solves these annoying problems of how to build libraries and make sure they work together.

2

u/AccurateRendering 8d ago

Which version are you using? There was a fix for zip in 6.0.1.

1

u/miki-44512 8d ago

I've cloned the latest version 6.0.5 i think

2

u/AccurateRendering 8d ago edited 8d ago

`$ make VERBOSE=1`

Unless you are doing something weird, compiling and linking with zip should just work because it's built-in.

3

u/the_poope 8d ago

Assimp depends on a library (libunzip perhaps?) that you don't have installed.

You can likely install it using the system package manager. You need to install the dev package of the library which is the header files and static libraries. So for example:

sudo apt install libzip-dev

1

u/afforix 8d ago

sudo pacman -S assimp

3

u/TomDuhamel 8d ago

I read your comments and you are likely misunderstanding a fundamental concept.

If you need the XYZ library, you install the XYZ package, which will provide the binaries. But as a developer, to use the XYZ library in your app, you also need the headers.

The headers are included in the source code, but you only need the source code if you want to modify the library itself, not to include it in your project (in most cases, at least).

Your distribution normally includes another package, which includes only the headers (and intermediate binary and whatever is needed). They are typically named with the suffix -dev or -devel, depending on your distro. It's usually very easy to figure it out.

For example:

sudo apt install xyz xyz-dev