G
Guest
Is it possible to bring in a static library (developed in C++) into a C#
project/solution?
Thanks in advance for any information.
Andrew S. GIles
project/solution?
Thanks in advance for any information.
Andrew S. GIles
e-lores said:Maybe Marshaling can helps you. Look at this:
using System;
using System.Runtime.InteropServices;
class CSClass
{
[DllImport("mycpp.dll")]
public static extern int myfunction(string c);
public static void Main()
{
...
int n = myfunction("One String");
...
}
}
Ernesto Lores
(Barcelona)
Andrew S. Giles said:Is it possible to bring in a static library (developed in C++) into a C#
project/solution?
Thanks in advance for any information.
Andrew S. GIles
Andrew S. Giles said:Thanks. But it is not a Dynamic Library that I have access to. All I have
is a static
libraby (lib) not a dynamic library (DLL).
Andrew
e-lores said:Maybe Marshaling can helps you. Look at this:
using System;
using System.Runtime.InteropServices;
class CSClass
{
[DllImport("mycpp.dll")]
public static extern int myfunction(string c);
public static void Main()
{
...
int n = myfunction("One String");
...
}
}
Ernesto Lores
(Barcelona)
Andrew S. Giles said:Is it possible to bring in a static library (developed in C++) into a C#
project/solution?
Thanks in advance for any information.
Andrew S. GIles
JoeWood said:No, this is not possible. The best solution would be to compile your LIB
file into a DLL and export out the functions that you want to use.
JoeW
Andrew S. Giles said:Thanks. But it is not a Dynamic Library that I have access to. All I have
is a static
libraby (lib) not a dynamic library (DLL).
Andrew
e-lores said:Maybe Marshaling can helps you. Look at this:
using System;
using System.Runtime.InteropServices;
class CSClass
{
[DllImport("mycpp.dll")]
public static extern int myfunction(string c);
public static void Main()
{
...
int n = myfunction("One String");
...
}
}
Ernesto Lores
(Barcelona)
"Andrew S. Giles" <[email protected]> escribió en el
mensaje Is it possible to bring in a static library (developed in C++) into a C#
project/solution?
Thanks in advance for any information.
Andrew S. GIles
JoeWood said:No, this is not possible. The best solution would be to compile your LIB
file into a DLL and export out the functions that you want to use.
JoeW
Andrew S. Giles said:Thanks. But it is not a Dynamic Library that I have access to. All I have
is a static
libraby (lib) not a dynamic library (DLL).
Andrew
e-lores said:Maybe Marshaling can helps you. Look at this:
using System;
using System.Runtime.InteropServices;
class CSClass
{
[DllImport("mycpp.dll")]
public static extern int myfunction(string c);
public static void Main()
{
...
int n = myfunction("One String");
...
}
}
Ernesto Lores
(Barcelona)
"Andrew S. Giles" <[email protected]> escribió en el
mensaje Is it possible to bring in a static library (developed in C++) into a C#
project/solution?
Thanks in advance for any information.
Andrew S. GIles
how is that not possible?
u build a dll that calls the functions in the static lib and the compiler
will insert the code from the static lib into the dll and then u can use the
dll.
No, this is not possible. The best solution would be to compile your LIB
file into a DLL and export out the functions that you want to use.
JoeW
:
haveThanks. But it is not a Dynamic Library that I have access to. All I
elis a static
libraby (lib) not a dynamic library (DLL).
Andrew
:
Maybe Marshaling can helps you. Look at this:
using System;
using System.Runtime.InteropServices;
class CSClass
{
[DllImport("mycpp.dll")]
public static extern int myfunction(string c);
public static void Main()
{
...
int n = myfunction("One String");
...
}
}
Ernesto Lores
(Barcelona)
"Andrew S. Giles" <[email protected]> escribió en
mensaje
Is it possible to bring in a static library (developed in C++) into
a C#
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.