By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,305 Members | 1,834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,305 IT Pros & Developers. It's quick & easy.

writing a library

P: n/a


Hi all,

I'm going to write a library for the first time. Can you please drop me
some links or any advice you may have?

Thanks
Amit

Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

amit wrote:
Hi all,

I'm going to write a library for the first time. Can you please drop me some links or any advice you may have?


In it's simplest form, a library is simply a *.cpp and a *.h file that
you include with your other files. The *.h file gets included along
with all the other headers and the *.cpp file gets linked to your code.

-Jason

Jul 23 '05 #2

P: n/a

Jason wrote:
The *.h file gets included along
with all the other headers and the *.cpp file gets linked to your

code.

Er, the *.cpp file gets _compiled_ into your executable. I was a bit
lazy in my choice of words.

Jul 23 '05 #3

P: n/a


I mean, the library I'm going to write would be big since I need to add
hundered of line (func and class).
Should I put them in one CPP file or can have multiple .cpp and .h
files?

Jul 23 '05 #4

P: n/a

"amit" <am********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...


I mean, the library I'm going to write would be big since I need to add
hundered of line (func and class).
Should I put them in one CPP file or can have multiple .cpp and .h
files?

You should definately group you classes and or functions in different
files!! (.cpp & .h)
Jul 23 '05 #5

P: n/a
amit a écrit :

Hi all,

I'm going to write a library for the first time. Can you please drop me
some links or any advice you may have?

Thanks
Amit

http://www.faqs.org/docs/Linux-HOWTO...ary-HOWTO.html

--
Salutations,

Joachim Naulet

06 14 90 06 21
http://jnaulet.no-ip.com
Jul 23 '05 #6

P: n/a
amit wrote:

I mean, the library I'm going to write would be big since I need to add
hundered of line (func and class).
Should I put them in one CPP file or can have multiple .cpp and .h
files?


You could do the further or the later or you could search your toolkit
if it contains a 'librarian'. Most systems come with one (I don't know
any that doesn't). The librarian organizes multiple compiled files in
a library. You then just link the executable with that library.

The above sounds more complicated then it really is.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.