Followers 0

# glut: can not find tga file.

## 7 posts in this topic

hi
i tried to load a TGA files from my harddisk but the gltReadTGABits() always return NULL. i tried to copy the TGA file next to where the source file is and copy it to the debug folder(i was in the debug mode), i check and recheck the file name, but it still return NULL. does anybody have any idea what i should check again? i

thanks
0

##### Share on other sites
hi,
i just want to add that i was getting the source of gltReadTGABits() from superBible 5th.
0

##### Share on other sites
You say you are in debug mode, does that mean launching the application from your IDE (eg Visual Studio, Code::Blocks)? If you do, try launching it from the folder the executable is in.
0

##### Share on other sites
When you launch from your IDE, it will set the [url="http://en.wikipedia.org/wiki/Working_directory"]working directory[/url] to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.
1

##### Share on other sites
hi hodgman:

the wikipedia is dark today, i will look at it tomorrow.
thanks
0

##### Share on other sites
[quote name='Hodgman' timestamp='1326860046' post='4903881']
When you launch from your IDE, it will set the [url="http://en.wikipedia.org/wiki/Working_directory"]working directory[/url] to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.
[/quote]

hi,
i checked the project property and found that the working directory is $(ProjectDir). it should be OK, right? is there a way to peek at what$(ProjectDir) represent?

thanks
0

##### Share on other sites
[quote name='nickme' timestamp='1326939153' post='4904163']
[quote name='Hodgman' timestamp='1326860046' post='4903881']
When you launch from your IDE, it will set the [url="http://en.wikipedia.org/wiki/Working_directory"]working directory[/url] to a particular path (which you can configure in your IDE's debugging properties).

Any file paths that you use in your program will be relative to this working directory.
[/quote]

hi,
i checked the project property and found that the working directory is $(ProjectDir). it should be OK, right? is there a way to peek at what$(ProjectDir) represent?

thanks
[/quote]

The ProjectDirectory is where your code files are, not where the final .exe file is. Make sure that the .tga and .exe files are in the same place, and then try launching the exe NOT from the IDE, but from Explorer.
0

##### Share on other sites
hi
thanks for the help. as it turned out the original tga file that i created was in compressed format. after i found that out, i changed the format, now it run as expected.

thanks again.
0

## Create an account

Register a new account