* 0xcccccccc : Used by Microsoft’s C++ debugging runtime library to mark uninitialised stack memory
* 0xcdcdcdcd : Used by Microsoft’s C++ debugging runtime library to mark uninitialised heap memory
* 0xfeeefeee : Used by Microsoft’s HeapFree() to mark freed heap memory
* 0xabababab : Used by Microsoft’s HeapAlloc() to mark “no man’s land” guard bytes after allocated heap memory
* 0xabadcafe : A startup to this value to initialize all free memory to catch errant pointers
* 0xbaadf00d : Used by Microsoft’s LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory
* 0xbadcab1e : Error Code returned to the Microsoft eVC debugger when connection is severed to the debugger
* 0xbeefcace : Used by Microsoft .NET as a magic number in resource files
继续阅读 »
首页
› 月度存档 › 11 月 2016
内存中常见异常值的解释(比如0xcccccccc、0xcdcdcdcd和 0xfeeefeee 异常值)
CMake 自动检测系统编译器是否支持C++11
在 CMakeLists.txt 中加入以下代码, 可以自动判断系统编译器是否支持c++11标准:
1 2 3 4 5 6 7 8 9 10 |
include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() |
CMAKE的使用
一、 基本使用
安装:下载二进制包后可直接解压使用
从源码安装则执行命令:./bootstrap; make; make install——尝试执行bootstrap失败
使用:cmake dir_path,生成工程文件或makefile文件
二、 概念
out-of-source build,与in-source build相对,即将编译输出文件与源文件放到不同目录中;
三、 基本结构
1,依赖CMakeLists.txt文件,项目主目标一个,主目录中可指定包含的子目录;
2,在项目CMakeLists.txt中使用project指定项目名称,add_subdirectory添加子目录
3,子目录CMakeLists.txt将从父目录CMakeLists.txt继承设置(TBD,待检验)
四、 语法
1. #注释
继续阅读 »
近期评论