16
General / Re: Wont run on windows 10
« on: November 26, 2015, 08:24:47 pm »
Try running the program from the command window to see if SFML is spitting out any errors as well.
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.
That seems to have got it working (full rebuild) except for the fact that I was relying on C++14, which the version of g++ that came with Ubuntu doesn't support, so I'll have to find out how to update that (EDIT: found out how) and then rebuild the libraries using CMake. Thanks for the information on ldd Spirro. Would it be possible to get the fact that winmm and gdi32 are only necessary on Windows and that all the other libraries have to be linked put into the codeblocks tutorial, seeing as codeblocks is multiplatform so I don't think it's right to make the tutorial only for Windows.winmm and gdi32 ARE Windows only. If you want the tutorial updated for linux you will need to learn how to make a fully working compile on your distribution and submit it for review to one of the maintainers of SFML and see what happens.
sfml-graphics-s;sfml-window-s;sfml-system-s;freetype;jpeg;I believe(booted to windows on the reply.) The one difference is I probably had a mesa lib after sfml-system-s. What would happen here are lots of unresolved references so I would grab the one at the top of the list and search on it. Once I found what library that reference belonged to I would include it by using this page:
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 1.1 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false
Created: version = 0.0 ; depth bits = 24 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false
sfml-graphics requires support for OpenGL 1.1 or greater
Ensure that hardware acceleration is enabled if available
sfml-graphics-s;sfml-window-s;sfml-system-s;OSMesa;GL;freetype;xcb-image;jpeg;udev;pthread;xcb-randr;xcb;X11;X11-xcb
libX11-xcb and a version of Xlib built with XCB support
Firstly, I've been working off those and going over them carefully, I'm fully aware of how precise you have to be. Secondly, I've got rid of gdi and winmm from the linker and that's got rid of those errors, I now have only a single error which is undefined reference to XGetXCBConnection. I've gone back through the libraries that you have to install for Linux and rechecked all the ones to do with XCB and I'm fairly sure I'm not missing any. Any ideas? And thanks everyone for all the help, I know how annoying the constant I can't set it up posts can be.
The XGetXCBConnection function returns the XCB connection associated
with an Xlib Display. Clients can use this XCB connection with
functions from the XCB library, just as they would with an XCB
connection created with XCB. Callers of this function must link to
libX11-xcb and a version of Xlib built with XCB support.
gdi and winmm are Windows only.
Yes I do have the 64 bit install, which I hadn't realised would be a problem. I'll have a look into catfish, and what do you mean by the mesa 32 bit drivers?
I've installed the libraries using cmake and checked and it made all the files and things, but Codeblocks says it can't find -lopengl32 -lwinmm or -lgdi32, and I can't find any of those in the Ubuntu package manager and CMake built it, indicating that I had installed all the necessary libraries. What am I doing wrong?
EDIT: I forgot to say, but I'm linking statically and I built the project in CMake as a Codeblocks- Unix Makefile.
Please post a complete and minimal example that shows the problem. The code you showed doesn't show the transformations you are using so we can't try to reproduce the problem. It might even be a good idea to include the texture you are using.
sf::FloatRect shipBounds;
shipBounds = shipSprite.getLocalBounds();
std::cout << "Ship local bounds size...X: " << shipBounds.width << " Y: " << shipBounds.height << std::endl;
shipBounds = shipSprite.getGlobalBounds();
std::cout << "Ship global bounds size...X: " << shipBounds.width << " Y: " << shipBounds.height << std::endl;
I've just switched from using Windows 10 to using Ubuntu and installed libsfml-dev using the Ubuntu Software Centre. However I'm confused, as the package that is installed contains only header files and when I attempt to link to the libraries in codeblocks, it says it cannot find -lsfml-graphics-s etc. Am I missing something? Do you have to compile the library yourself if you download it from the software centre (option 1 in the tutorial)? Sorry if it's a stupid question.