Access libraries in C++


 
Thread Tools Search this Thread
Top Forums Programming Access libraries in C++
# 1  
Old 11-02-2008
Access libraries in C++

Hi,

I've a C++ project that uses cairo graphics libraries (see cairographics.org).

In my class I do
#include <cairo.h>

If I must install the cairo graphics program, I must be root. What I want is that this library only be acessed by this project. Talking in Java language, I would love that cairo library would be a jar, that will be acessed in my project. How can this be possible in C++ world?

Thanks,
Pedro
# 2  
Old 11-03-2008
I don't know if I was explicit. What I want is to access cairo library without have to install it. In the java world, jars are used. In C++, how is it?
# 3  
Old 11-03-2008
Quote:
Originally Posted by pedrosacosta
Hi,

I've a C++ project that uses cairo graphics libraries (see cairographics.org).

In my class I do
#include <cairo.h>

If I must install the cairo graphics program, I must be root. What I want is that this library only be acessed by this project. Talking in Java language, I would love that cairo library would be a jar, that will be acessed in my project. How can this be possible in C++ world?

Thanks,
Pedro
After you install the Cairo package, the header files and the libraries files i.e. *.so (unix equivalent of dll) will be available. You would use the API's mentioned in the header files and you would need these library files to compile.

Another way would be to load the .so dynamically using dlopen, dlsym and dlclose calls. But this would be so much of an overhead.
# 4  
Old 11-03-2008
To use the library it must be installed. However, you can install it in your home directory rather than under /usr and build your code with appropriate flags to tell the compiler where your headers are (e.g -I/path/to/your/headers) and the linker where the libraries are (e.g. -L/path/to/your/libs).
The details of how to install to a non-default location will depend on how the library is packaged (e.g. source tarball, RPM package, etc) and which one you want to use.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Proxy Server

How to use Squid on Linux to control certain IP to access Web Server and certain IP cannot access?

Dear all experts here, :) I would like to install a proxy server on Linux server to perform solely to control the access of Web server. In this case, some of my vendor asked me to try Squid and I have installed it onto my Linux server. I would like know how can I set the configuration to... (1 Reply)
Discussion started by: kwliew999
1 Replies

2. Solaris

samba read write access to owner and no access to other users

Hi All, I want to configure samba share permission so that only directory creator/owner has a read and write permission and other users should not have any read/write access to that folder.Will that be possible and how can this be achieved within samba configuration. Regards, Sahil (1 Reply)
Discussion started by: sahil_shine
1 Replies

3. IP Networking

Does my provider limit my internet access or somesites access?

Hi Good Day, i would like to ask for further info about my problems experiencing this evening. Im a PPP0 connection in the internet using 3G located in asia pacific region.i had this problem this evening in my INTERNET connections that there are some sites i can't open example ( Gizmodo.com,... (2 Replies)
Discussion started by: jao_madn
2 Replies

4. UNIX for Dummies Questions & Answers

kernel giving access for multiple users to access files

hi all, i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies

5. Programming

I want to know some c libraries

I'm a rookie to C and i'm looking for some libraries to learn,something likes the C++ STL or Boost ,does any1 can tell me some of them?Thanks a lot:) Eric (3 Replies)
Discussion started by: homeboy
3 Replies

6. Shell Programming and Scripting

How to use two different libraries?

Hello, I need to use two different libraries like /usr/local/bin/expect and /usr/bin/ksh at the same script. Is it possible? (4 Replies)
Discussion started by: fozay
4 Replies

7. UNIX for Dummies Questions & Answers

libraries

I am slowly ploughing my way through the list of links to on-line tutorials you provided to newbies. I for one am grateful for such a comprehensive list, so first of all thank you for that. What i cannot seem to find, is information on C++ libraries: The two links on libraries in your list... (0 Replies)
Discussion started by: pil888
0 Replies

8. IP Networking

Libraries

How is Libnet and libpcap are useful in sending a packet through DLL layer and sniff network layer? and how sinffers are used to track ip adresses provided Mac adresses? (1 Reply)
Discussion started by: netsavy
1 Replies

9. Programming

C Libraries??

I can not locate package sys/mkdev.h on HP-UX or Linux. Is it a special package or something? (9 Replies)
Discussion started by: laila63
9 Replies

10. UNIX for Dummies Questions & Answers

Need help to access/mount so to access folder/files on a Remote System using Linux OS

Hi I need to access files from a specific folder of a Linux system from an another Linux System Remotely. I know how to, Export a folder on One SCO System & can access the same by using Import via., NFS in the Sco Unix SVR4 System using the scoadmin utility. Also, I know to use mount -t ... (2 Replies)
Discussion started by: S.Vishwanath
2 Replies
Login or Register to Ask a Question