Hello Liu, > However, after ccmake and then make, I got the error: > main.cxx:(.text+0x10a): undefined reference to `func()' > collect2: ld returned 1 exit status Can you put SET (CMAKE_VERBOSE_MAKEFILE TRUE) to your CMakeLists.txt to check what compiler command is run? bye C.M.