【发布时间】:2016-12-02 00:34:58
【问题描述】:
我想知道字符串是如何工作的,所以我在 basic_string.h 中添加了断点。 但是我调试的时候并没有进入这些断点。
当我在调试时添加断点时,GDB 控制台会显示: 文件“C:/Users/manch/Downloads/MinGW/lib/gcc/mingw32/4.8.1/include/c++/bits/basic_string.h”中没有第1008行。
这是我的测试代码
#include <iostream>
#include <string>
int main() {
std::string *ps = new std::string("hello");
ps->append(" world");
return 0;
}
和 CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(Stl)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp test.cpp C:/Users/manch/Downloads/MinGW/lib/gcc/mingw32/4.8.1/include/c++/bits/stl_construct_copy.h)
add_executable(Stl ${SOURCE_FILES})
【问题讨论】: