以前遇到过这个问题,但是忘了是怎么解决的
我想使用 STL 字符串类,但编译器提示找不到它。 这是完整的 .h 文件。
#ifndef MODEL_H
#define MODEL_H
#include "../shared/gltools.h" // OpenGL toolkit
#include <math.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include "Types.h"
class Model
{
public:
obj_type_ptr p_object;
char Load3DS (char *p_filename);
int LoadBitmap(char *filename);
int num_texture;
string fun("alex");
Model(char* modelName, char* textureFileName);
};
#endif
最佳答案
你想使用 std::string
,是吗?
您只是在使用 string
。如果你有一个 using namespace ...
声明,这会起作用,但在头文件中并不是一个好主意。
关于c++ - 无法使用 STL 的字符串类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2226412/