Can't compile lib tiff

Joined
Jan 9, 2022
Messages
3
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?
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
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
3
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.
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
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.
 
Joined
Jan 9, 2022
Messages
3
Reaction score
0
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.

No, all i want to do, is link the .a files or dll's, still don't know what i should link to lib_tiff, in order to make it stop complaining about undefined things. I left this topic for some time, but now i am trying to compile it again, and still doesn't work, and i didn't find any specific data how to fix it.

This target_link_libraries requires an exe to even link anything, i don't have any exe, because it's not an application... Another command add_library, requires some sources and seems like it doesn't even do what i want it to do, looks like it does create a new lib, instead of just linking it, otherwise idk for which reason any source is needed at all, and i don't know which source i should put over there, there are like 30 files.

All i have, is few .a files, few headers, and the problem is that in another project with cmakelist i have to make it available, in order to compile it without undefined errors, that's it.
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top