[SFML 2.0] Błąd linkera (C::B)
Ostatnio zmodyfikowano 2014-11-18 20:45
Ard123 Temat założony przez niniejszego użytkownika |
[SFML 2.0] Błąd linkera (C::B) » 2014-11-17 21:34:21 Witam. Próbowałem uruchomić testowy program z kursu SFML Test działania biblioteki SFML 2.0 ale pojawia mi się błąd linkera. W tej lekcji został omówiony jednak mimo wszystko nie działa. Kompilator wywala takie błędy ||=== Build: Debug in Kurs SFML 2.0 (compiler: GNU GCC Compiler) ===| obj\Debug\main.o||In function `main':| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|6|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|6|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|6|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|7|undefined reference to `_imp___ZN2sf5ClockC1Ev'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|14|undefined reference to `_imp___ZN2sf6Window5closeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|11|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|17|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|17|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|19|undefined reference to `_imp___ZNK2sf5Clock14getElapsedTimeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|19|undefined reference to `_imp___ZNK2sf4Time9asSecondsEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|19|undefined reference to `_imp___ZNK2sf12RenderWindow7getSizeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|19|undefined reference to `_imp___ZNK2sf12RenderWindow7getSizeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|19|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|20|undefined reference to `_imp___ZNK2sf11CircleShape9getRadiusEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|20|undefined reference to `_imp___ZNK2sf11CircleShape9getRadiusEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|20|undefined reference to `_imp___ZN2sf13Transformable9setOriginERKNS_7Vector2IfEE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|21|undefined reference to `_imp___ZNK2sf12RenderWindow7getSizeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|21|undefined reference to `_imp___ZNK2sf12RenderWindow7getSizeEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|21|undefined reference to `_imp___ZN2sf13Transformable11setPositionEff'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|22|undefined reference to `_imp___ZN2sf5Color6YellowE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|22|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|25|undefined reference to `_imp___ZN2sf6Window7displayEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|8|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|27|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|27|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\main.cpp|27|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'| obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':| D:\CodeBlocks\Projekty\Kurs SFML 2.0\..\..\Biblioteki\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\..\..\Biblioteki\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'| D:\CodeBlocks\Projekty\Kurs SFML 2.0\..\..\Biblioteki\SFML-2.0\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'| ||=== Build failed: 31 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===| Co robię źle? Za pomoc z góry dziękuję. A tak skonfigurowałem linker: |
|
NopeDotAvi |
» 2014-11-17 21:46:39 When linking to multiple SFML libraries, make sure that you link them in the right order, it is very important for gcc. The rule is that libraries that depend on other libraries must be put first in the list. Every SFML library depends on sfml-system, and sfml-graphics also depends on sfml-window. So, the correct order for these three libraries would be: sfml-graphics, sfml-window, sfml-system -- as shown in the screen capture above.
http://www.sfml-dev.org/tutorials/2.0/start-cb.php |
|
Ard123 Temat założony przez niniejszego użytkownika |
» 2014-11-17 22:04:18 Zmieniłem kolejność na taką jaka jest podana na tej stronie i nic, wciąż to samo. Dokładnie te same błędy. |
|
Quirinnos |
» 2014-11-17 22:35:08 http://quirinnos.pl/kurs-sfml-2-1-0-konfiguracja/ zrób sobie krok po kroku. |
|
Ard123 Temat założony przez niniejszego użytkownika |
» 2014-11-18 19:33:41 Niestety. Zrobiłem wszystko dokładnie tak jak było w tym poradniku i nic. Zrobię wszystko od zera. Zainstaluje C::B jeszcze raz i SFML też i zobaczymy. |
|
kisi69 |
» 2014-11-18 19:40:39 A jaka wersja C::B jaka wersje SFML 2.0 pobrales ja mam windows 10 x64 i C::B 13.12 Używam wersji SFML 2.0 GCC 4.7 TDM (SJLJ) - 32 bits
Następnie nowy projekt wybieram SFML i wybieram z tego co pobrałem include i bin czy co to tam się wybierało.
Albo zobacz czy ci na tych linkach poleci sfml-graphics-d sfml-window-d sfml-system-d jak to gdzieś pisało kolejność jest ważna |
|
Ard123 Temat założony przez niniejszego użytkownika |
» 2014-11-18 20:45:35 Zrobiłem wszystko od zera i działa. Jeszcze raz dziękuję za pomoc. :) |
|
« 1 » |