Reputation: 19
I am trying to create a simple .lib file in C++ to try and use the code in my C# using C++/CLI wrapping techniques. The problem is, my C++ code in itself isn't compiling successfully. It keeps pushing the 'not a valid Win32 application' error. I tried looking up the same problem and many answers suggested there were .NET framework issues with Windows XP. But I am running it on 'Visual Studio 2015 (v140)' Platform Toolset. My Desktop is a 64bit OS (x64 processor)running Windows 10 pro.
Here's a snippet of my Project Properties:
#pragma once
namespace AddTwoNumbersLib
{
class AddClass
{
public:
static double Add(double x, double y);
};
}
And this is my .cpp code :
#include "AddClass.h"
namespace AddTwoNumbersLib
{
double AddClass::Add(double x, double y)
{
return x + y;
}
}
I'm struggling with this since I'm an amateur. Your help would be greatly appreciated!
Upvotes: 1
Views: 17471
Reputation: 99
I'm guessing it builds correctly but you're trying to run the .lib like an application. Right click on the project and select 'Build'
Upvotes: 9