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

Author Topic: I need help  (Read 1088 times)

0 Members and 1 Guest are viewing this topic.

DootMeUp

  • Newbie
  • *
  • Posts: 1
    • View Profile
I need help
« on: November 20, 2018, 09:10:22 pm »
So i have been trying for a week to link sfml to CB.
First i followed this tutorial : https://www.sfml-dev.org/tutorials/2.5/start-cb.php wich resulted in an undefined imp error

my SFML
http://www.sfml-dev.org/download/sfml/2.4.0/
GCC 4.9.2 TDM (SJLJ) - 32-bit

my CB is codeblocks-16.01mingw-nosetup.zip

i have this older version because i  followed this tutorial first: https://en.sfml-dev.org/forums/index.php?topic=20760.0

Then i tried this tutorial: https://en.sfml-dev.org/forums/index.php?topic=17956.0 wich gave the same errors, specified at the bottom. my current libraries are exactly as in this tutorial except for glew wich i had to manually link because it gave the error "cannot find - lglew"

now after all those things it still gives me the following errors:

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

g++.exe -L"D:\sfml 2.4.0\SFML-2.4.0\lib" -o bin\Debug\aaaaaa.exe obj\Debug\main.o   -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-graphics -lsfml-window D:\glew\glew-2.1.0\lib\Release\x64\glew32.lib -lfreetype -lsfml-system -ljpeg -lopengl32 -lgdi32 -lwinmm
obj\Debug\main.o: In function `main':
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:5: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:5: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:5: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:6: undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:7: undefined reference to `_imp___ZN2sf5Color5GreenE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:7: undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:15: undefined reference to `_imp___ZN2sf6Window5closeEv'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:12: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:18: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:18: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:20: undefined reference to `_imp___ZN2sf6Window7displayEv'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:9: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:/Users/Goby/Desktop/code/aaaaaa/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
D:/sfml 2.4.0/SFML-2.4.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
D:/sfml 2.4.0/SFML-2.4.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
D:/sfml 2.4.0/SFML-2.4.0/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 minute(s), 1 second(s))
21 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 
if you need any more information or have any suggestions or solutions please tell me i really want to get sfml working.


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: I need help
« Reply #1 on: November 20, 2018, 09:21:12 pm »
There's a reason every forum post says to follow the official tutorial, because it has all the steps written that need to happen in all situations, the challenge now only lies in reading carefully and understanding it. ;)

You're linking SFML multiple times, once static (with -s suffix) and once dynamic (without -s suffix). Don't do that.
GLEW hasn't been part of SFML for a while now.
You only need to link SFML dependencies when you link statically.
If you link SFML statically, you need to specify SFML_STATIC.

Read the official tutorial again, slowly, step by step and understand what you're doing. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/