NetBeans v6.0 C/C++ and Dependencies from Source

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jan 09, 2008 19:53

Yes, that makes sense. The problem is that this particular file consists of mainly the same pattern over and over for different functions. Weird that it would not work for that particular one which follows the same exact pattern as the others.

So I took another approach.

I had downloaded v2.4.0 and I have now downloaded the nightly-build version. Then I copied the contents of the nightly-build onto the v2.4.0 and that error has disappeared (I did this to reuse ./configure to generate the makefile). I'm getting different errors this time, slowly fixing them one by one, hoping that in the end I can fix the original problem and have Cegui working within Netbeans.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Thu Jan 10, 2008 13:08

Probably possibly nearly there, maybe. Everything compiles but there's an exception with PCRE

Code: Select all

The Editbox named 'TextWindow/Editbox1' had the following bad validation expression set: '.*'.  Additional Information: this version of PCRE is not compiled with PCRE_UTF8 support

Need to rework this dependency. Crossing my fingers.

ToBeDeleted wrote:In order process UTF-8 strings, you must build PCRE to include UTF-8 support in the code, and, in addition, you must call pcre_compile() with the PCRE_UTF8 option flag. When you do this, both the pattern and any subject strings that are matched against it are treated as UTF-8 strings instead of just strings of bytes.

To build PCRE with support for UTF-8 character strings, add

--enable-utf8

to the configure command.


However if it does function there's still a lot of work cleaning up the mess I've made. Lots of little things are not done properly.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Tue Jan 22, 2008 13:29

I wonder how those dependencies were created in the past. Those for windows are easy enough, simply start Visual Studio and load the .sln solution. But what about those for Unix/Linux/Gnu, is it through ./configure && make ?

The other question I have is how to make additional dependencies (glut) be a part of the "first-level" dependencies (freeglut). For some reason the glut functions are not found when linking with freeglut. I must be missing a flag/command, or even a step somewhere.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Jan 22, 2008 19:04

Rackle wrote:I wonder how those dependencies were created in the past. Those for windows are easy enough, simply start Visual Studio and load the .sln solution. But what about those for Unix/Linux/Gnu, is it through ./configure && make ?

I know you're mostly thinking aloud in this thread, though I'll just say that the project never provided prebuild dependency packs for platforms other than Windows.

With regards to how they are built for linux; mostly they come from whichever package repository is used by your distro - in the main this means they are ready built by the people who prepared the distro, excepting some, like Gentoo for example, where everything is build from source locally (this is CE's primary platform btw). If the distro does not contain the package or the ready-built package is missing some option, then yeah, ./configure && make using the source is pretty much how it would be done. Not sure if any of that is helpful.

With regards to your glut/freeglut point, I'm not sure what goes on there - I think it "just works" here.

CE.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Tue Jan 22, 2008 20:07

So far I had tried to build everything from source. I'll look for pre-built binaries for the Cegui dependencies within the Cygwin repository. That may simplify the task.

And yes I do talk out loud to let others know what I'm thinking and I'm thankful for comments. As I've mentioned earlier I'm new to this environment (Gnu, ./configure, makefiles, etc) and may sometimes come to the wrong conclusions.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Feb 06, 2008 01:38

Got Cegui debug to work, from a mix of package and source file. Woohoo!

And by working I mean compiling the core Cegui library and executing all the samples, except TabControl (missing TabControlDemo/TabControl from the .scheme) and Tree (missing DriveIcons.png from the resources).

Next step is to start all over again, from fresh Cegui SVN and library downloads, and going over my messy notes to generate a comprehensive document that works (hopefully it'll work again).

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Feb 06, 2008 13:42

Cool :) I'm glad you pulled it off. I hope still works when you try it from a clean download.

Now I have a question...

I am working on cross-compile support (kind of a pet project from back in 2006). Anyway, I have most of it building how I want, the issue I have is with glut/freeglut.

I wanted to ask how you resolved the issue you were having with freeglut in the end?

Cheers,

CE.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Feb 06, 2008 15:10

I wanted to say "magic" but I'll refrain :lol:

Basically I stopped trying to use "./configure && make" and created a new makefile via Netbeans. Then I modified the .lua to make CEGUISampleHelper to include two additional libraries, to resolve the remaining linker problems. What I would like would be to "merge" those two additional libraries within the freeglut library; this would allow us to simply link with freeglut and not have to add those other two libraries. However I currently lack that knowledge (or maybe it's an impossible task).

I need to verify the usefulness of the preprocessor defines; some may only valid within the Visual Studio environment.

Here are my notes on the freeglut bit:
Compiling Freeglut from source wrote:Freeglut
SVN checkout into the directory: "C:\Programming\Libraries\freeglut"

Cegui Project
Open the menu File > New Project > C/C++ > C/C++ Static Library
* Press the Next button until step 2. Project Name and Location
* Specify the Project Name: "freeglut_static"
* Specify the Project Location: "C:\Programming\Libraries\freeglut\netbeans"

Right click on "Header Files"
* Select "New Logical Folder" and name it "gl"

Right click on "gl"
* Select "Add existing item..."
* add every *.h from within
* "C:\Programming\Libraries\freeglut\include\gl":
* "C:\Programming\Libraries\freeglut\include\src"

Right click on "Source Files" and select "Add existing item..."
* add every *.c from within
* "C:\Programming\Libraries\freeglut\include\src"

Right click on "freeglut_static" and select "Properties..."
* Select the configuration: "Debug"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "_DEBUG FREEGLUT_STATIC _WIN32 _LIB"
* Navigate to Archiver > General
* Verify the Output: "dist/Debug/Cygwin-Windows/libfreeglut_static.a"

Right click on "freeglut_static" and select "Properties..."
* Select the configuration: "Release"
* Navigate to C/C++ > C Compiler > General
* Specify the Include Directories: "../../include"
* Specify the Preprocessor Definitions: "NDEBUG FREEGLUT_STATIC _WIN32 _LIB"
* Navigate to Archiver > General
* Verify the Output: "dist/Release/Cygwin-Windows/libfreeglut_static.a"

Move to dependencies\lib and appropriately rename the static libraries



For CEGUISampleHelper wrote:Copy C:/Programming/Gnu/cygwin/lib/w32api/libwinmm.a to C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib\libwinmm.a
Copy C:/Programming/Gnu/cygwin/lib/w32api/libgdi32.a to C:\Programming\CEGUI\CEGUI_head_netbeans\dependencies\lib\libgdi32.a

Modify C:\Programming\CEGUI\CEGUI_head_netbeans\makefiles\premake\Samples\common\premake.lua
* Add to the section: "if OPENGL_RENDERER and SAMPLES_GL then", below "library("freeglut", "_d")"
* library("winmm", "")
* library("gdi32", "")

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Feb 07, 2008 09:30

Thanks for the info - some of this stuff certainly seems like magic at times :lol:

I'm not entirely sure why I'm seeing some of the issues that I am, though I have gotten to the stage of having a usable sub-set of the system build and then run successfully in wine and also on a 'real' Windows machine. I still have some other things to sort out before I consider what I am doing as 'complete'.

I guess there's probably not many people looking to cross compile CEGUI anyway, but the required changes should also make things easier for people using the mingw compiler in a 'native' environment too (if they want to go the configure and make route).

Even if nobody else wants to do this, I still get a kick out of compiling the system on 64bit linux and having it run on 32bit Windows - but then I'm kind of sad like that :lol:

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Feb 11, 2008 04:58

Made a partial update. Instead of using ./configure I started manually creating projects within Netbeans. This allows me to generate the same static libraries but with the added bonus that I can generate both debug and release libraries, as well as naming those libraries and where to place them (within <cegui>\dependencies\lib).


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests