By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,305 Members | 1,706 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.

How to link in shared library?

P: n/a
I'm just beginning to learn C++. If the test()
function listed below was in a shared object
library named mylib.so, how would I access then
from another .cpp program? Can someone please
show me a .cpp example, and then how to link it
with GNU g++? I tried to find the answer on google,
but could not.

-Thanks
#include <iostream>

using namespace std;

void test()
{
cout << "In test() function" << endl;
}
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
James Egan wrote:
I'm just beginning to learn C++. If the test()
function listed below was in a shared object
library named mylib.so, how would I access then
from another .cpp program? Can someone please
show me a .cpp example, and then how to link it
with GNU g++? I tried to find the answer on google,
but could not.


Please post to gnu.g++.help. Shared objects are not defined by
the C++ language, they are platform-specific and as such are
off-topic here.

V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.