FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: importing fife in eclipse pydev  (Read 3452 times)

Arp

  • Newbie
  • Posts: 4
    • View Profile
importing fife in eclipse pydev
« on: September 21, 2011, 07:30:33 am »

Hi,

I'm new here and also new to game programming, but I had the crazy idea to try to write my own realtime strategy game :)

After a bit of searching I found FIFE and its capabilities look quite impressive. So I thought I'd give it a shot.

I successfully built fife (I think), althoug it says that it did not find SDL_TTF, but it continued building. (Ubuntu 11.04 x64).
Anyway, I am able to run the demo-games that are in the package.

Now I wanted to start my own game. For starters, a small map and a figure that I can move around.
But for some reason, my eclipse with pydev plugin wont recognize fife.

it starts in the line "from fife import fife", eclipse says "unresolved import: fife". Im not that familiar with eclipse, because all the python programms that I wrote (small useful things, small gui's and such stuff), I wrote in gedit :)
So, can anyone tell me how to tell eclipse where to look for the fife package? I guess it should be correctly installed since I can run the demos.
Thx.
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: importing fife in eclipse pydev
« Reply #1 on: September 21, 2011, 09:53:14 am »

How did you build FIFE? With scons, it is

scons ext && scons && sudo scons install-python

The last call "copies" FIFE to the dist-packages dir of python in /usr/lib/python2.6/ (hence it needs root access). I am not sure right now, but my guess is that the demos try to use the built engine first, and then start to look for a globally installed FIFE.

So 'from fife import fife' needs FIFE in python2.6/dist-packages or wherever python looks for modules.

Arp

  • Newbie
  • Posts: 4
    • View Profile
Re: importing fife in eclipse pydev
« Reply #2 on: September 21, 2011, 10:56:58 am »

Hi,

I forgot to do sudo scons install-python. I did it now, but it still does not work. I have python 2.7, I hope thats not the problem, and after doing the command above, in the dist-packages folder there is no new folder for fife...

so... what now? :)
thx.
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: importing fife in eclipse pydev
« Reply #3 on: September 22, 2011, 06:51:33 am »

check if scons created a /usr/lib/python26/ dir and moved the fife library into the dist-package dir there. If so, scons assumes you are using python 2.6, while eclipse tries to use python 2.7 - which of course have to fail.

I myself use python 2.6, so I have no experience on using FIFE with python 2.7. But so far, I know that only python 3.x doesn´t work, while 2.7 should. So there is a good chance that once you told either eclipse to use 2.6 or scons to use 2.7, it will work.

Arp

  • Newbie
  • Posts: 4
    • View Profile
Re: importing fife in eclipse pydev
« Reply #4 on: September 22, 2011, 07:15:55 am »

I think the problem is larger.... because even in the python2.6 folder there is nothing about fife in the dist-package folder.

still scons says that it can find sdl, but not sdl_ttf, or boost_something, altough according to apt-get, all the packages are installed.
Logged

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: importing fife in eclipse pydev
« Reply #5 on: September 22, 2011, 07:47:56 am »

can you post the config.log file that is generated from the scons build command. It should be located in <fife_src>/build directory. This file may be able to help us determine what is really missing.

You can also join us on our IRC channel (#fife on freenode.net) if you want to try and get some real time help with the problem.
Logged

Arp

  • Newbie
  • Posts: 4
    • View Profile
Re: importing fife in eclipse pydev
« Reply #6 on: September 22, 2011, 08:01:58 am »

here comes the log file... its a bit large :)
Quote
file /home/arp/game/fife-0.3.2r2/SConstruct,line 179:
   Configure(confdir = build/.sconf_temp)
scons: Configure: Checking for vorbisfile (using pkg-config)...
scons: Configure: "build/.sconf_temp/conftest_0" is up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'vorbisfile'
  |
scons: Configure: (cached) yes

scons: Configure: Checking for openal (using pkg-config)...
scons: Configure: "build/.sconf_temp/conftest_1" is up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'openal'
  |
scons: Configure: (cached) yes

scons: Configure: Checking for SDL (using pkg-config)...
scons: Configure: "build/.sconf_temp/conftest_2" is up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'sdl'
  |
scons: Configure: (cached) yes

scons: Configure: Checking for SDL_ttf (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_3" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'sdl_ttf'
  |
scons: Configure: (cached) no

scons: Configure: Checking for SDL_ttf (using sdl_ttf-config)...
scons: Configure: Building "build/.sconf_temp/conftest_4" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |sdl_ttf-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library SDL_ttf...
scons: Configure: "build/.sconf_temp/conftest_5.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_5.cpp <-
  |  |
  |  |
  |  |#include "SDL_ttf.h"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_5.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_5.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_5.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_5" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_5 build/.sconf_temp/conftest_5.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf
  |
scons: Configure: (cached) yes

scons: Configure: Checking for SDL_image (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_6" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'sdl_image'
  |
scons: Configure: (cached) no

scons: Configure: Checking for SDL_image (using sdl_image-config)...
scons: Configure: Building "build/.sconf_temp/conftest_7" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |sdl_image-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library SDL_image...
scons: Configure: "build/.sconf_temp/conftest_8.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_8.cpp <-
  |  |
  |  |
  |  |#include "SDL_image.h"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_8.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_8.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_8.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_8" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_8 build/.sconf_temp/conftest_8.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image
  |
scons: Configure: (cached) yes

scons: Configure: Checking for guichan (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_9" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'guichan'
  |
scons: Configure: (cached) no

scons: Configure: Checking for guichan (using guichan-config)...
scons: Configure: Building "build/.sconf_temp/conftest_10" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |guichan-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library guichan...
scons: Configure: "build/.sconf_temp/conftest_11.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_11.cpp <-
  |  |
  |  |
  |  |#include "guichan.hpp"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_11.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_11.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_11.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_11" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_11 build/.sconf_temp/conftest_11.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan
  |
scons: Configure: (cached) yes

scons: Configure: Checking for guichan_sdl (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_12" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'guichan_sdl'
  |
scons: Configure: (cached) no

scons: Configure: Checking for guichan_sdl (using guichan_sdl-config)...
scons: Configure: Building "build/.sconf_temp/conftest_13" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |guichan_sdl-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library guichan_sdl...
scons: Configure: "build/.sconf_temp/conftest_14.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_14.cpp <-
  |  |
  |  |
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_14.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_14.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_14.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_14" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_14 build/.sconf_temp/conftest_14.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan -lguichan_sdl
  |
scons: Configure: (cached) yes

scons: Configure: Checking for boost_filesystem (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_15" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'boost_filesystem'
  |
scons: Configure: (cached) no

scons: Configure: Checking for boost_filesystem (using boost_filesystem-config)...
scons: Configure: Building "build/.sconf_temp/conftest_16" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |boost_filesystem-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library boost_filesystem...
scons: Configure: "build/.sconf_temp/conftest_17.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_17.cpp <-
  |  |
  |  |
  |  |#include "boost/filesystem.hpp"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_17.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_17.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_17.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_17" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_17 build/.sconf_temp/conftest_17.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan -lguichan_sdl -lboost_filesystem
  |
scons: Configure: (cached) yes

scons: Configure: Checking for boost_regex (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_18" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'boost_regex'
  |
scons: Configure: (cached) no

scons: Configure: Checking for boost_regex (using boost_regex-config)...
scons: Configure: Building "build/.sconf_temp/conftest_19" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |boost_regex-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library boost_regex...
scons: Configure: "build/.sconf_temp/conftest_20.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_20.cpp <-
  |  |
  |  |
  |  |#include "boost/regex.hpp"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_20.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_20.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_20.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_20" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_20 build/.sconf_temp/conftest_20.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan -lguichan_sdl -lboost_filesystem -lboost_regex
  |
scons: Configure: (cached) yes

scons: Configure: Checking for png (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_21" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'png'
  |
scons: Configure: (cached) no

scons: Configure: Checking for png (using png-config)...
scons: Configure: Building "build/.sconf_temp/conftest_22" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |png-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library png...
scons: Configure: "build/.sconf_temp/conftest_23.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_23.cpp <-
  |  |
  |  |
  |  |#include "png.h"
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_23.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_23.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_23.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_23" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_23 build/.sconf_temp/conftest_23.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan -lguichan_sdl -lboost_filesystem -lboost_regex -lpng
  |
scons: Configure: (cached) yes

scons: Configure: Checking for Xcursor (using pkg-config)...
scons: Configure: "build/.sconf_temp/conftest_24" is up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'xcursor'
  |
scons: Configure: (cached) yes

scons: Configure: Checking for guichan_opengl (using pkg-config)...
scons: Configure: Building "build/.sconf_temp/conftest_25" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |pkg-config --libs --cflags 'guichan_opengl'
  |
scons: Configure: (cached) no

scons: Configure: Checking for guichan_opengl (using guichan_opengl-config)...
scons: Configure: Building "build/.sconf_temp/conftest_26" failed in a previous run and all its sources are up to date.
scons: Configure: The original builder output was:
  |guichan_opengl-config --libs --cflags
  |
scons: Configure: (cached) no

scons: Configure: Checking for C++ library guichan_opengl...
scons: Configure: "build/.sconf_temp/conftest_27.cpp" is up to date.
scons: Configure: The original builder output was:
  |build/.sconf_temp/conftest_27.cpp <-
  |  |
  |  |
  |  |
  |  |int
  |  |main() {
  |  | 
  |  |return 0;
  |  |}
  |  |
  |
scons: Configure: "build/.sconf_temp/conftest_27.o" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_27.o -c -DPNG_SKIP_SETJMP_CHECK -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include -I/usr/include/vorbis -I/usr/include/SDL -I/usr/include/python2.7 -Iext/install/include build/.sconf_temp/conftest_27.cpp
  |
scons: Configure: "build/.sconf_temp/conftest_27" is up to date.
scons: Configure: The original builder output was:
  |g++ -o build/.sconf_temp/conftest_27 build/.sconf_temp/conftest_27.o -L/opt/lib -Lext/install/lib -L/usr/X11R6/lib -L/usr/lib/x86_64-linux-gnu -lpython2.7 -lstdc++ -lGL -lGLU -lvorbisfile -lvorbis -lm -logg -lopenal -lSDL -lSDL_ttf -lSDL_image -lguichan -lguichan_sdl -lboost_filesystem -lboost_regex -lpng -lXcursor -lguichan_opengl
  |
scons: Configure: (cached) yes
Logged

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: importing fife in eclipse pydev
« Reply #7 on: September 22, 2011, 12:15:17 pm »

This is a bit confusing because you said you get errors stating that it cannot find some of the required dlls but the config.log does not show this being the case.

can you post the actual errors you see in the console?

Also try doing the following on the command line in the <fife> directory:
rm -rf .sconsign.dblite .sconf_temp
scons ext -c && scons -c
scons ext && sudo scons install-python

The following lines will remove all of the scons caches and clean the fife scons build and then restart the build process. After doing this if you still get errors please post the config.log and the console error output again.
Logged