## 博文

### 编译期移除__FILE__的冗余前缀

On the CMakeLists.txt file, define a macro that has the length of the path to your project on CMake: # The additional / is important to remove the last character from the path. # Note that it does not matter if the OS uses / or \, because we are only # saving the path size. string (LENGTH "\${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE) add_definitions( "-DSOURCE_PATH_SIZE=\${SOURCE_PATH_SIZE}" ) On your source code, define a __FILENAME__ macro that just adds the source path size to the __FILE__ macro: # define __FILENAME__ (__FILE__ + SOURCE_PATH_SIZE)

### windows下给clion增加库文件

假定使用的mingw 那么去 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32 增加include和lib即可