On Thu, 2009-12-24 at 09:07 +1000, Chasc wrote: > On Wed, 2009-12-23 at 12:44 +0100, Christian Kandeler wrote: > > On Wednesday 23 December 2009 12:04:32 ext Chasc wrote: > > > On Wed, 2009-12-23 at 10:18 +0100, Christian Kandeler wrote: > > > > On Wednesday 23 December 2009 00:11:18 ext Chasc wrote: > > > > > I have generated a shared library (.so file) and am trying to run an > > > > > app I have developed in Qt-creator using the library but so far > > > > > without > > > > > success. Can anybody help me with this or perhaps direct me to the > > > > > relevant documentation? My platform is linux. > > > > > > > > If I understand you correctly, you want to make your library be linked > > > > to > > > > your application? In that case, add the following to your project (.pro) > > > > file: LIBS += -L<path-to-lib> -l<lib-name> > > > > (This is what it looks like for UNIX-like systems; other platforms have > > > > different syntax, but also use the LIBS variable.) > > > > > > > > Christian > > > > _______________________________________________ > > > > > > Done that. The app now compiles but when I run it I get: > > > symbol lookup error: undefined symbol: _Z6centerP11QMainWindow > > > exited with code 127. I was able to compile and run when I had included > > > the source code. All I have done is replaced the source code with the > > > shared library plus added the LIBS line in the project file. I am still > > > using the headers for the library. > > > > Apparently, the dynamic linker cannot find the library. Either copy it to a > > standard system directory, or add its directory to the LD_LIBRARY_PATH > > variable. If you intend to exclusively run the application directly from Qt > > Creator while you're developing it, you can also edit the same variable in > > the project's runs settings (in the "Run Environment" part). > > > > Christian > > I have added it to the LD_LIBRARY_PATH in Qt-Creator's Run Environment > but to no avail so I must be doing something stupid. Thanks for the help > though.
[A few hours later] Actually, I succeeded in running the app with the shared library only after I added the library's path to LD_LIBRARY_PATH in bash and running it on the command line. It appears that Qt-Creator's Project Settings don't work. pcor > > _______________________________________________ > Qt-creator mailing list > Qt-creator@trolltech.com > http://lists.trolltech.com/mailman/listinfo/qt-creator > > _______________________________________________ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator