Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 Test的一个问题 #3

Open
zhaozhengcoder opened this issue Nov 9, 2018 · 3 comments
Open

关于 Test的一个问题 #3

zhaozhengcoder opened this issue Nov 9, 2018 · 3 comments

Comments

@zhaozhengcoder
Copy link

zhaozhengcoder commented Nov 9, 2018

在你的test目录下面,这里调用的还是默认的stl的代码,并不是你仓库里面的sgi-stl的代码。test里面调用的应该是 /usr/include/c++/5.x 里面的代码吧?

请问,你有没有调用过仓库里面的sgi-stl的的源码?

下面是你的test文件

#include <iostream>
#include <vector>
using namespace std;
template <typename T>
void printVector(const vector<T>& vec)
{
	for (auto x : vec) {
		cout << x << " ";
	}
	cout << endl;
}
int main()
{
	// 构造函数:四种形式
	vector<string> iv(2, "hi");
        // ....
}
@xinnjie
Copy link

xinnjie commented Nov 18, 2018

你需要把 sgi-stl 的头文件在编译时加进去 -I $some_sgi_header这样子

@codwam
Copy link

codwam commented Feb 25, 2021

@xinnjie 能不能说详细一点,或者直接在VsCode上面直接调试

@xinnjie
Copy link

xinnjie commented Feb 28, 2021

@xinnjie 能不能说详细一点,或者直接在VsCode上面直接调试

gcc -I可以添加头文件搜索目录, -I$some_sgi_header 就添加上了sgiSTL的路径
更加详细看 gcc文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants