Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: skool daze on September 15, 2015, 10:50:30 am

Title: project with sfml :unable to run .exe
Post by: skool daze on September 15, 2015, 10:50:30 am
Hello, after reading a bit the wiki (recommend any tutorials?) I didn t found anything related to my annoying problem:    though the execution in the C::B 13.12 is OK, the .exe is only half a second active, with no proper image in the window.
I've been triyng with the options related to debug/release (project options) and of course put the *.dll in the same release directory, made sure everything is logic in search directories, compiler/linker directories   (the dll are for the non static, non debug version, and they are from the last SFML);   but all these fails.

What do you think am I mistaken?
Is it maybe a SFML related problem?    Many thanks!!.
Title: Re: project with sfml :unable to run .exe
Post by: scarphin on September 15, 2015, 12:14:56 pm
Are you sure that is not a programming problem? To test this you can run the executable from the command line, if it still doesn't work then you have to check your code.
Title: Re: project with sfml :unable to run .exe
Post by: skool daze on September 15, 2015, 01:33:57 pm
The O.S. is WinXP and it runs adequately my average DOS exes.
The problem is that executable only runs from the IDE, not "double-clicking" on it.
I´m working as possible solution the debug/release issue, but nothing so far.
Any doc about the debug/release?
Title: Re: project with sfml :unable to run .exe
Post by: scarphin on September 15, 2015, 10:34:14 pm
The problem is that executable only runs from the IDE, not "double-clicking" on it.
Probably you don't have the required dlls in your system path for your executable to run from shell (cmd). First of all please try to copy the required dlls to where your executable is and try to run it from shell (cmd.exe) and check if it is working or not. If it's not working from shell then the problem is most likely a bug in your code. You can use 'dependency walker' to see what dlls your program require. Please use google if you need more information about dependency walker, system path, cmd.exe etc...

Debug and Release are targets with debug symbols enabled for the debug target and some optimizations enabled for the release target. They normally shouldn't effect your programs behavior.
Title: Re: project with sfml :unable to run .exe
Post by: BlueHazzard on September 15, 2015, 10:53:22 pm
Are you loading some external files? remember to copy also this files.... This is clearly no c::b or compiling problem, but something you are doing in your logic (probably loading some files)
I recommend to improve the error checking in your program

greetings...
Title: Re: project with sfml :unable to run .exe
Post by: skool daze on September 19, 2015, 11:34:53 am
But whats the troubleshhoting for these cases?
Title: Re: project with sfml :unable to run .exe
Post by: oBFusCATed on September 19, 2015, 11:56:02 am
Use debugger. Printing to some log.
If it is a dll related problem, you can use the dependency walker to see which dlls are missing.
Title: Re: project with sfml :unable to run .exe
Post by: skool daze on September 19, 2015, 07:28:23 pm
Thanks! And is the dependency walker an externa l app?
Title: Re: project with sfml :unable to run .exe
Post by: stahta01 on September 19, 2015, 09:27:41 pm
Thanks! And is the dependency walker an externa l app?

Yes. http://www.dependencywalker.com/ (http://www.dependencywalker.com/)
Title: Re: project with sfml :unable to run .exe
Post by: skool daze on September 21, 2015, 10:18:30 am
O.K.  and many thanks, oBFusCATed and stahta01; oh and I suppose stahta01, your signature link to the official wiki will help me with regards to the debug/release question if I make a thoroughly search...  ;)
Title: Re: project with sfml :unable to run .exe
Post by: skool daze on September 21, 2015, 11:09:15 am
Resuming:
Yes I know the most likely error is mine, not C::B fault (neither SFML's fault), but nonetheless, it puzzless me.
It's only a minimal test code with creation of window waiting to be closed with the minimal content, nothing more.
Nor it uses any external file other that the own *.dll's

I am thinking about the targets, it's the first time I code with that debug/release dichotomy

run it from shell --> no, it's GUI application

Also checked in "Build options...", dont touch Compiler Flags...or only the same checks for Release as Debug, in Linker settings>Link libraries ensure that the *.a's are in correct order (first graphics, then window, last system). Also in both options of Search directories (Compiler + Linker), ensure correct paths.

Maybe I missed something related to the possibility of static version?

Many thanks!