0

I have a problem using id3lib.dll in a Windows C++ CMake project. I have some experience in C++ but I have never tried to include use .dll file in my project. I have not seen any id3lib documentation on how to include dll in your project. I have seen some generic answers on how to include a dll with CMake but I couldn't make it work. I get this error:

C:\...\main.cpp:3:21: fatal error: id3/tag.h: No such file or directory
#include <id3/tag.h>

I have tried this in CMake but library wasn't found:

# searching for include directory
find_path(ID3_INCLUDE_DIR id3/tag.h)

# searching for library file
find_library(ID3_LIBRARY id3)
if (ID3_INCLUDE_DIR)
    message(" found lib")
    endif()
arved
  • 4,401
  • 4
  • 30
  • 53
  • `Compiler can't find id3/tag.h` - Compiler or CMake cannot find this file? Show the **exact error message** you got. – Tsyvarev May 06 '18 at 13:19
  • @Tsyvarev C:\...\main.cpp:3:21: fatal error: id3/tag.h: No such file or directory #include –  May 06 '18 at 14:21
  • Add this error message to the question post (by [edit]ing it). You need to setup include directories with [include_directories](https://cmake.org/cmake/help/v3.9/command/include_directories.html). Like this: `include_directories(${ID3_INCLUDE_DIR})`. – Tsyvarev May 06 '18 at 15:07
  • @Tsyvarev I think that the problem is that I don't have header files. I didn't know I need them. I have downloaded id3lib binaries and in the zip file there are only id3lib.dll, id3lib.exp and id3lib.lib files. I have also found full source code of the library but I don't know how to add it to my CMake project since it is not using CMake but normal makefiles. And I think it would be simpler to just use the .dll library. –  May 06 '18 at 18:11

0 Answers0