0

I have the headers SC2_CamExport.h, SC2_SDKStructures.h and the librariese SC2_Cam.lib, SC2_Cam.dll I want to include in a C++ project. I added the folder with the containing libraries and headers, but when I include the header SC2_CamExport.h, I have errors.

#ifdef dfsdfdsf
#if defined _WIN64
   #define SC2_SDK_FUNC
#else
   #define SC2_SDK_FUNC __declspec(dllexport)
#endif
#else
   #define SC2_SDK_FUNC __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {            //  Assume C declarations for C++
#endif  //C++

SC2_SDK_FUNC int WINAPI PCO_GetGeneral(HANDLE ph, PCO_General *strGeneral);

SC2_SDK_FUNC int WINAPI PCO_GetCameraType(HANDLE ph, PCO_CameraType *strCamType);

#ifdef __cplusplus
}       //  Assume C declarations for C++
#endif  //C++

So in the line of "SC2_SDK_FUNC int WINAPI PCO_GetGeneral(HANDLE ph, PCO_General *strGeneral);" I get an error "error C2146: syntax error : missing ';' before identifier 'PCO_GetGeneral'". I guess the main problem is that I am not able to import a DLL in C++ as mentioned in Using .dll in Visual Studio 2010 C++. So anyway, I'm not sure what I have to do and how I can import this library. Do I just need to import the .lib file anyhow, or what is exactly the problem?

4

1 回答 1

0

对我来说,它可以包含 windows.h 以便所有 windows 命令都可用。所以只需插入

#include <windows.h>

在文件的开头

KR伯恩哈德

于 2013-04-10T10:45:21.110 回答