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

Author Topic: Problems building "Using CEGUI In SFML" tutorial c  (Read 13975 times)

0 Members and 1 Guest are viewing this topic.

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #15 on: December 16, 2008, 05:48:24 am »
Problem solved!

As it turns out, you were right about it being a problem of using a wrong file version, bullno1. I completely forgot where I had gotten the SILLY.dll file in the program folder from: The tutorial project..  :oops: As soon as I exchanged that for the one that came with the SDK, the program could start just fine. ...Sorry about that.

On the plus side, I now have CEGUI, and I really did learn something new. :)

Thanks to bullno1 and Laurent for helping! :D

I will write up a step-by-step solution, so that anyone using VS 2005 can benefit from the tutorial.


EDIT: Oh, I see you have replied while I was writing this post.
There are probably a bunch of holes in my C++ knowledge, since I have never had a real life, flesh and blood, programming teacher. If there is a particular topic or source of information you think I should study, please do not hold back. I welcome any pointers.

prchakal

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #16 on: December 16, 2008, 02:32:57 pm »
Can you post a tutorial to compile with mingw too ?

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #17 on: December 17, 2008, 12:55:31 pm »
I am afraid not, you see, since there is no CEGUI SDK for mingw, compiling the tutorial files with mingw requires a whole extra step: Compiling CEGUI on mingw.

This is not something I am prepared to venture into...
But if you want to give it a shot, the best place to get help would be at the CEGUI site. Once you have built a working SDK, maybe someone here can help. I dunno.

You could also just give in and join the Borg.. ;)

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #18 on: December 18, 2008, 09:02:41 pm »
OK, so finally the (very) step-by-step guide to getting the CEGUI tutorial going on VS 2005 sp1 is here. Maybe it is too step-by-step, I dunno.

For some reason, I couldn't get the executable running in VMware, so if someone could take a look and see if I am missing something, that would be great. Could be a VM thing, though, since it ran fine outside the VM.

If someone thinks something should be done (or spelled ;) ) differently, I am completely open to suggestions. As I have stated earlier, I am not that experienced, but certainly willing to learn.

Ok, enough talk. Tutorial:


During the first steps we will set up Visual Studio 2005 sp1 to work with CEGUI:

1 )  Download the latest stable release of CEGUI from http://www.cegui.org.uk/. Currently that is version 0.62b. Make sure that you get the “Binary Downloads for Microsoft Visual C++ 8 (2005) - With SP1” . You do not need to download the dependencies package, only the precompiled SDK.


2 )  Extract the contents of the zip archive to a folder on your harddrive. I have chosen to use “C:\libs\” in my example.


3 )  Open Visual Studio and go to “Tools”->”Options”->”Projects and Solutions”->”VC++ Directories”.
Here you will need to add the “\include”, “\dependencies\include”, and “RendererModules\OpenGLGUIRenderer” directories, in the SDK folder, to the list of include directories. In my case, that would be:
Code: [Select]
C:\libs\CEGUI-SDK-0.6.2-vc8\include
C:\libs\CEGUI-SDK-0.6.2-vc8\dependencies\include
C:\libs\CEGUI-SDK-0.6.2-vc8\RendererModules\OpenGLGUIRenderer

 
Next you will need to add the SDK's “\lib” and “\dependencies\lib” directories to the list of directories for library files, and click OK. I added:
Code: [Select]
C:\libs\CEGUI-SDK-0.6.2-vc8\lib
C:\libs\CEGUI-SDK-0.6.2-vc8\dependencies\lib

 

Now the compiler is all set up for CEGUI. In the following steps, we will set up the tutorial project:

4 )  Select “File”->”New”->”Project...”. In the “New Project” dialog, select “Win32 Project”, and name it “sfmlCEGUI”. Click “OK”, then “Next”, and select “Empty project”. Then click “Finish”.


5 )  Go to “Build”->”Configuration Manager” and change the active solution configuration to “Release”.


6 )  Now copy the source and header files from the tutorial project (located in the “src” and “include” folders) to the new project folder. In my case
Code: [Select]
My Documents\Visual Studio 2005\sfmlCEGUI\sfmlCEGUI\
And add them into the project (“Project”->”Add Existing Item...”).


7 )  Next we will need to configure CEGUI for static linking. To do this, go to “Project”->”Properties”->"C/C++" -> "Preprocessor" -> "Preprocessor definitions" and add “CEGUI_STATIC” to the list.


8 )  Now go to “Project”->”Properties”->”Linker”->”Input” and add the following to “Additional Dependencies”:
Code: [Select]
sfml-main.lib sfml-system-s.lib sfml-window-s.lib sfml-graphics-s.lib glu32.lib pcre.lib CEGUIBase_Static.lib CEGUIExpatParser_Static.lib expat.lib CEGUISILLYImageCodec_Static.lib SILLY.lib OpenGLGUIRenderer_Static.lib CEGUIFalagardWRBase_Static.lib winmm.lib OpenGL32.lib freetype.lib


9 )  Finally you can compile the project... Phew. Almost done, but not quite yet..


10 )  Copy the following files from the tutorial project's “bin” folder to the folder where your freshly compiled executable resides:
Code: [Select]
DejaVuSans-10.font
DejaVuSans.ttf
WindowsLook.imageset
WindowsLook.looknfeel
WindowsLook.scheme
WindowsLook.tga
WindowsLookWidgets.scheme



11 )  Then copy SILLY.dll from the SDK's \bin folder, in my case “C:\libs\CEGUI-SDK-0.6.2-vc8\bin”, into the same folder as the previous step.
Do not use the SILLY.dll file from the tutorial folder, it will not be compatible with your executable.

At this point you should be able to run the program.

Now get out those bongos and have a party! You deserve it!

prchakal

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #19 on: December 18, 2008, 09:20:02 pm »
Now need only the tutorial to compile with mingw
ahaha

bullno1

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #20 on: December 19, 2008, 03:19:17 am »
Quote from: "prchakal"
Now need only the tutorial to compile with mingw
ahaha

Mingw and MSVC are just compilers. CEGUI is cross-compiler and cross-platform. You can follow his instruction, just apply it to your compiler.
If you use an IDE like Code::Block or Eclipse, it's even easier, there are settings that are equivalent to Visual Studio.
If you use make, I remembered that -I is to add include directory, -L to add library directory, -l to link library.

Quote
For some reason, I couldn't get the executable running in VMware, so if someone could take a look and see if I am missing something, that would be great. Could be a VM thing, though, since it ran fine outside the VM.

Did you install the redist package of VC8 in your VM?

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #21 on: December 19, 2008, 05:04:52 am »
Quote from: "bullno1"
Did you install the redist package of VC8 in your VM?
Ah, yes, that's the one.. Thanks!
You know, I actually used to use Code::Blocks until I joined the Borg. Still do sometimes.

toglia

  • Newbie
  • *
  • Posts: 8
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #22 on: July 29, 2009, 01:42:12 am »
I have made the sfml cegui tutorial work on vs2008 but my buffer is not cleaning up, so if I move the window I paint like millions of more windows, same happens with the mouse pointer...

EDIT: mWindow.Clear(); was missing...

Alejandro

  • Newbie
  • *
  • Posts: 27
    • View Profile
Problems building "Using CEGUI In SFML" tutorial c
« Reply #23 on: June 21, 2011, 01:39:38 pm »
Sorry for reviving such an old thread, but I would like to post here, since this is the initial thread for problems with CEGUI.

I am using MinGW compiler (Code::Blocks) and trying to make the tutorial work with SFML 2 and CEGUI 0.7.5 since there is a lib package for the compiler I use in this version. After re-reading the thread several times I've managed to get almost all of the compiling/linking errors sorted out but currently I am left with:

Code: [Select]

..\CEGUI-SDK-0.7.5-mingw\dependencies\lib\static\libjpeg.a(jutils.o)||In function `jdiv_round_up':|
C:\Documents and Settings\paul\My Documents\dev\cegui\dependencies\jpeg\jutils.c|127|multiple definition of `jdiv_round_up'|
..\sfml\libsfml-graphics-s.a(jutils.o):jutils.c|| first defined here|
..\CEGUI-SDK-0.7.5-mingw\dependencies\lib\static\libjpeg.a(jutils.o)||In function `jround_up':|
C:\Documents and Settings\paul\My Documents\dev\cegui\dependencies\jpeg\jutils.c|136|multiple definition of `jround_up'|
..\sfml\libsfml-graphics-s.a(jutils.o):jutils.c|| first defined here|
..\CEGUI-SDK-0.7.5-mingw\dependencies\lib\static\libjpeg.a(jutils.o)||In function `jzero_far':|
C:\Documents and Settings\paul\My Documents\dev\cegui\dependencies\jpeg\jutils.c|220|multiple definition of `jzero_far'|
..\sfml\libsfml-graphics-s.a(jutils.o):jutils.c|| first defined here|
..\CEGUI-SDK-0.7.5-mingw\dependencies\lib\static\libjpeg.a(jutils.o)||In function `jcopy_block_row':|
C:\Documents and Settings\paul\My Documents\dev\cegui\dependencies\jpeg\jutils.c|200|multiple definition of `jcopy_block_row'|
..\sfml\libsfml-graphics-s.a(jutils.o):jutils.c|| first defined here|
..\CEGUI-SDK-0.7.5-mingw\dependencies\lib\static\libjpeg.a(jutils.o)||In function `jcopy_sample_rows':|
C:\Documents and Settings\paul\My Documents\dev\cegui\dependencies\jpeg\jutils.c|171|multiple definition of `jcopy_sample_rows'|
..\sfml\libsfml-graphics-s.a(jutils.o):jutils.c|| first defined here|
||=== Build finished: 10 errors, 0 warnings ===|


Basically everybody can understand that this means that there is a conflict between the library for image handling in CEGUI and the compiled ones in SFML.

I would like to know if there is any way to fix this (besides changing the compiler and IDE and/or library releases), as I would really like to use SFML 2 with CEGUI as the other libraries don't seem to offer that much.