Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ Libraries

Reply
Thread Tools

C++ Libraries

 
 
Kieran Simpson
Guest
Posts: n/a
 
      07-03-2003
I have written a set of C++ classes that I would like to compile into a
library file, that then can be linked into other projects so I can use those
classes. The only thing is that I am not to sure how make the classes into
a library, and then how to consequently link them into my other projects.
Can anybody point me in the right direction please. I want to statically
link them so that the code is compiled into the app, because I don't want to
mess with DLL's

Thanks


 
Reply With Quote
 
 
 
 
Josephine Schafer
Guest
Posts: n/a
 
      07-03-2003

"Kieran Simpson" <(E-Mail Removed)> wrote in message
news:_2QMa.80$a%(E-Mail Removed)...
> I have written a set of C++ classes that I would like to compile into a
> library file, that then can be linked into other projects so I can use

those
> classes. The only thing is that I am not to sure how make the classes

into
> a library, and then how to consequently link them into my other projects.
> Can anybody point me in the right direction please. I want to statically
> link them so that the code is compiled into the app, because I don't want

to
> mess with DLL's
>


Actually this is platform specific.

I can talk about Windows platform though -
Write your functions, compile the source files to object files. Then
instead of linking, use lib.exe to create a library file.

--
With best wishes,
J. Schafer


 
Reply With Quote
 
 
 
 
Dhruv
Guest
Posts: n/a
 
      07-03-2003
On Thu, 03 Jul 2003 16:29:08 +1000, Kieran Simpson wrote:

> I have written a set of C++ classes that I would like to compile into a
> library file, that then can be linked into other projects so I can use those
> classes. The only thing is that I am not to sure how make the classes into
> a library, and then how to consequently link them into my other projects.
> Can anybody point me in the right direction please. I want to statically
> link them so that the code is compiled into the app, because I don't want to
> mess with DLL's
>
> Thanks


Only compile the file, do not link it. Then, link the object files (.obj
on windows, or .o on UNIX), and you have the binary ready. You will have
to put the declarations in the headers (.h files), while definitions in
the .cpp files and compile those .cpp files.

-Dhruv.





 
Reply With Quote
 
 
 
Reply

Thread Tools

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
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM
Protect my class Libraries, can I? Cablito ASP .Net 4 09-27-2004 06:14 PM
No sourcecode documentation visible in Intellisense from my own class libraries Roberto Rocco ASP .Net 0 08-22-2004 11:41 AM
Re: ModelSim 5.7 and xilinx libraries David Bishop VHDL 1 06-28-2003 04:53 PM



Advertisments