我正在尝试使用Clion在macOS上创建一个跨平台的openGL应用程序。 Cmake脚本可以正确找到assimp库,但是无法链接它。
我尝试重新安装assimp,然后重新编译它。接下来,我检查了手动编译是否完成了这项工作(令人惊讶的是)。
以下是命令:String captchaText = element.getText();
(它也适用于g ++)。
这是我的CmakeList.txt:
String captchaResult = new javax.script.ScriptEngineManager().getEngineByName("javascript").eval(captchaText).toString();
这是我的应用程序:
clang main.cpp -std=c++11 -framework OpenGL -lglfw -lassimp -lglew -o main
错误:
cmake_minimum_required(VERSION 3.12)
project(OpenGlSetup)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/Modules/")
message(CMAKE_MODULE_PATH : ${PROJECT_SOURCE_DIR}/Modules/)
set(SOURCE_FILES main.cpp)
add_executable(OpenGlSetup ${SOURCE_FILES})
find_package(ASSIMP REQUIRED)
IF (NOT ASSIMP_FOUND)
message(WARNING ASSIMP-NOT-FOUND : ${ASSIMP_INCLUDE_DIRS})
ENDIF()
*** rest of the libraries are loaded in the same way, and they load properly (project compiles and run provided i remove assimp parts) **
include_directories(${OPENGL_INCLUDE_DIR} ${GLM_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIRS})
link_directories(${ASSIMP_INCLUDE_DIRS})
target_link_libraries(OpenGlSetup ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${ASSIMP_LIBRARIES} glfw)