You are not logged in.

#1 2011-08-03 02:23:56

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Using .so files

If I have a file libx.so, and want to use it's method xyz(void).
Have to a in C with GCC use that method, assuming that I know all this at compilation (not runtime linking)?

Offline

#2 2011-08-03 03:04:02

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,488
Website

Re: Using .so files

Have you tried google...

Offline

#3 2011-08-03 13:42:11

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: Using .so files

Yes, but I can only find how to create .so files.

Offline

#4 2011-08-03 15:52:49

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: Using .so files

I am not entirely sure that I understand what you need but you can either install it in /usr/lib or if you just want to use it locally adjust the LD_LIBRARY_PATH so that it includes the directory at which your library is located. Also when compiling don't forget to add the -L flag to gcc followed by the directory where the shared library is located. Also you might need to add the -I flag (that's a capital i) as well followed by the path where the header(s) of your library is(are) located. Some more information plus some examples here and here.

Last edited by Foucault (2011-08-03 16:10:25)

Offline

#5 2011-08-03 18:47:27

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: Using .so files

Seems about right, but I do not need to do it anymore.

Thanks anyway!

Offline

#6 2011-08-03 19:03:46

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Using .so files

Somebody got a homework pass. tongue

Offline

#7 2011-08-03 19:19:50

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Using .so files

Hibernate wrote:

Have to a in C with GCC use that method

Add some slang words and you got some fine rap, bro.

:-D

Offline

#8 2011-08-03 20:04:35

Hibernate
Member
From: Stockholm, Sweden
Registered: 2011-07-12
Posts: 100

Re: Using .so files

One both of your replays:

??


And on 'tomk':
I assume you mean, that you think I passed a homework.
No, this has nothing to the with homework, than I would just ask my teacher(s) [look at the time 04:23:56 UTC+2, they are clearly working and can answer me right away].
No, this was a part of hacking Java with modifying it's files, but there was an easier way to do what I wanted to do (without hacking Java).

Last edited by Hibernate (2011-08-03 20:05:12)

Offline

Board footer

Powered by FluxBB