Sorry if this question will be answered with a trivial solution, but I really can't work it out.
I'm developing this console application with VS2010 on a 32bit Win7.
I don't think the error comes from the include files, since the build is working with them on another simple project (with the same project properties).
#include "stdio.h"
#include "sapclassbasic.h"
// Static Functions
staticvoid XferCallback(SapXferCallbackInfo *pInfo);
// Example program
int main(int argc, char* argv[])
{
BOOL success = TRUE ;
// Allocate acquisition object
SapAcquisition *pAcq = new SapAcquisition(SapLocation("X64-CL_1", 0), "MyCamera.ccf");
// Allocate buffer object, taking settings directly from the acquisition
SapBuffer *pBuffer = new SapBuffer(1, pAcq);
// Allocate view object, images will be displayed directly on the desktop
SapView *pView = new SapView(pBuffer, SapHwndDesktop);
// Allocate transfer object to link acquisition and buffer
SapTransfer *pTransfer = new SapTransfer(XferCallback, pView);
pTransfer->AddPair(SapXferPair(pAcq, pBuffer));
// Create resources for all objects
success = pAcq->Create();
success = pBuffer->Create();
success = pView->Create();
success = pTransfer->Create();
// Start a continuous transfer (live grab)
success = pTransfer->Grab();
printf("Press any key to stop grab\n");
getchar();
// Stop the transfer and wait (timeout = 5 seconds)
success = pTransfer->Freeze();
success = pTransfer->Wait(5000);
printf("Press any key to terminate\n");
getchar();
// Release resources for all objects
success = pTransfer->Destroy();
success = pView->Destroy();
success = pBuffer->Destroy();
success = pAcq->Destroy();
// Free all objects
delete pTransfer;
delete pView;
delete pBuffer;
delete pAcq;
return 0;
}
// Transfer callback function is called each time a complete frame is transferred.
// The function below is a user defined callback function.
void XferCallback(SapXferCallbackInfo *pInfo)
{
// Display the last transferred frame
SapView *pView = (SapView *) pInfo->GetContext();
pView->Show();
}
And here's the error I get:
1 2 3 4 5 6 7 8 9 10 11
1
1>Build started 17/12/2014 12:00:03.
1>InitializeBuildStatus:
1> Creating "Debug Sapera\helloworld3.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> HelloWorld3.cpp
1>c:\users\cocci lab\documents\visual studio 2010\projects\helloworld3\helloworld3\helloworld3.cpp(11): error C2059: syntax error : 'return'
1>c:\users\cocci lab\documents\visual studio 2010\projects\helloworld3\helloworld3\helloworld3.cpp(13): error C2059: syntax error : '}'
1>c:\users\cocci lab\documents\visual studio 2010\projects\helloworld3\helloworld3\helloworld3.cpp(13): error C2143: syntax error : missing ';' before '}'
1>c:\users\cocci lab\documents\visual studio 2010\projects\helloworld3\helloworld3\helloworld3.cpp(13): error C2059: syntax error : '}'
1>
1>Build FAILED.
Mutexe:
I thought it too, but even commenting out that function, and the lines where it's involved, the result does not change. Always giving me the error at the level of main.
Tanezavm:
It's a library to control a Teledyne camera and frame grabber. But it works perfectly on another similar code.