Compiling TGUI with VS2015
« on: 20 September 2015, 06:52:22 »
I am trying to compile TGUI for Visual Studio 2015 because the version I was using previously seemed to not work for VS2015.  However, I keep getting this error when I try to use CMAKE:

Code: [Select]
SFML found but version too low (requested: 2, found: 1.x.x)
CMake Error at CMakeLists.txt:290 (message):
  CMake couldn't find SFML.  Set the SFML_ROOT entry to SFML's root directory
  (containing "include" and "lib" directories).


Configuring incomplete, errors occurred!
See also "E:/Downloads/TGUI/CMakeFiles/CMakeOutput.log".

I am using SFML 2.3.2.

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #1 on: 20 September 2015, 11:40:35 »
Could you check the value of SFML_INCLUDE_DIR in cmake?
I'm not sure if the value shows up in the cmake gui when finding it fails, so perhaps you should add the following line in TGUI/cmake/Modules/FindSFML.cmake at line 348 where your error is coming from:
Code: [Select]
message(STATUS "SFML_INCLUDE_DIR: ${SFML_INCLUDE_DIR}")
I suspect that folder is going to be a wrong SFML directory. The SFML version will probably be 2.0 or 2.1 instead of 1.x as the error describes, but this has to do with a bug in FindSFML.cmake that was recently (partially) solved in SFML but I haven't copied the new file to TGUI yet.
« Last Edit: 20 September 2015, 11:42:26 by texus »

Re: Compiling TGUI with VS2015
« Reply #2 on: 20 September 2015, 17:47:57 »
The path is "E:/OpenGL/include".  Inside that folder is a folder called SFML, and in that folder are all the SFML header and cpp files.

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #3 on: 20 September 2015, 17:50:23 »
And the Config.hpp file in those headers is the one from SFML 2.3.2 (the version is defined on top of that file)?

Re: Compiling TGUI with VS2015
« Reply #4 on: 20 September 2015, 17:51:39 »
The file says 2.1 (Major version 2, minor 1).

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #5 on: 20 September 2015, 17:54:21 »
Then those header files are from SFML 2.1 and not from 2.3.2. The cmake script is only compatible from sfml 2.2 onwards.
So you should remove these headers (or temporarily move them if you still need them) and let tgui find your sfml 2.3.2 headers.

Re: Compiling TGUI with VS2015
« Reply #6 on: 20 September 2015, 18:25:02 »
OK, it was able to be created with CMake.  However, now when I build in VS2015, I get the following:


Error   LNK1112   module machine type 'x64' conflicts with target machine type 'X86'   tgui   E:\Downloads\TGUI-0.7-alpha1\TGUI-0.7-alpha1\build\src\TGUI\sfml-graphics.lib(sfml-graphics-2.dll)

Any ideas?

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #7 on: 20 September 2015, 18:27:30 »
One or two of the three is build in 32-bit while the other is 64-bit: your project, tgui, sfml
They all have to match, if tgui is the 32-bit one (it builds as 32-bit by default) and you are using 64-bit for everything else then you should check the settings in Visual Studio when you open tgui.sln and see if you can select Win64 somewhere.

Re: Compiling TGUI with VS2015
« Reply #8 on: 20 September 2015, 18:56:34 »
I have x64 SFML and I used that to build TGUI, but I didn't see an option to change TGUI from 32 bit to 64 bit.  I went into Configuration Manager, tried with Win32, and it threw this error.  I changed the Active Solution Platform to a new one, Changed it from ARM to x64, set all the projects to x64, and it still throws the same error. 

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #9 on: 20 September 2015, 18:59:35 »
I actually have no idea how to do it inside VS, I build my libraries from the command line (with a batch script).
I have to recompile TGUI anyway, if you send me your SFML libraries then I'll build TGUI here with those sfml libs.

Re: Compiling TGUI with VS2015
« Reply #10 on: 20 September 2015, 19:16:23 »
Thanks so much!  Yeah, I have no idea why it's not working, because that is how the microsoft website says to set up a project for 64 bit.... 

https://www.dropbox.com/sh/fgs8zt7uq10afsg/AABfr7Ita1VGmAZ_W7mCqMiCa?dl=0

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #11 on: 20 September 2015, 21:11:26 »
Since the Config.hpp in your files states 2.3.1 instead of 2.3.2 I couldn't build it automatically together with the rest so it took a bit longer.

The files can be found here: https://www.dropbox.com/s/87z36lz145pew8c/tgui-alpha2-Win64-VS2015-custom.zip?dl=1

The TGUI version is newer than the tutorials and documentation on my site. The website will be updated in a few hours or in worst case tomorrow. But the only thing you should keep in mind until then is that you have to use setFont instead of setGlobalFont, you probably won't notice any difference.

Re: Compiling TGUI with VS2015
« Reply #12 on: 20 September 2015, 21:47:27 »
Thank you very much for your help!

Re: Compiling TGUI with VS2015
« Reply #13 on: 20 September 2015, 23:04:03 »
Hm... I seem to get 269 errors when I try it with my project.  For example:

Code: [Select]
'load': is not a member of 'tgui::Picture'

but it has methods like askToolTip, so I'm not sure what's going on.  the code worked previously, but I'm not sure what's throwing it off now. 

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Compiling TGUI with VS2015
« Reply #14 on: 20 September 2015, 23:06:32 »
Oh you wanted tgui 0.6? :)
The load function is from tgui 0.6, I gave you libraries and header files for tgui 0.7-alpha2.