Hello there,
usually I can find quite easily solutions to any Irrlicht related problem so for my first post it'll not be an (fully) Irrlicht related question.
I've made an Irrlicht program (navmeshes with A*) using opengl as renderer and pthreads, and now that I've finally got it to work I want to try to give it to a friend. So my question is basically how do I do that ? I want to compile my program and give it to him without him having to install anything. I've tried numerous things to get it to work but with no success (I've been messing around with libIrrlicht.a libIrrlicht.so and so on for two days). If there's a tutorial out there on how to do it on linux (ubuntu) that would be great or if you could give me the steps to follow I'd give you an internet hug (a tuto on how to do it on windows would be awesome too).
Thanks for your help and pardon my english, I'm french .
[solved]Compiling an Irrlicht program for "distribution"
-
- Posts: 33
- Joined: Fri Mar 01, 2013 1:26 am
[solved]Compiling an Irrlicht program for "distribution"
Last edited by Nyx Erebos on Fri Mar 01, 2013 5:44 pm, edited 1 time in total.
Re: Compiling an Irrlicht program for "distribution" (how to
If your dependencies are not too complex you could instruct your friend to just install the needed libraries via his package manager, like
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. Use your favorite search engine for further info or feel free to ask here.
Cheers!
Code: Select all
sudo apt-get install irrlicht <additional deps here>
Cheers!
beer->setMotivationCallback(this);
Re: Compiling an Irrlicht program for "distribution" (how to
There's also a page on wiki for this: http://irrlicht3d.org/wiki/index.php?n= ... ingOnLinux
Working on game: Marrbles (Currently stopped).
-
- Posts: 33
- Joined: Fri Mar 01, 2013 1:26 am
Re: Compiling an Irrlicht program for "distribution" (how to
Thanks for the quick answers .
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 :
When I type ldd Demo :
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 ).
I've already tried that and several variations.serengeor wrote:There's also a page on wiki for this: http://irrlicht3d.org/wiki/index.php?n= ... ingOnLinux
Actually I want to avoid that.polylux wrote:If your dependencies are not too complex you could instruct your friend to just install the needed libraries via his package manager, likeCode: Select all
sudo apt-get install irrlicht <additional deps here>
I'm trying hard but can't get it to work . Here's my makefile (don't mind the windows parts) :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.
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
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
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)
-
- Posts: 33
- Joined: Fri Mar 01, 2013 1:26 am
Re: Compiling an Irrlicht program for "distribution" (how to
I feel a bit stupid now, I thought it was an Irrlicht setup related problem but no it was really just a compiling knowledge fail. I just had to find out that it was not a good idea to try to link staticly opengl and pthread, ant to use the options -static and -dynamic. Thanks for your help anyway