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

Author Topic: Can't seem to install SFML  (Read 23316 times)

0 Members and 2 Guests are viewing this topic.

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Can't seem to install SFML
« on: March 15, 2014, 01:37:49 am »
I'm trying to do the tutorial here: http://www.sfml-dev.org/tutorials/2.1/start-cb.php

But when I compile the file, I get these errors:

obj\Debug\main.o||In function `main':|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|5|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|5|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|6|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|7|undefined reference to `_imp___ZN2sf5Color5GreenE'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|7|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|15|undefined reference to `_imp___ZN2sf6Window5closeEv'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|12|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|18|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|18|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|20|undefined reference to `_imp___ZN2sf6Window7displayEv'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|9|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
|
obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':|
C:\Users\cocon_000\Desktop\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'
|
C:\Users\cocon_000\Desktop\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\Users\cocon_000\Desktop\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'
|
||=== Build finished: 20 errors, 0 warnings (0 minutes, 1 seconds) ===|
 

I've tried to put the file paths in but I don't have the same GUI as the tut does.

Mine:

I'm using:
SFML - 2.1
Code::Blocks version 12.11
My computer is a Windows 8 SATELLITE C855-S5350

Thanks!
« Last Edit: March 15, 2014, 01:40:09 am by greenleaf800073 »

Cadisol87

  • Full Member
  • ***
  • Posts: 129
  • C++ Programmer
    • View Profile
Re: Can't seem to install SFML
« Reply #1 on: March 15, 2014, 01:52:34 am »
You opened the global compiler settings, not the build options of the project.

Just create an empty project first, and then right-click it and click on Build options. Now you have the same menu as in the tutorial.

Here's a picture:

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #2 on: March 15, 2014, 03:00:15 am »
I removed the ones in the global compiler and I fixed the build settings yet I still come up with the same error .-.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Can't seem to install SFML
« Reply #3 on: March 15, 2014, 09:08:20 am »
It is looking for the import symbols, meaning it can't find the shared libraries.

Please post your full build command (see thread in General Help section).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #4 on: March 15, 2014, 06:23:06 pm »
I have it on full command line, or is that not what you're not talking about?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Can't seem to install SFML
« Reply #5 on: March 15, 2014, 09:11:58 pm »
I mean you should post the full build command, so we see what you're linking etc. - see here.

My guess is, that you linking the static libraries without defining SFML_STATIC.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #6 on: March 15, 2014, 09:30:39 pm »
Yea, I have already full build command, I was copying from build messages, not build log

Here:
-------------- Build: Debug in SFML Tests (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g  -std=c++11 -std=c++0x -std=c++98   -I..\..\SFML-2.1\include  -c "C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -L..\..\SFML-2.1\lib  -o "bin\Debug\SFML Tests.exe" obj\Debug\main.o    
obj\Debug\main.o: In function `main':
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:5: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:5: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:5: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:6: undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:7: undefined reference to `_imp___ZN2sf5Color5GreenE'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:7: undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:15: undefined reference to `_imp___ZN2sf6Window5closeEv'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:12: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:18: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:18: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:20: undefined reference to `_imp___ZN2sf6Window7displayEv'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:9: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'

C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:5: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/cocon_000/Desktop/SFML Projects/SFML Tests/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'

obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests/../../SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'

C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests/../../SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:\Users\cocon_000\Desktop\SFML Projects\SFML Tests/../../SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZN2sf5ShapeD2Ev'

collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
20 errors, 0 warnings (0 minutes, 2 seconds)
 
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Can't seem to install SFML
« Reply #7 on: March 15, 2014, 11:26:59 pm »
The errors get generated because you don't link against any library at all. Please read the tutorial again. ;)

Also you should just specify one -std= and not three different versions of it - I recommend to just use -std=c++11.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #8 on: March 16, 2014, 02:35:50 am »
I've linked all the things .-.?





All that's in here is everything I've modified

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Can't seem to install SFML
« Reply #9 on: March 16, 2014, 02:47:10 am »
You are building a debug build, but yet I from what I see you only linked the libs in release  :P
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #10 on: March 16, 2014, 02:52:57 am »
do I need it in both?

EDIT:

I've already added:

sfml-graphics-d
sfml-window-d
sfml-system-d

into my debug linker settings too...

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Can't seem to install SFML
« Reply #11 on: March 16, 2014, 02:57:08 am »
Are you sure you didn't accidentally add SFML_STATIC to your preprocessor?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #12 on: March 16, 2014, 02:54:28 pm »
I'm sure, there's no SFML_STATIC anywhere

Oropher

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Can't seem to install SFML
« Reply #13 on: March 16, 2014, 03:37:32 pm »
I've had the same errors and been struggling with it.
I don't use codeblock (only the gcc compiler in command window), but I figured out my problem : you must respect a certain order when linking the libraries. The system, then the window, then the graphics if you only use <SFML/Graphics.hpp> in your include. However when in command line, you must specify them in the opposite order (draphics, then window, then system).
So, try inverting the order of your linked libraries in codeblocks (I see you've got little arrows on the right of the window, is that it?)

greenleaf800073

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Can't seem to install SFML
« Reply #14 on: March 16, 2014, 07:01:17 pm »
What is the command line?

 

anything