EldoS | Feel safer!

Software components for data protection, secure storage and transfer

symbol lookup error on linux

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 07/31/2012 23:28:18
by Rafal Grasman (Basic support level)
Joined: 07/31/2012
Posts: 6

Well, after getting the application to perfectly work on windows, I decided to finally move on and compile it for linux.
After some struggle hassle and trying / editing I finally managed to compile it on linux without warnings and errors.

Then I tried to run it on linux and suprisingly this showed up:

SS © 2012 by Gamer_Z | Loading SolFS...
./samp03svr: symbol lookup error: plugins/VirtualDiskStorage.so: undefined symbol: StorageSetRegistrationKey

This seems that something did not compile, but how can I include the solFS library in my compilation so it will be standalone?

This is my makefile:
# This file demonstrates how to compile the VirtualDiskStorage project on Linux.
# To compile VirtualDiskStorage do:
# make VirtualDiskStorage

GPP = g++
GCC = gcc
VirtualDiskStorage_OUTFILE = "VirtualDiskStorage.so"

COMPILE_FLAGS = -m32 -fPIC -c -O3 -w -D LINUX -D PROJECT_NAME=\"VirtualDiskStorage\" -I ./SDK/amx/ -I ./../solfs/Include/

VirtualDiskStorage = -D VirtualDiskStorage $(COMPILE_FLAGS)

all: VirtualDiskStorage

   -rm -f *~ *.o *.so

VirtualDiskStorage: clean
   $(GPP) $(VirtualDiskStorage) ./SDK/amx/*.c
   $(GPP) $(VirtualDiskStorage) ./SDK/*.cpp
   $(GPP) $(VirtualDiskStorage) *.cpp
   $(GPP) ./../solfs/Lib/libsolfs.a -m32 -O2 -fshort-wchar -shared -o $(VirtualDiskStorage_OUTFILE) *.o

and when I change the last line of the makefile, from libsolfs.a to libsolfs.so then when loading the plugin into samp server I get this:
[06:38:33]  Loading plugin: VirtualDiskStorage.so
[06:38:33]   Failed (libsolfs.so.0: cannot open shared object file: No such file or directory)
[06:38:33]  Loaded 0 plugins.

I placed the libsolfs.so in the applications root directory (not installed into the system library)
As for portability (meaning copy pasting from one server to another) is is really required so users don't need root rights to use the VFS.
Posted: 08/01/2012 08:45:43
by Alexander Plas (EldoS Corp.)


There is really a problem in shared library naming, it will be fixed soon.

But under Linux placing shared library in the same directory as main executable file of application has no sense. The system lookups for shared libraries only in the directories specified in the LD_LIBRARY_PATH environment variable. So, if you like to make portable application it is better to link it with SolFS statically.



Topic viewed 2341 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!