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

Author Topic: FindSFML for CMAKE  (Read 54863 times)

0 Members and 2 Guests are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #30 on: November 20, 2010, 09:07:02 am »
The static libraries have the -s suffix (sfml-system-s, sfml-window-s, etc.).
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #31 on: November 20, 2010, 05:59:39 pm »
Quote from: "Laurent"
The static libraries have the -s suffix (sfml-system-s, sfml-window-s, etc.).


Not in my folder, they are just normal..... Can you help me outwith the cmake part? I think i have failed there. And i havent been able to test anything for the past 4 days.. :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #32 on: November 20, 2010, 07:22:19 pm »
Quote
Not in my folder, they are just normal.....

So you compiled the dynamic libraries.

Quote
Can you help me outwith the cmake part?

Sure. Tell me exactly what you did, and I'll tell you what's wrong.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #33 on: November 20, 2010, 07:44:11 pm »
Quote from: "Laurent"
Quote
Not in my folder, they are just normal.....

So you compiled the dynamic libraries.

Quote
Can you help me outwith the cmake part?

Sure. Tell me exactly what you did, and I'll tell you what's wrong.


Here
I generated that and got the normla libs. I only used the two things i circled


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #34 on: November 20, 2010, 08:08:09 pm »
Well, what about reading the tutorial first? ;)

PS: you could make your image less large, it makes some of the forum buttons go outside the visible area. We don't need all that empty space.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #35 on: November 20, 2010, 08:21:25 pm »
Quote from: "Laurent"
Well, what about reading the tutorial first? ;)

PS: you could make your image less large, it makes some of the forum buttons go outside the visible area. We don't need all that empty space.


Sorry about the image but where in the tutorial does it say how to build it statically in cmake? Visula studio doesn't give me all the options like you said it would btw

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #36 on: November 20, 2010, 08:23:35 pm »
Quote
where in the tutorial does it say how to build it statically in cmake?

There:
Quote from: "tutorial"
BUILD_SHARED_LIBS
This boolean option controls whether you build the dynamic (shared) libraries of SFML, or the static ones.


Quote
Visula studio doesn't give me all the options like you said it would btw

Where did I say that?
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #37 on: November 20, 2010, 08:29:02 pm »
Quote from: "Laurent"
Quote
where in the tutorial does it say how to build it statically in cmake?

There:
Quote from: "tutorial"
BUILD_SHARED_LIBS
This boolean option controls whether you build the dynamic (shared) libraries of SFML, or the static ones.


Quote
Visula studio doesn't give me all the options like you said it would btw

Where did I say that?


I tried that just now and when i opened up the project it said that only system and main loaded

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #38 on: November 20, 2010, 09:01:40 pm »
Do you mean that other projects contain errors? Which ones?
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #39 on: November 20, 2010, 09:30:03 pm »
Quote from: "Laurent"
Do you mean that other projects contain errors? Which ones?


No i generated the project for sfml and i tried both of the projects and the solution. (ALL_BUILD, INSTALL, and SFML solution) When i tried to open them in visual c++ 2010 it said it could not load these four things and here is the error:

Code: [Select]
C:\SFML\build\src\SFML\Audio\sfml-audio.vcxproj : error  : Unable to read the project file "sfml-audio.vcxproj".
C:\SFML\build\src\SFML\Audio\sfml-audio.vcxproj(112,29): The project file could not be loaded. An error occurred while parsing EntityName. Line 112, position 29.

C:\SFML\build\src\SFML\Graphics\sfml-graphics.vcxproj : error  : Unable to read the project file "sfml-graphics.vcxproj".
C:\SFML\build\src\SFML\Graphics\sfml-graphics.vcxproj(112,29): The project file could not be loaded. An error occurred while parsing EntityName. Line 112, position 29.

C:\SFML\build\src\SFML\Network\sfml-network.vcxproj : error  : Unable to read the project file "sfml-network.vcxproj".
C:\SFML\build\src\SFML\Network\sfml-network.vcxproj(112,29): The project file could not be loaded. An error occurred while parsing EntityName. Line 112, position 29.

C:\SFML\build\src\SFML\Window\sfml-window.vcxproj : error  : Unable to read the project file "sfml-window.vcxproj".
C:\SFML\build\src\SFML\Window\sfml-window.vcxproj(112,29): The project file could not be loaded. An error occurred while parsing EntityName. Line 112, position 29.


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #40 on: November 20, 2010, 11:02:09 pm »
Do you use the latest revision of SFML? This kind of problem was fixed a few weeks ago.

http://www.sfml-dev.org/forum/viewtopic.php?t=3519
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #41 on: November 21, 2010, 12:01:09 am »
Quote from: "Laurent"
Do you use the latest revision of SFML? This kind of problem was fixed a few weeks ago.

http://www.sfml-dev.org/forum/viewtopic.php?t=3519


Ok I did everything and now when I try to run it in a program i get this:

Code: [Select]
1>------ Build started: Project: Easy_Image_Handler, Configuration: Debug Win32 ------
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (__imp_?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::IsOpened(void)const " (__imp_?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::ContextSettings const &)" (__imp_?Create@Window@sf@@QAEXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUContextSettings@2@@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(void)" (__imp_??0RenderWindow@sf@@QAE@XZ) referenced in function _main
1>C:\Users\kid account\Documents\Visual Studio 2010\Projects\Easy_Image_Handler\Debug\Easy_Image_Handler.exe : fatal error LNK1120: 8 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




I know i missed some stuff but this code should work.
Here is my code:

Code: [Select]
#include <SFML\Graphics.hpp>



int main()
{

sf::RenderWindow App;
App.Create(sf::VideoMode(800,600,8),"Hello");




// Start game loop
    while (App.IsOpened())
    {

App.Clear();
App.Display();
}
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #42 on: November 21, 2010, 12:08:28 am »
Quote
I did that and now its's not building the dll's in vc++

Can you give more details when you have a new error? It's not easy to help you if I have to guess what you did and what happens.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
FindSFML for CMAKE
« Reply #43 on: November 21, 2010, 12:12:49 am »
Quote from: "Laurent"
Quote
I did that and now its's not building the dll's in vc++

Can you give more details when you have a new error? It's not easy to help you if I have to guess what you did and what happens.


Look above at my edited post

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML for CMAKE
« Reply #44 on: November 21, 2010, 12:25:00 am »
You have to define SFML_STATIC to work with static libraries.
Laurent Gomila - SFML developer