Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] Cannot run SFML program in CodeBlocks  (Read 3300 times)

0 Members and 1 Guest are viewing this topic.

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
[SOLVED] Cannot run SFML program in CodeBlocks
« on: March 27, 2013, 11:19:00 pm »
I've compiled SFML 2 from source and created and configured a CodeBlocks project as per the tutorials. Everything builds fine, but when I run the program, it immediately terminates. However, if I compile and link the program via command line with g++, the result program runs fine. Any ideas?

System details:
Linux Mint 14 x86
g++ 4.7.2
CodeBlocks 12.11
Latest SFML 2 snapshot as of today (3/27)
« Last Edit: March 28, 2013, 12:26:08 am by the_composer »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Cannot run SFML program in CodeBlocks
« Reply #1 on: March 27, 2013, 11:51:43 pm »
Run it through GDB (debugger) and see what happens. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Cannot run SFML program in CodeBlocks
« Reply #2 on: March 27, 2013, 11:57:35 pm »
Well I'll be damned. It works, but launching the console was causing an error "Can't launch console (xterm -T 'Program Console' -e sleep 80002439". I know I can disable the console in project settings, but I was hoping to use it for logging and debugging. Is there a way to launch both the game window and the console?

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Cannot run SFML program in CodeBlocks
« Reply #3 on: March 28, 2013, 12:19:27 am »
I'm not currently on a machine with Linux, but if I remember correctly, the command Code::Blocks should use to launch a console should be:
xterm -T $TITLE -e
Try replacing it with that.
Personally, I don't like xterm very much, so I use the gnome terminal, a bit of Googling let me know that you can use:
gnome-terminal --disable-factory -t $TITLE -x

Hope I helped!

EDIT: in case you don't know where to edit the console launch command, it's in Settings -> Environment
« Last Edit: March 28, 2013, 12:23:44 am by Aster »

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Cannot run SFML program in CodeBlocks
« Reply #4 on: March 28, 2013, 12:25:43 am »
That did the trick! Thanks so much, both of you.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Cannot run SFML program in CodeBlocks
« Reply #5 on: March 28, 2013, 12:27:03 am »
That did the trick! Thanks so much, both of you.

Glad we helped!

 

anything