Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devil not loading images with linux build

Tags:

c++

c

linux

devil

I was having issues getting an image to load in to Devil so I have provided exactly how I built the libs and how I am trying to use it.

Downloaded Devel source from their website.

$ unzip DevIL-1.7.8.zip
$ mkdir devil
$ cd Devil-1.7.8
+-------------------------------------------+
| Just type:                                |
| autoreconf -i                             |
| ./configure <your options here>           |
| make                                      |
| sudo make install                         |
+-------------------------------------------+

If I use autoreconf -i then ./configure with prefix and ilu and ilut. I get an error ..forgot.. to record it. How important is this? I have just not used it.

$ chmod +x configure
$  ./configure --prefix=/home/path/to/TestingDevil/devil --enable-ILU --enable-ILUT
$ make
$ make install 

So at this point my library should be built. I downloaded the devil simple example (simple.c) to TestingDevil/simple/simple.c built it.

$ gcc -I ../devil/include -L ../devil/lib/ simple.c -o simple -lIL -lILU -lILUT
$ cp ../devil/lib/*.so* .

I have added an image (jpg) to test.

$ LD_LIBRARY_PATH=. ./simple image.jpg

"Could not open file...exiting"

I ran the executable from the simple directory.

simple$ ls

image.jpg libIL.so.1.1.0 libILU.so.1.1.0 libILUT.so.1.1.0 libIL.so libILU.so libILUT.so simple libIL.so.1 libILU.so.1
libILUT.so.1 simple.c

Whats going wrong? I am using the example from devIL, it compiles and runs fine. Just can't load any files.

My System is Ubuntu 12.10 64 with build-essential installed and other dev packages for opengl dev.

Uni System is Fedora 15(?) 32. This also has exactly the same problem after building devIL in the same way.

On my home machine I installed the package libdevel-dev and that works fine.

This question does not ask about opengl, purely the devIL lib and example.

like image 697
Andrew Avatar asked Nov 12 '22 11:11

Andrew


1 Answers

It looks like you build it withjout jpg support or you do not have jpeg libs available ?

like image 154
sancelot Avatar answered Nov 15 '22 05:11

sancelot