At the top of the file, I have:
#include "vector.h"
then I do a:
vector<vtarg> targVector;
and got the following error
Cannot open include file: 'vector.h': No such file or directory
Am I missing out something? I tried #include "vector" even more errors.
#include "afxwin.h"
#include "vector.h"
// CTargDlg dialog
class CTargDlg : public CDialog {
// Construction
public:
CTargDlg(CWnd* pParent = NULL);
// standard constructor
vector<vtarg> targVector;
You need to use
#include <vector>
instead, without the .h
file extension. Furthermore, the vector
template lives in the std
namespace, so you should define your vector like
std::vector<vtarg> targVector;
Also make sure to include whatever headers are necessary for vtarg
.
You made 3 errors.
First, the include file is called vector, not vector.h.
Second, this vector is an include that's part of the standard C++ run-time library, you need to use the <> include construction, like this:
#include <vector>
Third, the vector class (actually templated class) belongs to the std namespace. So you should write:
std::vector<vtarg> targVector;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With