ok i have got 4 files main.cpp One.cpp Two.cpp and variabl.h



in variabl.h i have got declaration
---------
struct CAPTURESTRUCT
{
int State;
};

extern CAPTURESTRUCT CaptureStru;
-----------

im using this variable in this (one,two).cpp

when i try to link i have got unresolved external.
Posted on 2004-09-14 11:48:08 by AceEmbler
Do you declare the variable in any file, or do you have it only as "extern"?
Posted on 2004-09-14 12:04:40 by f0dder
that is the problem indeed, imho.

extern only says "there is a variable in some other file of the type this and this and is named that". but the variable has to exist too, somewhere. if it doesn't, the linker will tell you it.
Posted on 2004-09-14 12:18:32 by lifewire
extern CAPTURESTRUCT CaptureStru;
CAPTURESTRUCT CaptureStru;

This is so stupid.


Thanks. :)
Posted on 2004-09-14 13:52:26 by AceEmbler