Can't compile lib tiff


Joined
Jan 9, 2022
Messages
2
Reaction score
0
When i try to compile it i get undefined reference to `jpeg_abort', and many other ones.
So i compiled without problems the actual jpeg lib, i include the path into cmakelist and still it doesn't work.

This is the source
set(JPEG_DIR C:/Users/libjpeg-master/)
include_directories(
C:/Users/libjpeg-master/
)

This is the compiled folder, with libjpeg-62.dll and libturbojpeg.dll
set(JPEG_DIR C:/Users/libjpeg-master/jpeg_lib)
include_directories(
C:/Users/libjpeg-master/jpeg_lib
)

Still doesn't work and i get same errors, after 3h i am done with this bs, always when dealing with cmake there are problems.
Any clue how to fix it?
 
Ad

Advertisements

Joined
Mar 3, 2021
Messages
174
Reaction score
19
Undefined references mean that it found the header libraries but not the library file(s). The include_directories directive helps it find the headers, but to tell it to compile a target (executable or library) with a library included you have to use the target_link_libraries directive.
 
Joined
Jan 9, 2022
Messages
2
Reaction score
0
Undefined references mean that it found the header libraries but not the library file(s). The include_directories directive helps it find the headers, but to tell it to compile a target (executable or library) with a library included you have to use the target_link_libraries directive.
And how can i do it? I already was trying to do that, but as always, no luck. The example i tried doesn't work.
 
Ad

Advertisements

Joined
Mar 3, 2021
Messages
174
Reaction score
19
Wait, are you making the CMake file for your own project? Or are you compiling the actual libtiff and modifying that one? Try setting JPEG_ROOT to that instead of DIR. CMake's find_library function uses that variable to find stuff, usually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top