Can't add Embree to my project, getting LNK1104 error

451 views Asked by At

I'm trying to add Embree to an already working solution, following this resource I've added to my CMakeLists.txt file the following:

FIND_PACKAGE(embree 3.0 REQUIRED)
INCLUDE_DIRECTORIES(${EMBREE_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(application ${EMBREE_LIBRARY})

I've also created a Windows environment variable embree_DIR with my Embree installation folder ("C:\Program Files\Intel\Embree3 x64").

CMake configures the solution fine, but when I build I get a fatal error LNK1104: impossible to open 'embree3.lib'.

Just so you know, I actually have a C:\Program Files\Intel\Embree3 x64\lib\embree3.lib file.

Anyone has any clue why this might be happening?

1

There are 1 answers

0
Vertexwahn On

Set EMBREE_ROOT_DIR e.g.:

set(EMBREE_ROOT_DIR "C:/thirdparty/vs2017/x64/embree-2.17.0")

Link to ${EMBREE_LIBRARIES}

target_link_libraries(YourApp
    ...
    ${EMBREE_LIBRARIES}
    ...
)