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

Author Topic: Need help getting started with SFML and codeblocks  (Read 3935 times)

0 Members and 2 Guests are viewing this topic.

falcon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Need help getting started with SFML and codeblocks
« on: September 12, 2015, 07:13:44 pm »
I worked my way through the http://www.sfml-dev.org/tutorials/2.3/start-cb.php for installing SFML and tried running the sample code. I get a boat load of errors here:

||=== Build: Debug in DemoSFML (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Code\DemoSFML\main.cpp|5|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'|
C:\Code\DemoSFML\main.cpp|5|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'|
C:\Code\DemoSFML\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'|
C:\Code\DemoSFML\main.cpp|6|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'|
C:\Code\DemoSFML\main.cpp|7|undefined reference to `_imp___ZN2sf5Color5GreenE'|
C:\Code\DemoSFML\main.cpp|7|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'|
C:\Code\DemoSFML\main.cpp|15|undefined reference to `_imp___ZN2sf6Window5closeEv'|
C:\Code\DemoSFML\main.cpp|12|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'|
C:\Code\DemoSFML\main.cpp|18|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'|
C:\Code\DemoSFML\main.cpp|18|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'|
C:\Code\DemoSFML\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'|
C:\Code\DemoSFML\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'|
C:\Code\DemoSFML\main.cpp|20|undefined reference to `_imp___ZN2sf6Window7displayEv'|
C:\Code\DemoSFML\main.cpp|9|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'|
C:\Code\DemoSFML\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Code\DemoSFML\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Code\DemoSFML\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':|
D:\SFML-2.3.2\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
D:\SFML-2.3.2\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
D:\SFML-2.3.2\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'|
||=== Build failed: 20 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Need help getting started with SFML and codeblocks
« Reply #1 on: September 12, 2015, 07:56:42 pm »
The details matter, it's not enough to just look at images. ;)

If you link statically you have to define SFML_STATIC.
If you do not link statically you should not define SFML_STATIC.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

falcon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #2 on: September 12, 2015, 08:04:24 pm »
I have no idea what that means

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #3 on: September 13, 2015, 04:32:37 am »
Preprocesssor definitions. There should be a section somewhere where you can predefine preprocessor things. In Visual Studio its Project Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions. I have no idea where it is in Code::Blocks.

falcon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #4 on: September 13, 2015, 05:10:41 am »
Okay, thanks gambit. I found it, added SFML_STATIC to it and at least I got a console to pop up but I get new errors.

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

Target is up to date.
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in DemoSFML (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\Code\DemoSFML\bin\Debug\DemoSFML.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Code\DemoSFML\bin\Debug\DemoSFML.exe"  (in C:\Code\DemoSFML\.)
Process terminated with status -1073741510 (0 minute(s), 13 second(s))
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Need help getting started with SFML and codeblocks
« Reply #5 on: September 13, 2015, 08:28:31 am »
It means you got a runtime error (aka crash). Do you get any other errors popping up. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

falcon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #6 on: September 13, 2015, 01:26:54 pm »
There is a popup error but it just says: The application was unable to start correctly (0xc000007b). Click OK to close the application.

Satus

  • Guest
Re: Need help getting started with SFML and codeblocks
« Reply #7 on: September 13, 2015, 01:52:17 pm »
Probably you are missing some of the dlll's.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Need help getting started with SFML and codeblocks
« Reply #8 on: September 13, 2015, 04:56:12 pm »
Probably you are missing some of the dlll's.
No.

The application was unable to start correctly (0xc000007b).
You know, if you had just googled the error, you've found a ton of answers already.
IIRC it usually has something to do with mixing x64 and x86 libraries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

falcon

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #9 on: September 14, 2015, 04:23:37 am »


The application was unable to start correctly (0xc000007b).
You know, if you had just googled the error, you've found a ton of answers already.
IIRC it usually has something to do with mixing x64 and x86 libraries.
[/quote]
If you don't have anything useful to say, leave. Go troll some other thread, I don't need you here.

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: Need help getting started with SFML and codeblocks
« Reply #10 on: September 14, 2015, 08:23:09 am »
Actually if you'd listen to what eXpl0it3r had said, you could well have an answer. http://lmgtfy.com/?q=c%2B%2B+0xc000007b+error From googling it, it appears you have the wrong version of the dlls. That error is usually called by the presence of incorrect dlls (64 bit rather than 32) or wrong libraries (again different versions that the linker doesn't pick up on), rather than the lack of dlls.

 

anything