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

Author Topic: problem with executing  (Read 1854 times)

0 Members and 2 Guests are viewing this topic.

croux

  • Newbie
  • *
  • Posts: 15
    • View Profile
problem with executing
« on: May 11, 2013, 06:18:43 pm »
Hi, i am currently trying to make my first "Hello world" sfml programm. But i am stuck.

Here is the code: http://pastebin.com/aSevk6Nw
and here is my cmd command for compiling:
g++ -o m.exe main.cpp -lsfml-graphics -lsfml-window -lsfml-system

after i succesfully compile the main.cpp i start the m.exe , which print the message this work but after that windows say program not responding. This was the same problem why i switched to cmd from codeblocks.
mingw version is: dw2
sfml version is: GCC 4.7 MinGW (DW2) - 32 bits

All the dlls, includes and libs are in the right places so i rly dont know where is problem.

I would be thankfull for some help :)

33pwnt33

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: problem with executing
« Reply #1 on: May 11, 2013, 06:45:25 pm »
Hey croux,
There is not a problem at all with your code so there was no need to post it.  I think it is a problem with the linker.  Using Visual Studio myself I never have problems like this but I think instead of
Quote
g++ -o m.exe main.cpp -lsfml-graphics -lsfml-window -lsfml-system
you should try:


g++ -o m.exe main.cpp -lsfml-graphics.lib -lsfml-window.lib -lsfml-system.lib.


It is just I guess but give it a shot.

By the way you don't need sfml-system
« Last Edit: May 11, 2013, 06:50:33 pm by 33pwnt33 »

33pwnt33

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: problem with executing
« Reply #2 on: May 11, 2013, 06:48:09 pm »
Here is an example of what the code looks like.

[attachment deleted by admin]

croux

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: problem with executing
« Reply #3 on: May 11, 2013, 07:46:22 pm »
i know, the code is from tutorial so the problem is not with code. Recently I ve just tryed SFML 1.6 and it works, so i think there is problem somewhere between mingw and sfml 2.0 .