M
Martijn Mulder
I try to merge a C# program with a C++ module. Compiling and linking goes
well, but when I run the program, I get a disappointing message:
Unhandled Exception: System.IO.FileNotFoundException: Kan opgegeven module
niet vinden. (Exception from HRESULT: 0x8007007E) at Program.Main()
Here are the 2 files, PlanetGreeter.cpp and Program.cs. The command lines to
compile are given below. All the way below are listed the compiler versions
I use.
Can anybody help me out?
/*
PlanetGreeter.cpp
*/
//class PlanetGreeter
public ref struct PlanetGreeter
{
//enum Planet
public:enum struct Planet
{
Mars,
Venus,
Uranus,
World
};
//method Greet
public:static void Greet(Planet a)
{
System::Console::WriteLine("Hello, {0}",a);
}
};
/*
Program.cs
*/
//class Program
class Program
{
//method Main
static public void Main()
{
PlanetGreeter.Greet(PlanetGreeter.Planet.World);
}
}
_________________________________________________
C:\cl.exe /LD /clr PlanetGreeter.cpp
C:\csc.exe Program.cs /r
lanetGreeter.dll
C:\Program.exe
_________________________________________________
The compiler versions:
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.
well, but when I run the program, I get a disappointing message:
Unhandled Exception: System.IO.FileNotFoundException: Kan opgegeven module
niet vinden. (Exception from HRESULT: 0x8007007E) at Program.Main()
Here are the 2 files, PlanetGreeter.cpp and Program.cs. The command lines to
compile are given below. All the way below are listed the compiler versions
I use.
Can anybody help me out?
/*
PlanetGreeter.cpp
*/
//class PlanetGreeter
public ref struct PlanetGreeter
{
//enum Planet
public:enum struct Planet
{
Mars,
Venus,
Uranus,
World
};
//method Greet
public:static void Greet(Planet a)
{
System::Console::WriteLine("Hello, {0}",a);
}
};
/*
Program.cs
*/
//class Program
class Program
{
//method Main
static public void Main()
{
PlanetGreeter.Greet(PlanetGreeter.Planet.World);
}
}
_________________________________________________
C:\cl.exe /LD /clr PlanetGreeter.cpp
C:\csc.exe Program.cs /r
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
C:\Program.exe
_________________________________________________
The compiler versions:
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.