You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, November 22nd 2006, 11:33am

Shared library problem

I put my shared library,libbktrans.so.0.0, in /usr/local/lib. Here, I make two links:
ln -sf libbktrans.so.0.0 libbktrans.so.0
ln -sf libbktrans.so.0 libbktrans.so
Then declare preloading this library:
export LD_PRELOAD=/usr/local/lib/libbktrans.so.0

i have demo.c to test. So it contains functions declared in shared lib.
//demo.c
#include BkTransLib.h//interfaces of functions in shared lib.
.......

I compile demo.c:
gcc -Wall -g -c demo.c -o demo.o
Create program demo:
gcc -g -o demo demo.o -L. -lbktrans
Execute the program
LD_LIBRARY_PATH="." ./demo

result---> perfect.

Now i create a C project by KDevelop with Automake.
I add demo.c and BkTransLib.h into my project.
But I can not build this project. because of errors. those errors are "undefined reference" to the functions in shared lib.

I know i missed something in telling project to link my shared library. But i don't know how.
Please tell me how.
Thank you so much.

2

Thursday, January 18th 2007, 12:09am

RE: Shared library problem

You need to add the lib to KDevelop's automake manager. See the attached screen shot for a clue.
bryanw412 has attached the following image:
  • addlibstoautomake.jpg