Sign in to follow this  
nickme

SFML:can not find climits

Recommended Posts

hi

i just downloaded SFML into VC++ 2010 express. it compiler ok, but it can not linked. it generate the following error:

1>------ Build started: Project: SFML_test, Configuration: Debug Win32 ------
1> window-events.cpp
1>c:\users\rob\documents\sfml-1.6\include\sfml\config.hpp(122): fatal error C1083: Cannot open include file: 'climits': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

when i checked the VC include folder,i found the file was there. when i add SFML directory name to climits to folder, the next error became cannot find yvals.h. i dont want to change the header files. what is wrong with with SFML? is it something that in my VC setup that was wrong?

thank you.

Share this post


Link to post
Share on other sites
Compile SFML can be a bit of a bitch. IF they provide VS2010 binaries, it would prevent so many problems. If you like, I made the libraries compiled for [url="http://gamefromscratch.com/post/2011/08/12/Adventures-in-CPP.aspx"]VS2k10 available here[/url] along with a bit of detail about the troubles encountered.

Otherwise, this [url="http://www.youtube.com/watch?v=-uHGZGgMETg&feature=related"]video tutorial[/url] goes through the process in details.

In short, delete all the non-essential files and demos and try compiling again. There are also so macros you may need to define, depending how you are compiling.

Share this post


Link to post
Share on other sites
also be sure you have linked the different lib files in the right order. I use codeblocks so it might be different. You need to link in this order:

System->Window->Graphics-> the rest in any order...

Share this post


Link to post
Share on other sites
hi
i got an error again. this time it said that the IDE cannot find 'windows.h'. but when i load my other programs, and include <windows.h>, the IDE recognized it. here is my code:

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hPP>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
// Create the main window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Events");

// Get a reference to the input manager associated to our window, and store it for later use
const sf::Input& Input = App.GetInput();

// Start main loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();

// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}

// Get some useless input states, just to illustrate the tutorial
bool LeftKeyDown = Input.IsKeyDown(sf::Key::Left);
bool RightButtonDown = Input.IsMouseButtonDown(sf::Mouse::Right);
bool JoyButton1Down = Input.IsJoystickButtonDown(0, 1);
unsigned int MouseX = Input.GetMouseX();
unsigned int MouseY = Input.GetMouseY();
int JoystickX = Input.GetJoystickAxis(1, sf::Joy::AxisZ);
int JoystickY = Input.GetJoystickAxis(1, sf::Joy::AxisY);
int JoystickPOV = Input.GetJoystickAxis(1, sf::Joy::AxisPOV);

// Display window on screen
App.Display();
}

return EXIT_SUCCESS;
}

and the error out put is:

1>------ Build started: Project: SFML_test, Configuration: Debug Win32 ------
1> window-events.cpp
1>c:\users\rob\documents\sfml-1.6\include\sfml\system\win32\mutex.hpp(32): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

thanks

Share this post


Link to post
Share on other sites
hi,

the file now compiled and ran just fine. thanks.

but when i tried to compile a tutorial from :http://redkiing.wordpress.com/2009/08/20/your-first-sfml-game-part-i-introduction/, it has the following errors:

1>------ Build started: Project: 4ROLL, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\rob\devc++ source\sfml\fourinarow-src\fourinarow\board.h(54): error C2146: syntax error : missing ';' before identifier 'boardColor'
1>c:\users\rob\devc++ source\sfml\fourinarow-src\fourinarow\board.h(54): error C2602: 'sf::Color::{ctor}' is not a member of a base class of 'Board'
1> c:\users\rob\devc++ source\sfml\fourinarow-src\fourinarow\board.h(35) : see declaration of 'Board'
1>c:\users\rob\devc++ source\sfml\fourinarow-src\fourinarow\board.h(54): fatal error C1903: unable to recover from previous error(s); stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

when i compiled the program in code::block, it worked just fine. i cannot understand why.

thank for your reply.

Share this post


Link to post
Share on other sites
From the looks of things, you are missing a semicolon. Check all of your class/structs and make sure they end with };

Share this post


Link to post
Share on other sites
HI

thank you all for your reply. i get i to work in all the program now. apparently i had to reset all the lib and include files to the project property for every project. \

bye

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this