0

Every time i try to compile i'm getting this error:

System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)'

when i try to run session = PXCMSession.CreateInstance();

I'm running Windows 10 pro, 32 bit operating system.

Added reference to file:

c:\Program Files\Intel\RSSDK\bin\win32\libpxcclr.cs.dll

added to post build evenent:

if "$(Platform)" == "x86" ( copy /y "$(RSSDK_DIR)\bin\win32\libpxccpp2c.dll" "$(TargetDir)" ) else ( copy /y "$(RSSDK_DIR)\bin\x64\libpxccpp2c.dll" "$(TargetDir)" )

And in build tab changed platform target from Any CPU to X86

  • I think this thread may help you: https://communities.intel.com/thread/110198 If that doesn't help you can also ask your question there. –  Jun 12 '17 at 09:10
  • Already saw it, didn't really help – mowinka Jun 12 '17 at 09:19

2 Answers2

0

That exception is usually, in my experience, due to a x64/x86 conflict. Are you definitely referencing the x86 version of libpxcclr.cs.dll?

jb455
  • 100
  • 1
  • 7
0

The fix is to go back to cmake and build with the x64 compilers on your system. If you don't see the prompt for the compiler version, delete the "build" directory and try cmake-gui again. All the C# examples work in x64 but don't in 32-bit.

Bob Davies
  • 51
  • 1
  • 3
  • The OP has the misfortune of using a 32-bit OS, so they wouldn't be able to use 64-bit executables after building them. – Peter Cordes Sep 25 '18 at 03:42