User forums > Help
How can I use SDL_ttf with code blocks?
JGM:
--- Quote from: Zamp on October 13, 2007, 04:10:29 pm --->__> Hopefully that made sense. Basically, how can I run the program without having to open up Code::Blocks first?
--- End quote ---
Maybe your executable use resources that can't find in the bin directory. When you run the program from codeblocks it uses the main project directory as the Current Working Directory. For example, if your file structure is like this:
MainProject //main project directory
- bin //where executables reside
- images //Some resources
- include
- src
Well, if you run the executable directly from bin it will not find the images, so you will have to copy the folder of images inside the folder where the executable resides. Hopes it helps.
Zamp:
When I try to run from the terminal it just does the same thing, show the black screen then disappear. It doesn't say anything in the terminal about it, all it says the folder name that it always shows before you type a command.
And I'm not really trying to distribute this, I was just saying that to help make what I said make more sense. >___>
Also, I put the images and .ttf file I was using in the same directory as the bin, and it still doesn't work. I even put the executable in the main project folder and tried to run it, but it still didn't work =/
Auria:
It sounds like your code does not perform any error checking. When your code loads resources, you should check for success and display an error message upon failure.
Zamp:
I do have error checking, I just never had it do anything except close the program. >_> But I just added error messages and it still doesn't say anything.
But if I try to run the Debug one from the terminal it will run, and I put a message at the end saying it finished, and it shows that in the terminal, but it won't run if I just click on it. Also, I can't get the one in the Release folder to run at all. It just closes right away, even in the terminal, and doesn't display any message at all.
Auria:
Add some sort of logging to your app to know where it goes... Use a debugger from the terminal... etc.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version