0

I'm trying to link up CMake for a old project, this is the relevant structure:

Project 
  -build
  -src
  -res/include/irk
             -all the irrklang header files

In my top-level CMakeLists.txt I have:

target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/res/include/irk/")

I believe that's all that is needed since IrrKlang is a header-only library as far as I know. When I try to build however, I get this error:

undefined reference to `irrklang::createIrrKlangDevice(irrklang::E_SOUND_OUTPUT_DRIVER, int, char const*, char const*)'

For some reason CMake doesnt pick up on the library and I've no idea why.

agent25
  • 47
  • 9
  • 2
    I didn't find any indication on the irrklang website indicating it's a header only lib. [The hello world example](https://www.ambiera.com/irrklang/tutorial-helloworld.html) seems to indicate the opposite: `#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll` It doesn't seem like you linked the shared lib in CMake... – fabian Nov 10 '21 at 20:55
  • @fabian My bad. Thank you. – agent25 Nov 10 '21 at 21:14

0 Answers0