07 2020 档案
摘要:ld链接器在链接静态库时,如果这些库有依赖关系,那么要注意链接时的顺序。 如果在编译脚本或者CMakeLists.txt中明明已经链接了这些静态库,但是使用链接后的库或者可执行文件时,报undefined reference错误 使用nm -C命令查看链接后的库或可执行文件中的符号时,符号类型为U,
阅读全文
摘要:转义序列 终端输出的颜色由转义序列控制, 转义序列以控制字符串"ESC"开头, ASCII码对应的十进制是27, 十六进制是0x1B, 八进制是033. 转义序列以"ESC"和左括号"["开头, 以"m"结尾: \033[ Param {;Param;...}m 或 \e[ Param {;Para
阅读全文
摘要:
阅读全文
摘要:__attribute__可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)。__attribute__前后都有两个下划线. __attribute__语法格式为 __attribute__ ( ( a
阅读全文
摘要:SET(CMAKE_C_COMPILER "gcc-4.9") # 指定gcc-4.9版本的编译器 SET(CMAKE_CXX_COMPILER "g++-4.9") SET(CMAKE_CXX_COMPILER_ID GNU) SET(CMAKE_CXX_COMPILER_VERSION 4.9.
阅读全文
摘要:编译工程时需要增加两个选项 SET(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage ${CMAKE_C_FLAGS} ") SET(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage ${CMAKE_CXX_FL
阅读全文
摘要:删除远程分支 git push origin --delete <branch> 删除本地分支 git branch -d <branch> # delete fully mnerged branch git branch -D <branch> # delete branch (even if n
阅读全文