我正在为大学制作C ++和allegro5项目。我编译了allegro库,它在Xcode中运行良好。但我想在CLion中完成我的项目,并且一旦尝试构建包括allegro在内的项目,它就会抛出错误:
ld: library not found for -lallegro_acodec
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [TEST1] Error 1
make[1]: *** [CMakeFiles/TEST1.dir/all] Error 2
make: *** [all] Error 2
的CMakeLists.txt:
cmake_minimum_required(VERSION 3.3)
project(TEST1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(TEST1 ${SOURCE_FILES})
INCLUDE_DIRECTORIES( /usr/local/Cellar/allegro/5.0.11/include )
LINK_DIRECTORIES( /usr/local/Cellar/allegro/5.0.11/lib )
TARGET_LINK_LIBRARIES(TEST1
allegro_acodec
allegro_audio
allegro_color
allegro_dialog
allegro_image
allegro_main
allegro_memfile
allegro_physfs
allegro_primitives
allegro_ttf
allegro_font
allegro)
main.cpp中:
#include <iostream>
#include <allegro5/allegro.h>
using namespace std;
int main(int argc, char **argv) {
al_init();
return 0;
}
我正在使用OSX 10.11。我无法找到解决问题的方法。我认为快板和克里昂并不那么受欢迎。任何人都可以帮助我这个错误意味着什么吗?
答案 0 :(得分:2)