newbie critical question

W

wlmparker

hi
i have tried to post here before but i think my post was not
successful for some reason, or you might be reading this post again,
oh well.
i got a couple a noob questions about c++, i would like to have'em
answered.
i have been workin with c++ for a while just for studying purposes ,
but i was always
using the standard provided api until i decided to go further and use
extrenal libraries.
what are external libraries? are they .dll files or .a files ?
how do i refer to them in my programs? where and when are they used in
the build process and how are they found by the compiler or linker?

i still got a couple a noob questions, but i'll leave them until next
time hoping that a reply to this post
might answer some of them in advance.
thanks
 
J

John Harrison

hi
i have tried to post here before but i think my post was not
successful for some reason, or you might be reading this post again,
oh well.
i got a couple a noob questions about c++, i would like to have'em
answered.
i have been workin with c++ for a while just for studying purposes ,
but i was always
using the standard provided api until i decided to go further and use
extrenal libraries.
what are external libraries? are they .dll files or .a files ?
how do i refer to them in my programs? where and when are they used in
the build process and how are they found by the compiler or linker?

The answer to all of these question is, it depends.

It depends on what compiler you are using and it depends on what
operating system you are programming for. The one thing it doesn't
depend on is C++ which says nothing at all about libraries.

So to answer you question you need to say what compiler and what O/S you
are using. And then you need to ask on an appropriate newsgroup, not
here since these are not C++ questions.

john
 
W

wlmparker

The answer to all of these question is, it depends.

It depends on what compiler you are using and it depends on what
operating system you are programming for. The one thing it doesn't
depend on is C++ which says nothing at all about libraries.

So to answer you question you need to say what compiler and what O/S you
are using. And then you need to ask on an appropriate newsgroup, not
here since these are not C++ questions.

john

ok man take it easy i told you i was a newbie, sorry anyway !
im using gcc compiler suite on win32 , i suppose there is no newsgroup
for gcc is there ?
i have ran some small examples but i'm always getting undefined
reference to .. errors in the link stage,
 
R

red floyd

[redacted]

ok man take it easy i told you i was a newbie, sorry anyway !
im using gcc compiler suite on win32 , i suppose there is no newsgroup
for gcc is there ?
i have ran some small examples but i'm always getting undefined
reference to .. errors in the link stage,

gnu.g++.help

Since you're a newbie, may I recommend that you read the comp.lang.c++
FAQ at http://www.parashift.com/c++-faq-lite ; in particular the posting
guidelines http://www.parashift.com/c++-faq-lite/how-to-post.html ?

This will help you understand what is and isn't topical here, where you
might look for help for off-topic stuff, and keep you from getting
flamed, which by the way, John did not do, he simply told you it was OT
here.
 
J

j0rd4n

hi
i have tried to post here before but i think my post was not
successful for some reason, or you might be reading this post again,
oh well.
i got a couple a noob questions about c++, i would like to have'em
answered.
i have been workin with c++ for a while just for studying purposes ,
but i was always
using the standard provided api until i decided to go further and use
extrenal libraries.
what are external libraries? are they .dll files or .a files ?
how do i refer to them in my programs? where and when are they used in
the build process and how are they found by the compiler or linker?

i still got a couple a noob questions, but i'll leave them until next
time hoping that a reply to this post
might answer some of them in advance.
thanks

Will,

The libraries used by C++ depend on the OS you are working on.
Libraries are pre-compiled functions that you can connect to at
runtime to perform some task. For instance, let's say you write some
generic code that can be used in multiple contexts and applications.
You could compile that code into a library and link to that library in
other applications.

There are two primary components to libraries (a library file and a
binary file). If you are in Windows the library file is a .lib and
the binary file is a .dll. If you are in Unix/Linux the library file
is a .a file and the binary file is a .so file.

This is how it works. The .lib/.a file is needed at link time so that
your linker can find the needed references/symbols to link the object
files. Let's say you want to use a library in your code that exposes
the method "calculateDistance". You need to include the path to the
library when linking so that it can find a reference to the
"calculateDistance" method (because how else would it know?). At
runtime your application will then try to find the binary for the
library .dll/.so so that it can actually run the code you reference in
the program.

This just scratches the surface on libraries. I recommend searching
MSDN or google for more references. Let me know if you have anymore
questions.

j0rd4n
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top