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

Author Topic: SFML 2.0 Class/Member Errors [SOLVED]  (Read 10233 times)

0 Members and 2 Guests are viewing this topic.

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
SFML 2.0 Class/Member Errors [SOLVED]
« on: October 09, 2012, 12:24:36 am »
When trying to compile This piece of code (with MinGW & Code::Blocks)...
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>

int main ( void )
{
    sf::RenderWindow App(sf::VideoMode(600,600,32), "SFML", sf::Style::Default);
    sf::Event AppEvent;

    App.display();

    while(App.isOpen())
    {
        App.display();
        if(App.pollEvent(AppEvent))
        {
            if(AppEvent.type == sf::Event::Closed)
            {
                App.close();
            }
        }
    }
    return 0;
}
I get these errors...
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp||In function `int main()':|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|7|error: `Default' is not a member of `sf::Style'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|10|error: 'class sf::RenderWindow' has no member named 'display'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|13|error: 'class sf::RenderWindow' has no member named 'isOpen'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|15|error: 'class sf::RenderWindow' has no member named 'display'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|16|error: 'class sf::RenderWindow' has no member named 'pollEvent'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|18|error: 'class sf::Event' has no member named 'type'|
C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp|20|error: 'class sf::RenderWindow' has no member named 'close'|
||=== Build finished: 7 errors, 0 warnings ===|
 
So it seems like it recognizes the classes but none of the members, any idea on what I'm doing wrong here?
My linker settings are...
-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s
-static-libgcc
And i Have Defined "SFML_STATIC"
All Libs have been staticly built.

Ive tried reinstalling SFML 2.0 multiple times but still no luck. Could this be a mistake i made in CMake or a problem with my MinGW32 compiler?

Also something I found odd is Code::Blocks will do the auto-fill for the members yet when I try to compile it, Code::Blocks says they aren't members..?
« Last Edit: October 17, 2012, 01:38:15 am by replaceits »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #1 on: October 09, 2012, 12:52:50 am »
Hmmm it's a rather odd thing, so I've got two 'theories' but none of them make sense for all the errors so I just write what could cause the problem:
  • You've somewhere installed SFML 1.6 which still gets found by Code::Blocks and causes the errors since the naming convention has changed.
  • You have -lLIB in the settings of code blocks, although you should only write LIB, e.g. instead of -lsfml-graphics-s just write sfml-graphics-s.

You should follow strictly the official tutorial.

If that didn't help, then you should write, which exact version of MinGW and which exact version of SFML you're using.

Quote
Also something I found odd is Code::Blocks will do the auto-fill for the members yet when I try to compile it, Code::Blocks says they aren't members..?
That's not odd because those are two completely different systems. Code::Blocks searches the header files you specify where as compiling and linking needs to match in multiple areas and can't be vague about anything.
« Last Edit: October 09, 2012, 12:54:49 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #2 on: October 09, 2012, 01:35:43 am »
Ok, I've completely removed SFML 1.6 and changed my linker settings, still didn't fix it.

My versions are:
  • SFML - 2.0-rc-95-g4c04a0c
  • MinGW - 4.6.2
  • Code::Blocks - 10.05

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #3 on: October 09, 2012, 01:50:34 am »
Oh I forgot to request the full building command...

But I still don't really understand what's going on, because I've no problems building with MinGW. :-\
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #4 on: October 09, 2012, 01:56:29 am »
This?

C:\SFML>mingw32-make
Scanning dependencies of target sfml-system
[  1%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.
obj
[  2%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.ob
j
[  3%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.o
bj
[  5%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.
obj
[  6%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.
obj
[  7%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp
.obj
[  9%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp
.obj
[ 10%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLoca
l.cpp.obj
[ 11%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Time.cpp.o
bj
[ 12%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Cloc
kImpl.cpp.obj
[ 14%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Mute
xImpl.cpp.obj
[ 15%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Slee
pImpl.cpp.obj
[ 16%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Thre
adImpl.cpp.obj
[ 18%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/Thre
adLocalImpl.cpp.obj
Linking CXX static library ..\..\..\lib\libsfml-system-s.a
[ 18%] Built target sfml-system
Scanning dependencies of target sfml-window
[ 19%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Context.cp
p.obj
[ 20%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.
cpp.obj
[ 22%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlResource
.cpp.obj
[ 23%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Joystick.c
pp.obj
[ 24%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/JoystickMa
nager.cpp.obj
[ 25%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Keyboard.c
pp.obj
[ 27%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Mouse.cpp.
obj
[ 28%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/VideoMode.
cpp.obj
[ 29%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Window.cpp
.obj
[ 31%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/WindowImpl
.cpp.obj
[ 32%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Win32/WglC
ontext.cpp.obj
[ 33%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Win32/Inpu
tImpl.cpp.obj
[ 35%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Win32/Joys
tickImpl.cpp.obj
[ 36%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Win32/Vide
oModeImpl.cpp.obj
[ 37%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Win32/Wind
owImplWin32.cpp.obj
Linking CXX static library ..\..\..\lib\libsfml-window-s.a
[ 37%] Built target sfml-window
Scanning dependencies of target sfml-network
[ 38%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/Ftp.cpp.
obj
[ 40%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/Http.cpp
.obj
[ 41%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/IpAddres
s.cpp.obj
[ 42%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/Packet.c
pp.obj
[ 44%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/Socket.c
pp.obj
[ 45%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/SocketSe
lector.cpp.obj
[ 46%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/TcpListe
ner.cpp.obj
[ 48%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/TcpSocke
t.cpp.obj
[ 49%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/UdpSocke
t.cpp.obj
[ 50%] Building CXX object src/SFML/Network/CMakeFiles/sfml-network.dir/Win32/So
cketImpl.cpp.obj
Linking CXX static library ..\..\..\lib\libsfml-network-s.a
[ 50%] Built target sfml-network
Scanning dependencies of target sfml-graphics
[ 51%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Color.
cpp.obj
[ 53%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Font.c
pp.obj
[ 54%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/GLChec
k.cpp.obj
[ 55%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Image.
cpp.obj
[ 57%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/ImageL
oader.cpp.obj
[ 58%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
States.cpp.obj
[ 59%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
Texture.cpp.obj
[ 61%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
TextureImpl.cpp.obj
[ 62%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
TextureImplFBO.cpp.obj
[ 63%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
TextureImplDefault.cpp.obj
[ 64%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
Target.cpp.obj
[ 66%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Render
Window.cpp.obj
[ 67%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Shader
.cpp.obj
[ 68%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Shape.
cpp.obj
[ 70%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Circle
Shape.cpp.obj
[ 71%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Rectan
gleShape.cpp.obj
[ 72%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Convex
Shape.cpp.obj
[ 74%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Sprite
.cpp.obj
[ 75%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Text.c
pp.obj
[ 76%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Textur
e.cpp.obj
[ 77%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Textur
eSaver.cpp.obj
[ 79%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Transf
orm.cpp.obj
[ 80%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Transf
ormable.cpp.obj
[ 81%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/View.c
pp.obj
[ 83%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Vertex
.cpp.obj
[ 84%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Vertex
Array.cpp.obj
Linking CXX static library ..\..\..\lib\libsfml-graphics-s.a
[ 84%] Built target sfml-graphics
Scanning dependencies of target sfml-audio
[ 85%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/ALCheck.cpp.
obj
[ 87%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/AudioDevice.
cpp.obj
[ 88%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/Listener.cpp
.obj
[ 89%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/Music.cpp.ob
j
[ 90%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/Sound.cpp.ob
j
[ 92%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundBuffer.
cpp.obj
[ 93%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundBufferR
ecorder.cpp.obj
[ 94%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFile.cp
p.obj
[ 96%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundRecorde
r.cpp.obj
[ 97%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundSource.
cpp.obj
[ 98%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundStream.
cpp.obj
Linking CXX static library ..\..\..\lib\libsfml-audio-s.a
[ 98%] Built target sfml-audio
Scanning dependencies of target sfml-main
[100%] Building CXX object src/SFML/Main/CMakeFiles/sfml-main.dir/SFML_Main.cpp.
obj
Linking CXX static library ..\..\..\lib\libsfml-main.a
[100%] Built target sfml-main

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #5 on: October 09, 2012, 02:10:58 am »
What no...

The build command for your application, not when SFML gets build...
You'd find that in the build log, something like this:
g++.exe -Wall  -g -DSFML_STATIC  -std=c++11 -Wall   -I..\..\..\Lib\Install\SFML\include  -c D:\Programming\C++\Test\Support\Main.cpp -o obj\Debug\Main.o
g++.exe -L..\..\..\Lib\Install\SFML\lib  -o bin\Debug\astroid.exe obj\Debug\Main.o    -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d
 
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #6 on: October 09, 2012, 02:56:47 am »
Oh oops my bad!

mingw32-g++.exe -Wall -DSFML_STATIC -O2 -IC:\SFML\include -c C:\Users\replaceits\Desktop\CPPFD\OpenGlTest\Main.cpp -o obj\Release\Main.o

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #7 on: October 09, 2012, 08:09:28 am »
You still have SFML 1.6 (or very old 2.0) headers, and your project still refers to them. That's the only explanation to your problem.
Laurent Gomila - SFML developer

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #8 on: October 12, 2012, 06:12:36 am »
So, I still have not been able to fix this problem. I have been trying for days now and I'm just completely confused on what to do. I have completely uninstalled both 1.6 and 2.0 multiple times and the same problem still persists. I have re-installed sfml 2.0 (I've tried many different versions of 2.0 as well) a good 30-40 times now...
Could Code::Blocks have a cache that's messing this up? I've tried every possible thing and it just doesn't work, has anyone else had this problem? I was very excited about upgrading to 2.0 but it just doesn't seem possible atm.
Any advice? (sorry for bumping I'm just getting so frustrated that I'm losing sleep over this ahah).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #9 on: October 12, 2012, 07:51:49 am »
With Code::Blocks, open a SFML header (right click on <SFML/System.hpp> for example, and choose "open ...", then do the same for <SFML/System/Clock.hpp> for example) and show us the contents of the file.
Laurent Gomila - SFML developer

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #10 on: October 12, 2012, 08:22:08 am »
System.hpp
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
//    you must not claim that you wrote the original software.
//    If you use this software in a product, an acknowledgment
//    in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
//    and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
////////////////////////////////////////////////////////////

#ifndef SFML_SYSTEM_HPP
#define SFML_SYSTEM_HPP

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////

#include <SFML/Config.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/System/Err.hpp>
#include <SFML/System/InputStream.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Sleep.hpp>
#include <SFML/System/String.hpp>
#include <SFML/System/Thread.hpp>
#include <SFML/System/ThreadLocal.hpp>
#include <SFML/System/ThreadLocalPtr.hpp>
#include <SFML/System/Utf.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Vector3.hpp>

#endif // SFML_SYSTEM_HPP

////////////////////////////////////////////////////////////
/// \defgroup system System module
///
////////////////////////////////////////////////////////////
 

System/Clock.hpp
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2012 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
//    you must not claim that you wrote the original software.
//    If you use this software in a product, an acknowledgment
//    in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
//    and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
//
////////////////////////////////////////////////////////////

#ifndef SFML_CLOCK_HPP
#define SFML_CLOCK_HPP

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/System/Export.hpp>
#include <SFML/System/Time.hpp>


namespace sf
{
////////////////////////////////////////////////////////////
/// \brief Utility class that measures the elapsed time
///
////////////////////////////////////////////////////////////
class SFML_SYSTEM_API Clock
{
public :

    ////////////////////////////////////////////////////////////
    /// \brief Default constructor
    ///
    /// The clock starts automatically after being constructed.
    ///
    ////////////////////////////////////////////////////////////
    Clock();

    ////////////////////////////////////////////////////////////
    /// \brief Get the elapsed time
    ///
    /// This function returns the time elapsed since the last call
    /// to restart() (or the construction of the instance if restart()
    /// has not been called).
    ///
    /// \return Time elapsed
    ///
    ////////////////////////////////////////////////////////////
    Time getElapsedTime() const;

    ////////////////////////////////////////////////////////////
    /// \brief Restart the clock
    ///
    /// This function puts the time counter back to zero.
    /// It also returns the time elapsed since the clock was started.
    ///
    /// \return Time elapsed
    ///
    ////////////////////////////////////////////////////////////
    Time restart();

private :

    ////////////////////////////////////////////////////////////
    // Member data
    ////////////////////////////////////////////////////////////
    Time m_startTime; ///< Time of last reset, in microseconds
};

} // namespace sf


#endif // SFML_CLOCK_HPP


////////////////////////////////////////////////////////////
/// \class sf::Clock
/// \ingroup system
///
/// sf::Clock is a lightweight class for measuring time.
///
/// Its provides the most precise time that the underlying
/// OS can achieve (generally microseconds or nanoseconds).
/// It also ensures monotonicity, which means that the returned
/// time can never go backward, even if the system time is
/// changed.
///
/// Usage example:
/// \code
/// sf::Clock clock;
/// ...
/// Time time1 = clock.getElapsedTime();
/// ...
/// Time time2 = clock.restart();
/// \endcode
///
/// The sf::Time value returned by the clock can then be
/// converted to a number of seconds, milliseconds or even
/// microseconds.
///
/// \see sf::Time
///
////////////////////////////////////////////////////////////
 
Also this is the RC version, I've been trying multiple versions yet none have worked.
« Last Edit: October 12, 2012, 08:24:00 am by replaceits »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #11 on: October 12, 2012, 08:39:59 am »
Ok. Now if you write a simple main() with a sf::Clock inside and call clock.restart(), what happens?
Laurent Gomila - SFML developer

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #12 on: October 12, 2012, 11:35:12 pm »
This piece of code...
#include <SFML/System.hpp>

int main ( void )
{
    sf::Clock testclock;

    testclock.restart();

    return 0;
}
 
Gives me these errors...
//Fixed
« Last Edit: October 12, 2012, 11:41:39 pm by replaceits »

replaceits

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #13 on: October 12, 2012, 11:41:08 pm »
Ok nevermind the system header is running fine, but when i try to use a window i get this...
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x803):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x844):Window.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x937):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x963):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x9a0):Window.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0xabe):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0xb8c):Window.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x10e3):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(Window.cpp.obj)(.text+0x117f):Window.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WindowImplWin32.cpp.obj)(.text+0x151f):WindowImplWin32.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WindowImplWin32.cpp.obj)(.text+0x1570):WindowImplWin32.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WindowImplWin32.cpp.obj)(.text+0x17e3):WindowImplWin32.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WindowImplWin32.cpp.obj)(.text+0x1820):WindowImplWin32.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WglContext.cpp.obj)(.text+0xa3d):WglContext.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WglContext.cpp.obj)(.text+0xab7):WglContext.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)'
..\..\..\..\..\Program Files (x86)\CodeBlocks\lib\libsfml-window-s.a(WglContext.cpp.obj)(.text+0xb00):WglContext.cpp: undefined reference to `std::ctype<char>::_M_widen_init() const'
 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 Class/Member Errors
« Reply #14 on: October 12, 2012, 11:56:12 pm »
Are you sure that you compile C++, not C?

And why did your compiler errors suddenly disappear?
Laurent Gomila - SFML developer