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

Author Topic: SFML doesn't want to work...  (Read 6574 times)

0 Members and 1 Guest are viewing this topic.

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML doesn't want to work...
« on: September 14, 2013, 04:47:08 pm »
Hi!, first I'm Spanish so sorry for bad english, and second I made a video for that you can see what I have done (at the end). I had installed all... I have made that:



I unistalled C::B, because it wasn't the minwg version, I donwloaded SFML 2.1 version, I installed minwg-C::B version, I installed CMake, I extracted SFML-2.1.zip on C:/, I put the correct parameters, I ran the app on Build folder, and the app made some new files, I made that bat:

Code: [Select]
@echo off
cd C:/SFML-2.1/Build/
set PATH=%~dp0bin;%PATH%
mingw32-make

I run it, and the bat file give another files (libs files), I had copy the files (of lib folder) on lib folder of my CodeBlocks's MinGw Folder... and I renamed it to SFML, I have put the other folder (includes) into the other include folder, and I renamed it to SFML... and when I do a new project look what happens:



And the logs:

Build Messages:

Quote
||=== abc, Release ===|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|1|SFML/Graphics.hpp: No such file or directory|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp||In function `int main()':|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|5|error: `sf' has not been declared|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|5|error: `RenderWindow' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|5|error: (Each undeclared identifier is reported only once for each function it appears in.)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|5|error: expected `;' before "window"|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|6|error: `sf' has not been declared|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|6|error: `CircleShape' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|6|error: expected `;' before "shape"|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|7|error: `shape' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|7|error: `sf' has not been declared|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|7|error: `Green' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|9|error: `window' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|11|error: `sf' has not been declared|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|11|error: `Event' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|11|error: expected `;' before "event"|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|12|error: `event' undeclared (first use this function)|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|14|error: `sf' has not been declared|
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp|14|error: `Closed' undeclared (first use this function)|
||=== Build finished: 18 errors, 0 warnings (0 minutes, 0 seconds) ===|

Build Log:

Quote
-------------- Build: Release in abc (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions  -O2  -DSFML_STATIC    -I"C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML"  -c "C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp" -o obj\Release\main.o
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:1:29: SFML/Graphics.hpp: No such file or directory
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp: In function `int main()':
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:5: error: `sf' has not been declared
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:5: error: `RenderWindow' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:5: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:5: error: expected `;' before "window"
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:6: error: `sf' has not been declared
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:6: error: `CircleShape' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:6: error: expected `;' before "shape"
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:7: error: `shape' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:7: error: `sf' has not been declared
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:7: error: `Green' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:9: error: `window' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:11: error: `sf' has not been declared
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:11: error: `Event' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:11: error: expected `;' before "event"
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:12: error: `event' undeclared (first use this function)
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:14: error: `sf' has not been declared
C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp:14: error: `Closed' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 0 seconds)
18 errors, 0 warnings (0 minutes, 0 seconds)
 

So... What can I do? :(

Bye!

JuDelCo

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • JuDelCo's Twitter
Re: SFML doesn't want to work...
« Reply #1 on: September 14, 2013, 05:28:49 pm »
I will reply in spanish (If is necesary I can translate it to english but this way is faster for me):

-----------------

Al hacer el #include, creo que has indicado al compilador directamente la carpeta donde se encuentran los headers (en la configuración previa que muestras por video), por lo que no debes de poner "SFML/<header>.hpp", sino tan solo "<header>.hpp". O bien esto o bien haces el include a su carpeta padre (para que la ruta si incluya el SFML).

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML doesn't want to work...
« Reply #2 on: September 14, 2013, 06:12:50 pm »
Quote
I will reply in spanish (If is necesary I can translate it to english but this way is faster for me)

I will do that too...

====

Bueno como dices.. Si llamo al header por #include <Graphics.hpp>, funciona, el problema es que dentro de ese header habra como otros 10 includes que le pasan lo mismo y me da mucho palo tener que estar quitando el SFML de todos los includes...

====

English version:

Well as you say, if I call the header by #include <Graphics.hpp>, it works, but the problema is that inside of that header there are like 10 includes more with the same problem, and I'm too lazy to do that (delete the word SFML of all includes of all headers)...

WaiHak

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: SFML doesn't want to work...
« Reply #3 on: September 14, 2013, 06:15:55 pm »
Es español como tu -.-  8)

Is spanish like you


Soy español

I am spanish

Try with this : http://en.sfml-dev.org/forums/index.php?topic=12581.msg87885#msg87885
« Last Edit: September 14, 2013, 06:22:34 pm by WaiHak »

MeCraniDOS

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML doesn't want to work...
« Reply #4 on: September 14, 2013, 06:19:03 pm »
Es español como tu -.-  8)

Is spanish like you


Soy español

I am spanish

Me too

yo tambien

Prueba con esto http://en.sfml-dev.org/forums/index.php?topic=12581.msg87885#msg87885
« Last Edit: September 14, 2013, 06:22:28 pm by MeCraniDOS »

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML doesn't want to work...
« Reply #5 on: September 14, 2013, 06:25:13 pm »
Bueno mecranidos, he probado tu tutorial como ya me dijistes, pero como te he dicho no me va, he probado haciendo lo mismo que en el video que he pasado y tampoco va, que quieres que haga?

===

Well mecranidos, I tried your tutorial as you say before, but as I said it doesn't work, I have tried doing the same that the video that I had post and it neither works, what want you that I do?

JuDelCo

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • JuDelCo's Twitter
Re: SFML doesn't want to work...
« Reply #6 on: September 14, 2013, 06:46:38 pm »
Lo que te dije yo era que o bien quitabas el SFML/ de todos los headers o bien indicas al compilador que busque los headers en la carpeta padre (no dentro de SFML). ¿Has intentado lo segundo?

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML doesn't want to work...
« Reply #7 on: September 14, 2013, 06:53:40 pm »
Haciendo lo que tu dices deja de saltarme ese dichoso error, pero ahora:

Quote
-------------- Build: Release in abc (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions  -O2  -DSFML_STATIC    -I"C:\Program Files (x86)\CodeBlocks\MinGW\include"  -c "C:\Users\Alvaro\Documents\Aprendiendo C++\abc\main.cpp" -o obj\Release\main.o
mingw32-g++.exe -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML"  -o bin\Release\abc.exe obj\Release\main.o   -s  -lsfml-audio-s -lsfml-graphics-s -lsfml-network-s -lsfml-system-s -lsfml-window-s
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x177):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x192):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x1ae):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x1c1):GLCheck.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x1de):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x1f9):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x215):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x230):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x345):GLCheck.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x6a1):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x6c3):GLCheck.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(GLCheck.cpp.obj)(.text+0x6fb):GLCheck.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x2e5):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x2f8):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x315):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x328):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x345):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x4a9):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x4c5):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x4d5):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x4f2):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x502):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x51f):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x53b):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x54b):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x568):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x578):Texture.cpp: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x595):Texture.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Texture.cpp.obj)(.text+0x5cd):Texture.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x228):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x240):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x483):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x4db):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x532):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x5e3):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x607):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x668):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x6b7):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x6ef):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x707):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xe19):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xe39):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xe55):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xf21):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xf41):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xf5d):Shader.cpp: more undefined references to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)' follow
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0xff7):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x101f):Shader.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x1181):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML/libsfml-graphics-s.a(Shader.cpp.obj)(.text+0x119e):Shader.cpp: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
Process terminated with status 1 (0 minutes, 7 seconds)
50 errors, 0 warnings (0 minutes, 7 seconds)

====

Y si pongo de direcciones

C:\Program Files (x86)\CodeBlocks\MinGW\include\SFML\
C:\Program Files (x86)\CodeBlocks\MinGW\lib\SFML\

Añadiendo esa barra horizontal, me salta esto:



y si le doy que si:

« Last Edit: September 14, 2013, 06:58:24 pm by Ikillnukes »

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
Re: SFML doesn't want to work...
« Reply #8 on: September 14, 2013, 07:33:01 pm »
Igual te ayuda: http://www.foro.lospillaos.es/tutorial-primeros-pasos-para-usar-box2d-con-sfml-i-de-ii-vt13248.html

---------------------------------

Perhaps help you: "url in spanish".
dev@redneboa.es | WordPress | GitHub | YouTube

JuDelCo

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • JuDelCo's Twitter
Re: SFML doesn't want to work...
« Reply #9 on: September 14, 2013, 08:02:09 pm »
El tema es que haciendo lo que te digo yo el error que te da es del Linker (que es un paso posterior al del compilador).

A ver, para crear un ejecutable, hay 2 fases. El Compilador y el Linker.

En la primera fase, el compilador comprueba que no haya errores de sintaxis y genera los archivos objeto (*.o) mediante la compilación de tus archivos fuentes (y sus includes, por lo que deben de estar correctamente referenciados). Aquí es donde te estaba dando el error antes.

En la segunda fase, el Linker coge todos los archivos .o (objeto) y los une en un único archivo ejecutable (.exe en caso de windows) incluyendo adicionalmente las librerías estáticas como es en este caso SFML. Este es el caso de tu segundo error, ya que SFML necesita linkear adicionalmente para funcionar las librerias de STD, las cuales se linkean en el caso de MinGW añadiendo como parámetro ANTES de los otros parámetros de sfml la siguiente cadena:

-lmingw32

Con lo que te quedaría así:

-lmingw32 -lsfml-graphics-s -lsfml-audio-s -lsfml-window-s -lsfml-system-s

Y ya si en un futuro vas a usar OpenGL pues quedaría así:

-lmingw32 -lsfml-graphics-s -lsfml-audio-s -lsfml-window-s -lsfml-system-s -lopengl32 -lglu32

y por último, si vas a ejecutar el binario en un PC que NO tenga MinGW instalado, necesitarás linkear otras librerias adicionales, con lo que finalmente quedaría así:

-lmingw32 -lsfml-graphics-s -lsfml-audio-s -lsfml-window-s -lsfml-system-s -lopengl32 -lglu32 -static-libgcc -static-libstdc++


Saludos

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML doesn't want to work...
« Reply #10 on: September 17, 2013, 05:56:26 pm »
He añadido eso pero el problema perdura... :/

Ikillnukes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML doesn't want to work...
« Reply #11 on: September 18, 2013, 06:13:51 pm »
Ya he arreglado el problema se ve que usaba como compiler Dev-C++ por raro que parezca...

 

anything