The definition of the struct is:
struct DummycppGrabber
{
struct LowLevelGrabber g;//defined elsewhere
int grab_x0, grab_y0, grab_xsize, grab_ysize;
double grab_gain, grab_offset;
long picnum;
int camera;
int framescnt;
};
somewwhere in this file the function NameToVal() is used, the corresponding header file is also included
At the end of the file occur this:
struct DummycppGrabber DummycppGrabberFuncs =
{
{
{
/* type */ HW_LLGRABBER,
/* name */ "DummycppGrabber",
/* size */ sizeof(struct DummycppGrabber),
/* ParamSet */ DummycppParamSet,
/* ParamGet */ DummycppParamGet,
/* Init */ DummycppInit,
/* Close */ DummycppClose
},
/* InfoText */ NULL,
/* GetMaxGain */ NULL,
/* GetMaxOffset */ NULL,
/* GetGain */ NULL,
/* GetOffset */ NULL,
/* SetGain */ NULL,
/* SetOffset */ NULL,
/* GetPixelsize */ NULL,
/* GetMaxROI */ NULL,
/* GetROI */ NULL,
/* GetROIsize */ NULL,
/* SetROI */ NULL,
/* GetMaxGrabs */ NULL,
/* GetNumGrabs */ NULL,
/* LiveOut */ NULL,
/* Grab2Obj */ NULL,
/* Grab2Buf */ NULL,
/* Grab */ DummycppGrab,
/* GetGrab2Obj */ NULL,
/* ChopGrab */ NULL,
/* GetGrab2ByteBuf */ DummycppGetGrab2ByteBuf,
/* GetGrab2UshortBuf*/ DummycppGetGrab2UshortBuf,
/* GetLine2ByteBuf */ DummycppGetLine2ByteBuf,
/* GetLine2UshortBuf */ DummycppGetLine2UshortBuf,
/* PutGrabNrFromByteBuf */NULL,
/* ALU */ NULL,
/* WaitGrabDone */ DummycppWaitGrabDone,
/* GetLine2UlongBuf */ NULL,
/* GetGrab2UlongBuf */ NULL,
/* GetGrab2DoubleBuf */ NULL,
/* GetLine2DoubleBuf */ NULL,
}
};
I get this error:
dummy.obj : error LNK2001: Nichtaufgeloestes externes Symbol "int __cdecl NameToVal(char const * const * const,int const * const,int,char const *,int)" (?NameToVal@@YAHQBQBDQBHHPBDH@Z)
mcpp.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
The meaning is: not resolved external symbol "int ....."
If I exclude this struct the linker works correctly. If I change the struct declaration to the c++ style (removing the struct statement) I get the same error. Maybe the error is obvious but I'm not too familar with c++