Author Topic: project with sfml :unable to run .exe  (Read 5854 times)

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
project with sfml :unable to run .exe
« 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!!.
Beginning with Code::Blocks

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: project with sfml :unable to run .exe
« Reply #1 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.

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
Re: project with sfml :unable to run .exe
« Reply #2 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?
« Last Edit: September 15, 2015, 01:53:11 pm by skool daze »
Beginning with Code::Blocks

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: project with sfml :unable to run .exe
« Reply #3 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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: project with sfml :unable to run .exe
« Reply #4 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...

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
Re: project with sfml :unable to run .exe
« Reply #5 on: September 19, 2015, 11:34:53 am »
But whats the troubleshhoting for these cases?
Beginning with Code::Blocks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: project with sfml :unable to run .exe
« Reply #6 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
Re: project with sfml :unable to run .exe
« Reply #7 on: September 19, 2015, 07:28:23 pm »
Thanks! And is the dependency walker an externa l app?
Beginning with Code::Blocks

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: project with sfml :unable to run .exe
« Reply #8 on: September 19, 2015, 09:27:41 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
Re: project with sfml :unable to run .exe
« Reply #9 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...  ;)
Beginning with Code::Blocks

Offline skool daze

  • Multiple posting newcomer
  • *
  • Posts: 10
  • beginning with Code::Blocks
Re: project with sfml :unable to run .exe
« Reply #10 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!
Beginning with Code::Blocks