function call from header

Hi,

i've got These 3 files:

1
2
// OTI.h
extern void Unpack(void* Packet);


1
2
3
4
5
6
7
// PackUnpack.cpp
#include "OptiTrackInterface.h"

void Unpack(void* Packet)
{
...
}


1
2
3
4
// OTI.cpp
#include "OptiTrackInterface.h"

Unpack((char*) &indata);


When i try to compile OTI.cpp, i got the error that Unpack is undeclared.
I'm not familiar with C++... this might be a beginners mistake.
1) You do not need extern in your header.
2) Why are you casting to char* when function accepts void*?
3) I hope call to function is in some function and not in global space
4) Did you include OTI.h in your OTI.cpp?
5) Did you compile PackUnpack.cpp alongside OTI.cpp?
1) Probably not
2) indata is a packet divided in Byte sections. Do i have to change declaration?
3) You mean OTI.cpp - then yes
4) yes
5) yes
Topic archived. No new replies allowed.