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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - GC13

Pages: [1]
1
I have a pretty good idea how that happened (I was a touch confused by the new compiler's habit of opening up files it was mad with), but I've restored Config.hpp from the version held in the .zip. Everything's set up properly now, so that was the last fix I needed.

Thank you for your patience. I hope to have more complicated questions for you in the future.  8)

2
What's the content of the Config.hpp?
The one I can access matches the one it spits out at me when it's complaining about it:
int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

3
What about this? Does this compile if you paste it in the same project?
#include <iostream>
int main() {}
Yeah, that one runs just fine. Lets me add in a "Hello world" and everything.

4
No, I get the error "C:\SFML-2.1\include\SFML\Config.hpp|1|error: 'include' does not name a type|". Then it pulls up a config.hpp that looks like this:
include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

5
I copied it straight from the tutorial. Here's what made its way into my project:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

6
I haven't touched them. I copied the SFML directory out of the zip file and placed it directly into the C drive. It ran its extraction properly as far as I can tell (I'd imagine it would complain about more than just those two files if it didn't try to extract it).

The video tutorial I went to after the text tutorial didn't work has me using these linker options, but the errors are the same without them:
-static-libgcc
-static-libstdc++
-std=c++11

In Linker Settings I'm linking to the -s libraries in the Release section, and the -s-d libraries in the Debug section.

If I have some corrupted headers, does that mean that simply re-downloading the GCC 4.7 MinGW (DW2) - 32 bits version of SFML and placing it in the same filepath should fix the problem?

7
I'm trying to get SFML going on Windows 8 in CodeBlocks. I thought I had everything going nicely, but the test code is spitting fire at me when I try to build. It's certainly an improvement from it complaining about the namespace when I didn't specify a file extension so it defaulted to .c, but now it's complaining about Time.hpp and Export.hpp from System.

It's detected MinGW nicely, and the "GNU GCC Compiler" is my selected and default compiler and has the right path.

Any clue what's going wrong?

mingw32-g++.exe   -IC:\SFML-2.1\include  -c "D:\Chris\My Documents\SFML Test\main.cpp" -o "D:\Chris\My Documents\SFML Test\main.o"
In file included from C:\SFML-2.1\include/SFML/System.hpp:32:0,
                 from C:\SFML-2.1\include/SFML/Window.hpp:32,
                 from C:\SFML-2.1\include/SFML/Graphics.hpp:32,
                 from D:\Chris\My Documents\SFML Test\main.cpp:1:
C:\SFML-2.1\include/SFML/Config.hpp:1:1: error: 'include' does not name a type
 include <SFML/Graphics.hpp>
 ^
In file included from C:\SFML-2.1\include/SFML/System/Export.hpp:31:0,
                 from C:\SFML-2.1\include/SFML/System/Clock.hpp:31,
                 from C:\SFML-2.1\include/SFML/System.hpp:33,
                 from C:\SFML-2.1\include/SFML/Window.hpp:32,
                 from C:\SFML-2.1\include/SFML/Graphics.hpp:32,
                 from D:\Chris\My Documents\SFML Test\main.cpp:1:
C:\SFML-2.1\include/SFML/Config.hpp:1:1: error: 'include' does not name a type
 include <SFML/Graphics.hpp>
 ^
In file included from C:\SFML-2.1\include/SFML/System/Clock.hpp:32:0,
                 from C:\SFML-2.1\include/SFML/System.hpp:33,
                 from C:\SFML-2.1\include/SFML/Window.hpp:32,
                 from C:\SFML-2.1\include/SFML/Graphics.hpp:32,
                 from D:\Chris\My Documents\SFML Test\main.cpp:1:
C:\SFML-2.1\include/SFML/System/Time.hpp:40:23: error: variable 'sf::SFML_API_IMPORT sf::Time' has initializer but incomplete type
 class SFML_SYSTEM_API Time
                       ^
C:\SFML-2.1\include/SFML/System/Time.hpp:40:23: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
C:\SFML-2.1\include/SFML/System/Time.hpp:42:1: error: expected primary-expression before 'public'
 public :
 ^
C:\SFML-2.1\include/SFML/System/Time.hpp:42:1: error: expected '}' before 'public'
C:\SFML-2.1\include/SFML/System/Time.hpp:42:1: error: expected ',' or ';' before 'public'
C:\SFML-2.1\include/SFML/System/Time.hpp:60:23: error: non-member function 'float sf::asSeconds()' cannot have cv-qualifier
     float asSeconds() const;
                       ^
C:\SFML-2.1\include/SFML/System/Time.hpp:70:5: error: 'Int32' does not name a type
     Int32 asMilliseconds() const;
     ^
C:\SFML-2.1\include/SFML/System/Time.hpp:80:5: error: 'Int64' does not name a type
     Int64 asMicroseconds() const;
     ^
C:\SFML-2.1\include/SFML/System/Time.hpp:85:18: error: 'Time' does not name a type
     static const Time Zero; ///< Predefined "zero" time value
                  ^
C:\SFML-2.1\include/SFML/System/Time.hpp:87:1: error: expected unqualified-id before 'private'
 private :
 ^
C:\SFML-2.1\include/SFML/System/Time.hpp:90:5: error: 'friend' used outside of class
     friend SFML_SYSTEM_API Time milliseconds(Int32);
     ^
C:\SFML-2.1\include/SFML/System/Time.hpp:90:33: error: expected initializer before 'milliseconds'
     friend SFML_SYSTEM_API Time milliseconds(Int32);
                                 ^
C:\SFML-2.1\include/SFML/System/Time.hpp:91:5: error: 'friend' used outside of class
     friend SFML_SYSTEM_API Time microseconds(Int64);
     ^
C:\SFML-2.1\include/SFML/System/Time.hpp:91:33: error: expected initializer before 'microseconds'
     friend SFML_SYSTEM_API Time microseconds(Int64);
                                 ^
C:\SFML-2.1\include/SFML/System/Time.hpp:102:19: error: ISO C++ forbids declaration of 'Time' with no type [-fpermissive]
     explicit Time(Int64 microseconds);
                   ^
C:\SFML-2.1\include/SFML/System/Time.hpp:102:19: error: only declarations of constructors can be 'explicit'
C:\SFML-2.1\include/SFML/System/Time.hpp:102:19: error: 'Int64' was not declared in this scope
C:\SFML-2.1\include/SFML/System/Time.hpp:104:1: error: expected unqualified-id before 'private'
 private :
 ^
In file included from C:\SFML-2.1\include/SFML/System/Clock.hpp:31:0,
                 from C:\SFML-2.1\include/SFML/System.hpp:33,
                 from C:\SFML-2.1\include/SFML/Window.hpp:32,
                 from C:\SFML-2.1\include/SFML/Graphics.hpp:32,
                 from D:\Chris\My Documents\SFML Test\main.cpp:1:
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:123:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time seconds(float amount);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:136:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time milliseconds(Int32 amount);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:149:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time microseconds(Int64 amount);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:161:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator ==(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:173:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator !=(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:185:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator <(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:197:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator >(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:209:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator <=(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:221:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API bool operator >=(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:232:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator -(Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:244:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator +(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:256:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator +=(Time& left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:268:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator -(Time left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:280:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator -=(Time& left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:292:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator *(Time left, float right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:304:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator *(Time left, Int64 right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:316:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator *(float left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:328:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator *(Int64 left, Time right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:340:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator *=(Time& left, float right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:352:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator *=(Time& left, Int64 right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:364:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator /(Time left, float right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:376:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time operator /(Time left, Int64 right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:388:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator /=(Time& left, float right);
 ^
C:\SFML-2.1\include/SFML/System/Export.hpp:43:29: error: 'SFML_API_IMPORT' does not name a type
     #define SFML_SYSTEM_API SFML_API_IMPORT
                             ^
C:\SFML-2.1\include/SFML/System/Time.hpp:400:1: note: in expansion of macro 'SFML_SYSTEM_API'
 SFML_SYSTEM_API Time& operator /=(Time& left, Int64 right);
 ^
In file included from C:\SFML-2.1\include/SFML/System/Clock.hpp:32:0,
                 from C:\SFML-2.1\include/SFML/System.hpp:33,
                 from C:\SFML-2.1\include/SFML/Window.hpp:32,
                 from C:\SFML-2.1\include/SFML/Graphics.hpp:32,
                 from D:\Chris\My Documents\SFML Test\main.cpp:1:
C:\SFML-2.1\include/SFML/System/Time.hpp:402:1: error: expected declaration before '}' token
 } // namespace sf
 ^
Process terminated with status 1 (0 minutes, 1 seconds)
44 errors, 1 warnings (0 minutes, 1 seconds)

Pages: [1]