Thanks for the quick answers
![Smile :)](./images/smilies/icon_smile.gif)
.
I've already tried that and several variations.
polylux wrote:If your dependencies are not too complex you could instruct your friend to just install the needed libraries via his package manager, like
Code: Select all
sudo apt-get install irrlicht <additional deps here>
Actually I want to avoid that.
polylux wrote:Other than that, try to link everything as statically as possible (-> use the .a instead of the .so), copy any left runtime deps into the folder with the binary and include that folder in the lib path.
I'm trying hard but can't get it to work
![Sad :(](./images/smilies/icon_sad.gif)
. Here's my makefile (don't mind the windows parts) :
Code: Select all
# Irrlicht Engine Demo Makefile
Target = Demo
Sources = Foe.cpp Interaction.cpp LightNode.cpp MyEventReceiver.cpp Node.cpp ObjectNode.cpp ParticleNode.cpp PathFinding.cpp TerrainNode.cpp Timer.cpp WaterNode.cpp main.cpp
CPPFLAGS = -I./include/Irrlicht -I./include/pthread -I/usr/X11R6/include
CXXFLAGS = -Wall -O3 -ffast-math -std=c++0x -g
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
all: all_linux
# target specific settings
all_linux: SYSTEM=Linux
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L./linux -lIrrlicht -L./linux -lpthread -lGL -lGLU -lXext -lX11 -DLINUX
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SUF=.exe
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = ./$(Target)$(SUF)
OBJ = $(Sources:.cpp=.o)
all_linux all_win32: $(OBJ)
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
@$(RM) $(OBJ)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 clean clean_linux clean_win32
I don't know if all the libs dependancies are necessary but even when I remove them I've got the same errors. I have the libIrrlicht.a and pthread.a in ./Linux and the headers in ./include/Irrlicht and ./include/pthread. What do you mean by runtime deps ?
After compiling my program it works on the computer where I developped it but when I try to launch it from Virtualbox on another computer (yeah I know it's maybe not the best way to test it but I don't want to install another linux just to be sure that the program doesn't get the lib from usr/lib) I get this :
Code: Select all
$./Demo
./Demo: error while loading shared library: libIrrlicht.so.1.7a: cannot open shared object file: No such file or directory
When I type ldd Demo :
Code: Select all
linux-gate.so.1 => (0xb77b7000)
libIrrlicht.so.1.7a => not found
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7788000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb769e000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb765b000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb763e000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb748b000)
/lib/ld-linux.so.2 (0xb77b8000)
It doesn't find libIrrlicht.so.1.7a and the pthread lib is linked from lib/i386-linux-gnu/. I think there's something I don't understand about compiling (and I promise I searched, a lot
![Laughing :lol:](./images/smilies/icon_lol.gif)
).