I'm new to CSharp and CppSharp. I work under VisualStudio 2019 (version 16.8.3). I'm trying to evaluatuate the capability of the librarie to generate C# binding to our C++ libraries.
I download a copy of the master branch of cppSharp. I was able to build the librarie and run the UTests. No errors appeared.
I then try to make a bare minimum example:
class Foo{
public:
int a;
float b;
};
int FooAdd(Foo* foo);
And try to generate the C# bindings...
I follow the generateBindings.md tutorial but when I try to run the binary I got:
Exception thrown: 'System.BadImageFormatException' in CppSharp.Generator.dll
An unhandled exception of type 'System.BadImageFormatException' occurred in CppSharp.Generator.dll
Could not load file or assembly 'CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. An attempt was ma
de to load a program with an incorrect format..
after some search I figure out that this issue is due to x64 vs. x86 format, but according to configurations files, everthingting should be x64... and if I change my project target to x86, I got the same error but for another lib? If I set to 'AnyCPU' the first error is still present (even with the 'prefer 32bit' option checked.
Is there any tutorial on howto setup projects for the use of CppSharp?
What is missing in my configuration?
Brief Description
I'm new to CSharp and CppSharp. I work under VisualStudio 2019 (version 16.8.3). I'm trying to evaluatuate the capability of the librarie to generate C# binding to our C++ libraries. I download a copy of the master branch of cppSharp. I was able to build the librarie and run the UTests. No errors appeared.
I then try to make a bare minimum example:
And try to generate the C# bindings... I follow the
generateBindings.md
tutorial but when I try to run the binary I got:after some search I figure out that this issue is due to x64 vs. x86 format, but according to configurations files, everthingting should be x64... and if I change my project target to x86, I got the same error but for another lib? If I set to 'AnyCPU' the first error is still present (even with the 'prefer 32bit' option checked.
Is there any tutorial on howto setup projects for the use of CppSharp? What is missing in my configuration?
here is the configuration I use: