openSUSE "Could not open file of texture..."

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

openSUSE "Could not open file of texture..."

Post by ericthered »

Hello,

I am trying to get irrlicht up and running on Linux. Specifically, openSUSE 11.2. Everything compiles/builds just fine so far using Code::Blocks except for when it comes to loading textures and models. For example, 01. HelloWorld compiles and builds with no errors, but running it is unfruitful because irrlicht is unable to load the model and textures. The GUI example runs fine except for the following error messages (in the console):

Could not load font because the file does not exist:
../../media.fonthaettenschweiler.bmp

Could not open file of texture ../../media/irrlichtlogo2.png

I altered the directories in main.cpp to read /home/eric/irrlicht/media etc etc, but I get the same results.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Did you download the SDK from the Irrlicht website, or do you use some rpm?
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

hybrid wrote:Did you download the SDK from the Irrlicht website, or do you use some rpm?
Both. I trust removing some .rpm's may be in order...?

I moved the offending media folder to /home in order to simplify the absolute directory in the code, but the textures/models/fonts still cannot be loaded. :shock:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the rpms often come in several packages, where the media is not in the default packages. Moreover, the paths used in the examples were changed, so it's hard to tell what is really happening.
The SDK examples should run without any problems on all Linux versions. At least I never had any problems so far. Maybe copy-paste the full console log.
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

I think I found the issue.

I just tried to recompile the irrlicht engine and ecountered several errors:

Code: Select all

CImageLoaderPNG.cpp:13:58: error: libpng/png.h: No such file or directory       
CImageLoaderPNG.cpp:28: error: variable or field ‘png_cpexcept_error’ declared void                                                                             
CImageLoaderPNG.cpp:28: error: ‘png_structp’ was not declared in this scope     
CImageLoaderPNG.cpp:28: error: ‘png_const_charp’ was not declared in this scope 
CImageLoaderPNG.cpp:35: error: expected initializer before ‘user_read_data_fcn’ 
CImageLoaderPNG.cpp: In member function ‘virtual bool irr::video::CImageLoaderPng::isALoadableFileFormat(irr::io::IReadFile*) const’:                           
CImageLoaderPNG.cpp:69: error: ‘png_byte’ was not declared in this scope        
CImageLoaderPNG.cpp:69: error: expected ‘;’ before ‘buffer’                     
CImageLoaderPNG.cpp:71: error: ‘buffer’ was not declared in this scope          
CImageLoaderPNG.cpp:75: error: ‘buffer’ was not declared in this scope          
CImageLoaderPNG.cpp:75: error: ‘png_sig_cmp’ was not declared in this scope     
CImageLoaderPNG.cpp: In member function ‘virtual irr::video::IImage* irr::video::CImageLoaderPng::loadImage(irr::io::IReadFile*) const’:                        
CImageLoaderPNG.cpp:93: error: ‘png_byte’ was not declared in this scope        
CImageLoaderPNG.cpp:93: error: expected ‘;’ before ‘buffer’                     
CImageLoaderPNG.cpp:95: error: ‘buffer’ was not declared in this scope          
CImageLoaderPNG.cpp:102: error: ‘buffer’ was not declared in this scope         
CImageLoaderPNG.cpp:102: error: ‘png_sig_cmp’ was not declared in this scope    
CImageLoaderPNG.cpp:109: error: ‘png_structp’ was not declared in this scope    
CImageLoaderPNG.cpp:109: error: expected ‘;’ before ‘png_ptr’                   
CImageLoaderPNG.cpp:111: error: ‘png_ptr’ was not declared in this scope        
CImageLoaderPNG.cpp:118: error: ‘png_infop’ was not declared in this scope      
CImageLoaderPNG.cpp:118: error: expected ‘;’ before ‘info_ptr’                  
CImageLoaderPNG.cpp:119: error: ‘info_ptr’ was not declared in this scope       
CImageLoaderPNG.cpp:122: error: ‘png_ptr’ was not declared in this scope        
CImageLoaderPNG.cpp:122: error: ‘png_destroy_read_struct’ was not declared in this scope                                                                        
CImageLoaderPNG.cpp:127: error: ‘png_ptr’ was not declared in this scope        
CImageLoaderPNG.cpp:127: error: ‘png_jmpbuf’ was not declared in this scope     
CImageLoaderPNG.cpp:127: error: ‘setjmp’ was not declared in this scope         
CImageLoaderPNG.cpp:129: error: ‘info_ptr’ was not declared in this scope       
CImageLoaderPNG.cpp:129: error: ‘png_destroy_read_struct’ was not declared in this scope                                                                        
CImageLoaderPNG.cpp:136: error: ‘png_ptr’ was not declared in this scope        
CImageLoaderPNG.cpp:136: error: ‘user_read_data_fcn’ was not declared in this scope                                                                             
CImageLoaderPNG.cpp:136: error: ‘png_set_read_fn’ was not declared in this scope
CImageLoaderPNG.cpp:138: error: ‘png_set_sig_bytes’ was not declared in this scope                                                                              
CImageLoaderPNG.cpp:140: error: ‘info_ptr’ was not declared in this scope       
CImageLoaderPNG.cpp:140: error: ‘png_read_info’ was not declared in this scope  
CImageLoaderPNG.cpp:148: error: ‘png_uint_32’ was not declared in this scope    
CImageLoaderPNG.cpp:148: error: expected ‘;’ before ‘w’                         
CImageLoaderPNG.cpp:151: error: ‘w’ was not declared in this scope              
CImageLoaderPNG.cpp:151: error: ‘h’ was not declared in this scope              
CImageLoaderPNG.cpp:152: error: ‘png_get_IHDR’ was not declared in this scope   
CImageLoaderPNG.cpp:158: error: ‘PNG_COLOR_TYPE_PALETTE’ was not declared in this scope                                                                         
CImageLoaderPNG.cpp:159: error: ‘png_set_palette_to_rgb’ was not declared in this scope                                                                         
CImageLoaderPNG.cpp:164: error: ‘PNG_COLOR_TYPE_GRAY’ was not declared in this scope                                                                            
CImageLoaderPNG.cpp:164: error: ‘PNG_COLOR_TYPE_GRAY_ALPHA’ was not declared in this scope                                                                      
CImageLoaderPNG.cpp:165: error: ‘png_set_gray_1_2_4_to_8’ was not declared in this scope                                                                        
CImageLoaderPNG.cpp:167: error: ‘png_set_packing’ was not declared in this scope
CImageLoaderPNG.cpp:170: error: ‘PNG_INFO_tRNS’ was not declared in this scope  
CImageLoaderPNG.cpp:170: error: ‘png_get_valid’ was not declared in this scope  
CImageLoaderPNG.cpp:171: error: ‘png_set_tRNS_to_alpha’ was not declared in this scope                                                                          
CImageLoaderPNG.cpp:175: error: ‘png_set_strip_16’ was not declared in this scope                                                                               
CImageLoaderPNG.cpp:178: error: ‘PNG_COLOR_TYPE_GRAY’ was not declared in this scope                                                                            
CImageLoaderPNG.cpp:178: error: ‘PNG_COLOR_TYPE_GRAY_ALPHA’ was not declared in this scope
CImageLoaderPNG.cpp:179: error: ‘png_set_gray_to_rgb’ was not declared in this scope
CImageLoaderPNG.cpp:182: error: ‘png_read_update_info’ was not declared in this scope
CImageLoaderPNG.cpp:185: error: ‘png_uint_32’ was not declared in this scope
CImageLoaderPNG.cpp:185: error: expected ‘;’ before ‘w’
CImageLoaderPNG.cpp:188: error: ‘w’ was not declared in this scope
CImageLoaderPNG.cpp:188: error: ‘h’ was not declared in this scope
CImageLoaderPNG.cpp:189: error: ‘png_get_IHDR’ was not declared in this scope
CImageLoaderPNG.cpp:195: error: ‘PNG_COLOR_TYPE_RGB_ALPHA’ was not declared in this scope
CImageLoaderPNG.cpp:200: error: ‘png_set_bgr’ was not declared in this scope
CImageLoaderPNG.cpp:207: error: ‘png_uint_32’ was not declared in this scope
CImageLoaderPNG.cpp:207: error: expected ‘;’ before ‘w’
CImageLoaderPNG.cpp:210: error: ‘w’ was not declared in this scope
CImageLoaderPNG.cpp:210: error: ‘h’ was not declared in this scope
CImageLoaderPNG.cpp:211: error: ‘png_get_IHDR’ was not declared in this scope
CImageLoaderPNG.cpp:217: error: ‘PNG_COLOR_TYPE_RGB_ALPHA’ was not declared in this scope
CImageLoaderPNG.cpp:224: error: ‘png_destroy_read_struct’ was not declared in this scope
CImageLoaderPNG.cpp:229: error: expected type-specifier before ‘png_bytep’
CImageLoaderPNG.cpp:229: error: cannot convert ‘int*’ to ‘irr::u8**’ in assignment
CImageLoaderPNG.cpp:229: error: expected ‘;’ before ‘png_bytep’
CImageLoaderPNG.cpp:233: error: ‘png_destroy_read_struct’ was not declared in this scope
CImageLoaderPNG.cpp:247: error: ‘png_jmpbuf’ was not declared in this scope
CImageLoaderPNG.cpp:247: error: ‘setjmp’ was not declared in this scope
CImageLoaderPNG.cpp:249: error: ‘png_destroy_read_struct’ was not declared in this scope
CImageLoaderPNG.cpp:257: error: ‘png_read_image’ was not declared in this scope
CImageLoaderPNG.cpp:259: error: ‘png_read_end’ was not declared in this scope
CImageLoaderPNG.cpp:262: error: ‘png_destroy_read_struct’ was not declared in this scope
make: *** [CImageLoaderPNG.o] Error 1
Evidently the SDK is missing libpng/png.h.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, definitely not. However, most rpms remove the extra libs and use the USE_SYSTEM_LIB switches in order to compile against the distro libs. I'm pretty sure you simply mixed up those sources somehow.
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

I fetched a libpng .rpm and the engine compiled correctly, however, the problem remains. I will continue to tinker with it...
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

Sorry to bump, but this is starting to bug me.

All irrlicht .rpm's have been removed and the "clean" 1.7 SDK is in my home folder. Engine compiles perfectly, C::B is set up for Linux, but nothing from the /media folder can be loaded.

I have used Ubuntu in the past and have not experienced these difficulties with that particular distro, so something odd is going on here.


EDIT: Here is the log after putting 01. HelloWorld through the C::B debugger. I had to take a screenshot at exactly the right time because the console abruptly closes.

Code: Select all

warning: GDB: Failed to set controlling terminal: Operation not permitted
Irrlicht Engine version 1.7.1
Linux 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100 x86_64
Creating X window
Using plain X visual
Visual chose: : 33
Could not load mesh, because file could not be opened: :
home/eric/irrlicht/media/sydney.md2
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

So, here's my progress so far...

I downloaded the SDK to my Ubuntu installation, and got the same problems (which never happened before 10.04...). I used the 'make' command to build the HelloWorld example, and it worked flawlessly. I did the same with all the other examples, but none worked.

I loaded the .cbp that comes with the examples and made some modifications for Linux compatibility. I had to cycle through about five "Build Target" windows upon attempting to compile, but some of the examples did work.

*scratches head*
conallmmcg
Posts: 23
Joined: Sun Oct 19, 2008 2:35 pm

Post by conallmmcg »

did u try using sudo to launch the examples.
i'm nearly sure this happened to me once and for some reason normal user privileges would not allow the app to load resources.

i could be entirely wrong though
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

conallmmcg wrote:did u try using sudo to launch the examples.
i'm nearly sure this happened to me once and for some reason normal user privileges would not allow the app to load resources.

i could be entirely wrong though
Hm. So it could be as simple as "sudo su" in the command terminal... I'll give it a shot.
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

Yeah, chmod them!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Do you start your apps by clickin on them, or from the command line?
ericthered
Posts: 11
Joined: Mon Apr 05, 2010 3:36 pm

Post by ericthered »

hybrid wrote:Do you start your apps by clickin on them, or from the command line?
Originally I tried clicking, but that only worked for 01.HelloWorld. So I resorted to deleting the executables and executing 'make' in each folder again. After that, I used the command line to run the examples, and they all worked flawlessly.

A bit of tinkering in C::B and the examples seem to be compiling/building without trouble.

Not sure what was going on with the /media folder, but everything seems to be working as of right now.
Post Reply