I read up on a lot on this issue from other posts but I cant find anything specific to my situation.
I have a large project in C++ that complies successfully in VS 2017 community. I am wrapping the same project in Go using SWIG through the program VS code.
Now i get the error over line 1 in Go, "package main"
# _/C_/Users/daramsey/Desktop/GoWrapC/CameraFinal/CameraFinal
In file included from ConnectionRecovery.h:2:0,
from ConnectionRecovery.cpp:1:
stdafx.h:38:64: fatal error: afxwin.h: No such file or directory
compilation terminated.(undefined)
ConnectionRecovery.h looks like this:
#pragma once
#include "stdafx.h"
#include "PvBaseLib.h"
#include "PvBuffer.h"
#include "PvBufferLib.h"
#include "PvSystem.h"
#include "PvTypes.h"
class ConnectionRecoveryApp
{
public:
ConnectionRecoveryApp();
~ConnectionRecoveryApp();
void startCamera(PvString mConnectionID);
uint16_t * retrieveDataPointerPerBuffer(PvPipeline* mPipeline);
void stopCamera();
vector<PvString> vectorOfCameras();
private:
PvString mConnectionID;
PvDevice* mDevice;
PvStream* mStream;
PvPipeline* mPipeline;
int mHeight = 512;
int mWidth = 640;
bool mbSaveAsCSV;
};
Inside my stdafx.h file (which is included header file in project), I find
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdhtml.h>
#include <afxmt.h>
When i hit F12 key with my mouse hovering over afxwin.h, I am able to open the contents of the file. Therefore I am assuming that the code should not having an issue with opening the file.
This is the json file for VS Code
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
What is the issue? Let me know if you need elaboration.