An include problem

Hello all. I have a problem with a structs.h file. Compiler gcc say that

`wstring' does not name a type ...


I am working in XP and gcc CodeBlocks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef STRUCTS_H_INCLUDED
#define STRUCTS_H_INCLUDED

#include <string.h>
#include <vector.h>

struct link {
     int target;
     vector<int>cdPnts;
};
vector<link> links;
struct prot {
     wstring lig;
     int times;
     vector<int>cd;
};


I dont understud what i have wrong. If in main i have not the #include "structs.h", there is no problem.
My guess is you need to scope it to the std namespace.
Try std::wstring

~psault

edit: probably error in terminology, I should say you probably want to use the std namespace scope for declaring the variable.

Also, firedraco is telling you to use C++ headers instead of depricated C ones.

Last edited on
You need to include string and vector not string.h and vector.h.
Compiler take both. Need using namespace std;
Thank's
Jim
Topic archived. No new replies allowed.