SFML community forums

Help => General => Topic started by: croux on May 11, 2013, 06:18:43 pm

Title: problem with executing
Post by: croux 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 (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 :)
Title: Re: problem with executing
Post by: 33pwnt33 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
Title: Re: problem with executing
Post by: 33pwnt33 on May 11, 2013, 06:48:09 pm
Here is an example of what the code looks like.

[attachment deleted by admin]
Title: Re: problem with executing
Post by: croux 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 .