inline expansion

G

Guest

I am currently trying to wrap an old library (ImageMagick) in .NET, and am
having problems with inline expansions. I have recompiled the library in vc++
2005 OK. However, when I try to access any inline methods of the library
classes from my managed classes, the inlining does not seem to occur, and I
end up with a linker error 2001 - unresolved external. Is there a trick for
getting this to work. I have tried using Default inline (/Ob0) in the
library, and maximum expansion in my assembly (Ob2) - even tried turning
auto_inline off when compiling the library - still getting the linker message.

Ta

Mick
 
B

Ben Voigt

Mick O'Neill said:
I am currently trying to wrap an old library (ImageMagick) in .NET, and am
having problems with inline expansions. I have recompiled the library in
vc++
2005 OK. However, when I try to access any inline methods of the library
classes from my managed classes, the inlining does not seem to occur, and
I
end up with a linker error 2001 - unresolved external. Is there a trick
for
getting this to work. I have tried using Default inline (/Ob0) in the
library, and maximum expansion in my assembly (Ob2) - even tried turning
auto_inline off when compiling the library - still getting the linker
message.

Usually in this scenario you have the native classes defined by the library,
with managed wrapper ref classes, compiled into a single assembly with
C++/CLI, and then a client in any .NET language. Which caller is giving the
error message, the ref class inside the same assembly, or the assembly
consumer (which could be C# or VB.NET as easily as C++/CLI)?
 
G

Guest

It is when I am compiling the wrapper assembly itself. The code is something
like this:

#include "Wrapped.h"

// Wrapped(param) constructor is inline in Wrapped.h


public ref class MyWrapper {
private:
Wrapped *pWrapped;
public:
MyWrapper(param p1) {
pWrapped = new Wrapped(p1);
}
};

Wrapped.lib is included in the project properties.
 

Ask a Question

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.

Ask a Question

Similar Threads


Top