PC Review


Reply
Thread Tools Rate Thread

Compiling C++ class project to a dll

 
 
=?Utf-8?B?andr?=
Guest
Posts: n/a
 
      27th Jan 2005
I've been given a C++ class library project which I need to use from my
asp.net vb.net project. I have tried building the C++ class library it but it
only creates a series of .obj files which I can't reference from the asp.net
project. How do I get the C++ class library to compile to a dll (I've played
around with the properties of the project but it still doesn't seem to
produce a dll), is there any other way to include it in my asp.net project??

 
Reply With Quote
 
 
 
 
Lionel LASKE
Guest
Posts: n/a
 
      28th Jan 2005

To learn more about C++ compiler's option, post your question in the C++
newsgroup.
But if you're not familiar with C++ compiler's option, the easy way to solve
your problem is:
- make an .NET C++ assembly,
- link your assembly with your C++ class library,
- map all methods from your C++ class library in a managed C++ class,
- call your new assembly from your VB.NET project.

For more information see:
http://www.15seconds.com/issue/030729.htm

I hope it helps.

Lionel.



"jwk" <(E-Mail Removed)> a écrit dans le message de news:
4548A7E4-F2CA-4A97-8B65-(E-Mail Removed)...
> I've been given a C++ class library project which I need to use from my
> asp.net vb.net project. I have tried building the C++ class library it but
> it
> only creates a series of .obj files which I can't reference from the
> asp.net
> project. How do I get the C++ class library to compile to a dll (I've
> played
> around with the properties of the project but it still doesn't seem to
> produce a dll), is there any other way to include it in my asp.net
> project??
>



 
Reply With Quote
 
Richard Grimes [MVP]
Guest
Posts: n/a
 
      31st Jan 2005

"jwk" <(E-Mail Removed)> wrote in message
news:4548A7E4-F2CA-4A97-8B65-(E-Mail Removed)...
> I've been given a C++ class library project which I need to use from my
> asp.net vb.net project. I have tried building the C++ class library it but
> it
> only creates a series of .obj files which I can't reference from the
> asp.net
> project. How do I get the C++ class library to compile to a dll (I've
> played
> around with the properties of the project but it still doesn't seem to
> produce a dll), is there any other way to include it in my asp.net
> project??


You need to link them together as a library assembly. From the command line
(for one.obj and two.obj):

link /dll one.obj two.obj

With VS2003 this will give you a warning LNK4243, which in most cases is
harmless, but to compile the DLL properly you will need to create some extra
code as explained here:

http://msdn.microsoft.com/library/de...omixedmode.asp

(this has got to be the web page with the longest name!)

Richard
--
My email address (E-Mail Removed) is encrypted with ROT13 (see
www.rot13.com)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling a 32 bit DLL project in x64 Manfred Wilner Microsoft VC .NET 7 26th Jun 2009 07:29 PM
Compiling a Class Library project into multiple assemblies =?Utf-8?B?UGhhaXRvdXI=?= Microsoft Dot NET 3 9th Nov 2006 01:38 AM
Compiling a VC++ project using gcc mail_amity Microsoft VC .NET 1 20th Feb 2006 12:09 PM
Compiling project as dll Brad Allison Microsoft VB .NET 3 6th Feb 2004 04:39 PM
Compiling my project Will Microsoft VB .NET 3 14th Jan 2004 05:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 PM.