I tried to compile the jemalloc demo using cmake/And here is my initial cmake code.
//brew install jemalloc
in CMakeLists
link_directories(/usr/local/lib)
target_link_libraries(${PROJECT_NAME} jemalloc)
in cpp
#include <jemalloc/jemalloc.h>
Error: cannot include <jemalloc/jemalloc.h>
... ok, fine. I try that.
in CMakeLists
include_directories(/usr/local/include)
link_directories(/usr/local/lib)
target_link_libraries(${PROJECT_NAME} jemalloc)
make
[build] ld: library not found for -ljemalloc
[build] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[build] make[3]: *** [demo] Error 1
[build] make[2]: *** [CMakeFiles/demo.dir/all] Error 2
[build] make[1]: *** [CMakeFiles/demo.dir/rule] Error 2
I don't know what to do?
I tried to compile from the command line.
clang -std=c++11 demo.cpp -ljemalloc
It's ok....
Maybe I can put some pictures.