Managed C++ Dll - Where's my output?

Q

quortex

Hi,

I have created a very small test wrapper class in Managed C++ which
wraps up some very simple native code. I am using C# 2 + Visual Studio
2005 Beta 2.

I have the back end C++ library without CLR which is to be wrapped that
outputs fine to a static .lib as expected.

Then I import the .lib into a Managed C++ DLL (/CLR) and wrap it up in
a class. Everything compiles fine with no errors or warnings however my
DLL is not outputted into the debug folder.

It creates the .obj file and a manaifest file -
(myprogram.dll.intermediate.manifest) but there's no library (dll)
outputted.

I have checked all the settings and I am completely out of ideas. Why
isn't the DLL being outputted? Do I need to somehow declare what is
outputted and what isn't? I do recall dllimport and dllexport from back
in the day although it's a vague memory :)

I take it this obviously doesn't work like a normal .net assembly?
Please point me in the right direction. Thanks in advance.

Kind Regards,
Mark
 
J

Jochen Kalmbach [MVP]

Hi quortex!
I have created a very small test wrapper class in Managed C++ which
wraps up some very simple native code. I am using C# 2 + Visual Studio
2005 Beta 2.

What project-type have you created?

For a C++/CLI assembly project you should take a "C++|CLR|Class Library"
project (File|New|Project...)

In the project properties under the "general" entry the should be the
following:
- Configuration Typ: Dynamic Library (DLL)
- Common language runtime support: Common Language Runtime Support (/clr)

And in the "Linker|General" there should be the pathe/filename of the
generated DLL.

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Q

quortex

Hi,

Thanks for the reply. I just checked my project just incase but as I
thought yes I have a managed c++ project. It has /clr switch and is set
to be a DLL with linker output of $(OutDir)\$(ProjectName).dll.

It is outputting the .manifest file so I guess that's another sign it's
setup correctly. Perhaps I have missed something with the internal
structure of my library it just contains two classes and their
corresponding header files. Everything is very simple very clean with
no warnings or errors.

This is really holding me up and driving me mad to be honest. Any
ideas?

Kind Regards,
Mark
 
J

Jochen Kalmbach [MVP]

Hi quortex!
it just contains two classes and their
corresponding header files. Everything is very simple very clean with
no warnings or errors.

What classes? Managed or Unmanaged?
You need to have at least a managed class!
Can you post a small code-snipped?


--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Q

quortex

Jochen,

DOH!

My apologies I can't believe it the dll was being outputted but it was
being outputted to a debug folder of the solution root rather than the
project root.

I did a search for the dll and found it :( Tragic tragic it was working
all along.

Thanks for your help.

Mark
 

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

Top