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

Author Topic: Trying my very best to link SFML 2.1 + Ecliipse C++ IDE , a first time  (Read 1501 times)

0 Members and 1 Guest are viewing this topic.

S_BISHOP

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Hello I've spent a good number hours trying to successfully link the SFML API with Eclipse C++ IDE.
As of now I have very little experience working with 3rd partie API,s.

although no red error lines are present in the program, and I can make reference to the sf:: namespace to access the various headers and such.
However I get this following error during the complication of the program.

(I believe the MinGW compiler is up and running because I can compile and run a bare bones C++ program, so I don't think that's a problem.)

complication error:

   18:55:35 **** Incremental Build of configuration Debug for project GameEngine ****
   Info: Internal Builder is used for build
   g++ "-IC:\\SFML-2.1-windows-gcc-4.7-mingw-32bits\\SFML-2.1\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o GameRun.o "..\\GameRun.cpp"
   In file included from C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\include/SFML/Window.hpp:32:0,
                    from C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\include/SFML/Graphics.hpp:32,
                    from ..\GameRun.cpp:11:
   C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\include/SFML/System.hpp:35:39: fatal error: SFML/System/InputStream.hpp: No such file or directory
    #include <SFML/System/InputStream.hpp>
                                       ^
   compilation terminated.
   
   18:55:40 Build Finished (took 4s.979ms)




This is the location of my set work space:             C:\Users\xxxxx\Documents\EclipseC++Workspace




These are the steps I've taken:
 

 (1). Downloaded this:   
                             GCC 4.7 MinGW (DW2) - 32 bits, installed it at root of C: drive top level
                             (ran the SDK Manger like window to install the various packages or what it may be referred to as)
 
 (2). linked the include and lib files respectively, in the project properties as follows:
   
      C/C++ Build > Settings > GCC C++ Compiler > includes:      
                             C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\include
      C/C++ Build > Settings > MinGW C++ Linker > libraries:
                             lsfml-graphics
                             lsfml-window
                             lsfml-system
      C/C++ Build > Settings > MinGW C++ Linker > libraries Search Path:
                                 C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\lib

 (3). included these (where the sf namespace is required as reference):
                             #include <SFML/Graphics.hpp>
                             #include <SFML/Window.hpp>
                             #include <SFML/System.hpp>



  This what the file structures look like:
                             C:\SFML-2.1-windows-gcc-4.7-mingw-32bits\SFML-2.1\lib

                             libsfml-graphics
                             libsfml-graphics-d.a
                             libsfml-graphics-s.a
                             libsfml-graphics-s-d.a

                             .. and so on for Window and System.



If anyone can provide good constructive feedback or suggestions it will be much appreciated.
I just need to know how to do this once and then its just repetition after that.

                            

 
« Last Edit: August 07, 2014, 02:43:22 pm by S_BISHOP »

Codespear

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Trying my very best to link SFML 2.1 + Ecliipse C++ IDE , a first time
« Reply #1 on: August 09, 2014, 09:54:01 am »
What happens if you try this from the command prompt (running from the Debug folder):

g++ "-IC:\\SFML-2.1-windows-gcc-4.7-mingw-32bits\\SFML-2.1\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o GameRun.o "..\\GameRun.cpp"

If this does not work it is not an eclipse configuration issue.

This won't help, but I think you should also consider adding -std=c++0x to the compiler options.


 

anything