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

Author Topic: SFML-2.1 - Cannot get it to work  (Read 3996 times)

0 Members and 2 Guests are viewing this topic.

codeman

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML-2.1 - Cannot get it to work
« on: January 21, 2014, 09:59:18 pm »
I've been trying to configure SFML-2.1 for my computer for the past few months (on and off). I have googled solutions for what seems like eternity, and I still cannot find an answer. SFML-2.0 works on my computer (compiled from source code).

System specs:

Sony Electronics Inc. VAIO Computer
Intel(R) Core(TM) i3 CPU   M 350 @ 2.27GHz 2.27 GHz
Installed memory (RAM): 4.00 GB
System type: 64-bit OS

Graphics card:

GeForce 310M
Driver version: 332.21

I have tried installing SFML-2.1 with GCC 4.7 TDM (SJLJ) - 32 bits and compiling through source code. Neither seem to work. Basically, I can compile the code, but a seg fault occurs upon execution. I have set up the search directories for SFML-2.1, and the build options link to the correct libraries (using CodeBlocks w/ MinGW).

I get the same error message each time regardless of the SFML-2.1 version (I have searched solutions for this but no such luck).

"Process terminated with status -1073741819 (0 minutes, 6 seconds)"

Here is sample code which does not work - a seg fault occurs when the first RectangleShape is created:

#include <SFML/Graphics.hpp>

int main(int argc, char **argv)
{
    sf::Event event;
    bool quit = false;
    sf::RectangleShape test;
    sf::RenderWindow window(sf::VideoMode(522, 541), "test");

    while (!quit)
    {
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                quit = true;
        }

        window.clear(sf::Color(210, 210, 210));

        window.display();
    }

    window.close();
}
 

I hope none of what I've posted is vague. If I need to post anything else please let me know.

Thank you for any help!


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: SFML-2.1 - Cannot get it to work
« Reply #1 on: January 22, 2014, 01:19:42 am »
You should post the full build command.

Also I advise you against the use of the TDM compiler to various issues, especially the GCC 4.7.1 version, since that's already outdated. Instead I suggest you take a MinGW Builds version - though you'll have to rebuild from source with that one. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

codeman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML-2.1 - Cannot get it to work
« Reply #2 on: January 22, 2014, 06:44:10 pm »
Thanks for the response eXpl0it3r. I should have explained the situation a bit better. The reason I want to use the TDM version is because I am working on a group project, and having separate dlls requires separate compilation and switching out dlls after updating the repository. It would be nice for us to all have the same version (not machine specific) - all of my group members have gotten the TDM version to work except me.

Anyways, here is the build log from building the project:

-------------- Clean: Debug in CodyTest (compiler: GNU GCC Compiler)---------------

Cleaned "CodyTest - Debug"

-------------- Build: Debug in CodyTest (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g    -IC:\SFML-2.1\include  -c "C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -LC:\SFML-2.1\lib  -o bin\Debug\CodyTest.exe obj\Debug\main.o    -lsfml-graphics-d -lsfml-audio-d -lsfml-system-d -lsfml-window-d -lsfml-network-d
Output size is 103.66 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings (0 minutes, 1 seconds)
 

And after trying to run:

Checking for existence: C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\bin\Debug\CodyTest.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\bin\Debug\CodyTest.exe"  (in C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\.)
Process terminated with status -1073741819 (0 minutes, 5 seconds)
 

Hope that helps.


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
AW: SFML-2.1 - Cannot get it to work
« Reply #3 on: January 23, 2014, 07:52:12 am »
sfml-windoe depends on sfml-systen, thus it needs to be put in front of sfml-system. ;)
Same goes for sfml-network.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
Re: SFML-2.1 - Cannot get it to work
« Reply #4 on: January 23, 2014, 08:07:18 am »
link your libraries like this:
-lsfml-audio -lsfml-network -lsfml-graphics -lsfml-window -lsfml-system
and everything must work fine
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

codeman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML-2.1 - Cannot get it to work
« Reply #5 on: January 23, 2014, 10:39:40 pm »
I've changed my linkage to the one above and it is still not working. :(

Build log:


-------------- Clean: Debug in CodyTest (compiler: GNU GCC Compiler)---------------

Cleaned "CodyTest - Debug"

-------------- Build: Debug in CodyTest (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g    -IC:\SFML-2.1\include  -c "C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -LC:\SFML-2.1\lib  -o bin\Debug\CodyTest.exe obj\Debug\main.o    -lsfml-audio-d -lsfml-network-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
Output size is 103.66 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
 

After trying to run:
Checking for existence: C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\bin\Debug\CodyTest.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\bin\Debug\CodyTest.exe"  (in C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\.)
Process terminated with status -1073741819 (0 minutes, 5 seconds)
 

I don't feel like I am forgetting to do anything... If it helps, any time I run the debugger it will seg fault when trying to do any SFML specific task.

Here's a debug log after stepping into making the RectangleShape 'test':

Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\
Adding source dir: C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\
Adding file: C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\bin\Debug\CodyTest.exe
Changing directory to: C:/Users/Cody/Desktop/SENIOR~1/SOMETH~1/CodyTest/.
Set variable: PATH=.;C:\MinGW\bin;C:\MinGW;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Vim\vim73;C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\foxe;C:\Program Files\MySQL\MySQL Server 5.6\bin;C:\Program Files (x86)\cmake\bin;C:\Python33;C:\Program Files (x86)\Git\cmd;C:\Python27;C:\Program Files (x86)\GIMP-2.0\bin;C:\Program Files (x86)\Sublime Text 2;C:\Program Files (x86)\CodeBlocks\MinGW\bin
Starting debugger: C:\Program Files (x86)\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/Cody/Desktop/SENIOR~1/SOMETH~1/CodyTest/bin/Debug/CodyTest.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 6472
At C:\Users\Cody\Desktop\Senior Design\something-intelligent\CodyTest\main.cpp:7
At C:\SFML-2.1\include\SFML\System\Vector2.inl:40
At C:\SFML-2.1\include\SFML\System\Vector2.inl:43
At C:\SFML-2.1\src\SFML\Graphics\RectangleShape.cpp:35
At C:\SFML-2.1\src\SFML\Graphics\Shape.cpp:169
At C:\SFML-2.1\include\SFML\Graphics\Drawable.hpp:44
Program received signal SIGSEGV, Segmentation fault.
At C:\SFML-2.1\include\SFML\Graphics\Drawable.hpp:44
 

Thanks again for the help.

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
Re: SFML-2.1 - Cannot get it to work
« Reply #6 on: January 24, 2014, 08:31:35 am »
do you have the same problem in SFML 2.0?
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

codeman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML-2.1 - Cannot get it to work
« Reply #7 on: January 24, 2014, 08:55:08 pm »
I have been able to compile SFML 2.0 from source, but the TDM 32 bit version I'm still having the same problems.

codeman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML-2.1 - Cannot get it to work
« Reply #8 on: February 08, 2014, 06:06:49 am »
Just an update - never figured out the actual problem. However, I created a new user in Windows and tried running SFML 2.1, and it magically worked! So there must have been some user setting that was not allowing 2.1 to work on my normal account.

;P

 

anything