1

I want write the program with next struct

stdafx.h - contains some #define defenitions of program constants and #include of headers wich uses in all project.

frmMain.h - contatins code of Form1 also can Show form2 and uses some code from BckHeadr.h and some functions call that headers included in stdafx.h.

frmIniPrgs.h - contatins code of Form2 and uses some code from BckHeadr.h and some functions call that headers included in stdafx.h.

BckHeadr.h - contatins some definitions of functions and some functions call that headers included in stdafx.h.

I know what i must use #ifndef or #pragma once directives. But i can not decided this problem. I included in stdafx.h: frmIniPrgs.H, BckHeadr.h, frmMain.h. And use #ifndef in all modules. I uset it like this:

#ifndef MYMODULE_H
#define MYMODULE_H
//module code
#endif

There is next errors in my project (i have russian visual studio and text of errors is translate by google translate and may contain the errors, ScnIniPackages is my function in BckHeadr.h ):

BckHeadr.h (96): error C3861: PtrToStringChars: identifier not found 
BckHeadr.h (141): error C2065: vector: undeclared identifier 
BckHeadr.h (141): error C2062: type "int" is not required 
BckHeadr.h (141): error C2143: syntax error: no ";" before "(" 
BckHeadr.h (141): error C2447: (: missing function header (possibly using a formal list of old type) 
BckHeadr.h (169): error C2065: vector: undeclared identifier 
frmIniPrgs.h (119): error C2065: vector: undeclared identifier 
frmIniPrgs.h (122): error C3861: ScnIniPackages: identifier not found 
frmIniPrgs.h (121): error C2065: vector: undeclared identifier 
C: \ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ include \ Wininet.h (381): error C2872: FILETIME: ambiguous symbol 
    be 'C: \ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ include \ windef.h (377): _FILETIME FILETIME' 
    or 'c: \ windows \ microsoft.net \ framework \ v2.0.50727 \ mscorlib.dll: System:: Runtime:: InteropServices:: FILETIME' 
8
  • 1
    You used the "linking" tag; are you encountering a compiler error or a linker error? Commented Apr 5, 2010 at 3:48
  • 2
    If you showed them to us, we could probably help.
    – GManNickG
    Commented Apr 5, 2010 at 4:03
  • 1
    Looks like the headers are not included properly. By any chance you used same MYMODULE_H for every file ?
    – aJ.
    Commented Apr 5, 2010 at 4:42
  • In your .cpp file, did you by any chance include BckHeadr.h before stdafx.h?
    – ZoogieZork
    Commented Apr 5, 2010 at 4:44
  • for all files i have different MYMODULE_H. I have no code in .cpp files all code write in .h files. But i have thr frmIniPrgs.cpp in which write: #include "stdafx.h" #include "frmIniPrgs.h"
    – Xaver
    Commented Apr 5, 2010 at 4:55

2 Answers 2

1

Try

#include <vector>
using namespace std;

This may solve some of the errors (if not all).

1

You have to include proper STL headers.

#include <vector>

Also you can add namespace as

using namespace std;

Or use STL classes as

std::vector<>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.