Compiling CEGUI under MacOS X

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Compiling CEGUI under MacOS X

Postby renchap » Sun Mar 06, 2005 11:44

First, sorry if my english isn't very good :D

The current xcode project isn't valid (lot of internal xcode errors, ...), so i have tried to made a new project.
It can be downloaded here : http://www.renchap.com/CrazyEddiesGUI.zip

You must have the XercesC Framework in /Library/Frameworks, and X11 and the X11 SDK installed

You must also change the path to xerces source code in the target CrazyEddiesGUI


After that, the source must be a little changed :

- CEGUIFactoryModule.h, line 31, add

Code: Select all

#if defined(__APPLE_CC__)
# include "macPlugins.h"
#endif


- CEGUIDataContainer.h, line 31, replace

Code: Select all

#include <malloc.h>

with

Code: Select all

#if defined( __APPLE__ )
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif


- In CEGUIFont.cpp, line 511, replace

Code: Select all

case FT_PIXEL_MODE_GRAY:

by

Code: Select all

#if defined( __APPLE__ ) /* Needed to use apple x11 freetype headers */
case ft_pixel_mode_grays:
#else
case FT_PIXEL_MODE_GRAY:
#endif

and

Code: Select all

case FT_PIXEL_MODE_MONO:

by

Code: Select all

#if defined( __APPLE__ ) /* Needed to use apple x11 freetype headers */
case ft_pixel_mode_mono:
#else
case FT_PIXEL_MODE_MONO:
#endif


To compile the open gl renderer, put IL.frameworks into /Library/Frameworks
You can take it from Ogre, here : http://sourceforge.net/project/showfile ... _id=307256

I haven't yet compiled ogre, so i cant truc the ogre renderer, but i will do it soon

i hope that it will helps you :)

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

Re: Compiling CEGUI under MacOS X

Postby CrazyEddie » Sun Mar 06, 2005 13:06

Exsortis maintains the Mac OS X build, I assume the current set up works for him ;) Also, I am aware that some Ogre users have compiled on a Mac with no issues reported.

Aside from this, my comments on the above are that I would not be happy with, do not want, and nor will I have such a load of pre-processor conditionals spread throughout the code; it should not be required, I'd rather dump Mac support completely before I put crap like that in the main library code :) (Perhaps there is some problem with the Freetype version you have?).

CE.

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Sun Mar 06, 2005 13:34

i have the freetype version that is included with apple x11
but with the fink installed version, that works fine

and i have a lot of internal errors in xcode with the cvs project, as :

Code: Select all

File:   /SourceCache/DevToolsBase/DevToolsBase-387/pbxcore/Target.subproj/PBXBuildSettingExpansion.m
Line:   237
Function:   PBXFindFirstMacroReferenceInRangeOfCFString

Assertion failed: macroNameRange.length >= 1


Code: Select all

File:   /SourceCache/DevToolsBase/DevToolsBase-387/pbxcore/Target.subproj/PBXBuildSettingExpansion.m
Line:   412
Function:   PBXExpandMacroReferencesInCFString

Assertion failed: CFRangeMin(macroNameRange) < CFRangeMax(macroNameRange)


Code: Select all

File:   /SourceCache/DevToolsBase/DevToolsBase-387/pbxcore/Target.subproj/PBXDependencyNodeAction.m
Line:   291
Object:   <PBXDependencyNodeAction:0x04326a40>
Method:   addEnvironmentValue:forKey:

key should be a non-empty string, but it's an empty string


and i am not skilled in c++ (or c :p) so i have do these changes because i dont know how to do :)

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

Re: Compiling CEGUI under MacOS X

Postby CrazyEddie » Sun Mar 06, 2005 15:53

Thanks for the extra information, I'll now leave it to Exsortis to decide what action needs to be taken.

CE.

User avatar
Exsortis
CEGUI Team (Retired)
Posts: 42
Joined: Mon Feb 07, 2005 17:13
Location: Palmdale, CA
Contact:

Re: Compiling CEGUI under MacOS X

Postby Exsortis » Tue Mar 08, 2005 14:21

I don't have time to look at this right now (new job with long hours :cry: ), but I'll take a closer look later this week.

Off the top of my head, what version of Xcode are you using? The internal errors you're receiving from Xcode are more indicative of a broken build system on your machine. As far as the code changes, those are totally unnecessary. Also, what release of CEGUI are you trying to compile, CVS HEAD, 0.2.0 from tarball, etc.? Those bits of info would be useful.

Thanks.

-E

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Sat Mar 12, 2005 15:19

i have xcode 1.5 :

Code: Select all

Component versions
Xcode IDE: 389.0
Xcode Core: 387.0
ToolSupport: 372.0

with mac os x 10.3.8

i try to compile last head cvs, but the 0.2.0 tarball have this errors too.

in your project, there is some paths that are relative, so there is some errors. and in freetype headers, i have ft_pixel_mode_mono and not FT_PIXEL_MODE_MONO

User avatar
Exsortis
CEGUI Team (Retired)
Posts: 42
Joined: Mon Feb 07, 2005 17:13
Location: Palmdale, CA
Contact:

Re: Compiling CEGUI under MacOS X

Postby Exsortis » Sun Mar 13, 2005 22:23

renchap wrote:
i have xcode 1.5 :

Code: Select all

Component versions
Xcode IDE: 389.0
Xcode Core: 387.0
ToolSupport: 372.0

with mac os x 10.3.8

i try to compile last head cvs, but the 0.2.0 tarball have this errors too.

The Xcode project in HEAD hasn't been updated yet. 0.2.0 from CVS compiles just fine. I haven't built from the tarball.

in your project, there is some paths that are relative, so there is some errors.

Relative paths are there on purpose and necessary for some things so that you don't have to fix the paths in the project every time you update it. Standard libraries are usually the only items in the project with absolute paths.

Please provide a list of the items that have relative paths and the errors that are being caused by them, and I'll fix them if necessary.

and in freetype headers, i have ft_pixel_mode_mono and not FT_PIXEL_MODE_MONO

The freetype header at /usr/X11R6/include/freetype2/freetype/ftimage.h contains:

Code: Select all

  typedef enum  FT_Pixel_Mode_
  {
    FT_PIXEL_MODE_NONE = 0,
    FT_PIXEL_MODE_MONO,
    FT_PIXEL_MODE_GRAY,
    FT_PIXEL_MODE_GRAY2,
    FT_PIXEL_MODE_GRAY4,
    FT_PIXEL_MODE_LCD,
    FT_PIXEL_MODE_LCD_V,

    FT_PIXEL_MODE_MAX      /* do not remove */

  } FT_Pixel_Mode;

and:

Code: Select all

#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE
#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO
#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY
#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4


So, I'd say your freetype header is borked.

-E

User avatar
crownedwombat
Just popping in
Just popping in
Posts: 1
Joined: Tue Apr 19, 2005 10:46

Re: Compiling CEGUI under MacOS X

Postby crownedwombat » Tue Apr 19, 2005 11:12

Hello everyone,

I have just the same problem, as for the freetype headers. It is a brand-new, freshly installed freetype lib from the Apple X11 SDK. I'm quite sure that I didn't even have the chance to mess up my freetype headers, leaving all as it came from Apple's distribution.

ftimage.h does _NOT_ contain any uppercase defs. Just this:

Code: Select all

typedef enum  FT_Pixel_Mode_
  {
    ft_pixel_mode_none = 0,
    ft_pixel_mode_mono,
    ft_pixel_mode_grays,
    ft_pixel_mode_pal2,
    ft_pixel_mode_pal4,
    ft_pixel_mode_pal8,
    ft_pixel_mode_rgb15,
    ft_pixel_mode_rgb16,
    ft_pixel_mode_rgb24,
    ft_pixel_mode_rgb32,

    ft_pixel_mode_max      /* do not remove */

  } FT_Pixel_Mode;


There are no other defines of the ft_pixel_mode_xxx in the file.

The infos you give on the ftimage.h are true for the version that is included in a freetype.framework that I got somewhere from the OGRE forums.

In addition, IMHO, it's not very clean to ship a XCode.project using something named Xerces.framework which isn't the one you build with Apache Xerces.

Wouldn't it be better to offer the freetype.framework for download along with the modified Xerces.framework you use?
For me copying Xerces src folder to a Headers dir in the framework did the job (I didn't take the time to strip off the .c and .cpp files, but a shell script should do..).

Also, there is a minor flaw in the XCode file itself, the CEGUIGlobalEventSet.cpp and .h being registered with their absolute path on the author's Mac.

Anyway, absolutely no offense intended. Great project, this is, many thanks.

Cheers,

crownedwombat

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Sun Apr 24, 2005 21:05

ok, the head cvs works fine with tiger
but i have 4 compilation errors with the opengl renderer :

Code: Select all

Native Build of Target "OpenGLRenderer" using Build Style "Deployment"

CompileC build/CrazyEddiesGUI.build/OpenGLRenderer.build/Objects-normal/ppc/openglrenderer.o ../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp normal ppc c++ com.apple.compilers.gcc.4_0
    cd /Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI
    /usr/bin/gcc-4.0 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -Os -fmessage-length=0 -mtune=G4
-I/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build/CrazyEddiesGUI.build/OpenGLRenderer.build/OpenGLRenderer.hmap
-Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build
-I/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build/include -I/Library/Frameworks/Ogre.framework/Headers
-I/Library/Frameworks/Xerces.framework/Headers -I../../../../include
-I/usr/include/malloc -I/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build/CrazyEddiesGUI.build/OpenGLRenderer.build/DerivedSources
-include /Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build/CrazyEddiesGUI.build/SharedCaches/Carbon-asimfrttkdtobhaflhgnpintqtfr/Carbon.h -c /Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp
-o /Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/build/CrazyEddiesGUI.build/OpenGLRenderer.build/Objects-normal/ppc/openglrenderer.o
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp: In constructor `CEGUI::OpenGLRenderer::OpenGLRenderer(CEGUI::uint)':
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp:55: error: invalid conversion from 'int*' to 'GLint*'
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp:55: error:   initializing argument 2 of 'void glGetIntegerv(GLenum, GLint*)'
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp: In constructor `CEGUI::OpenGLRenderer::OpenGLRenderer(CEGUI::uint, int, int)':
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp:72: error: invalid conversion from 'int*' to 'GLint*'
/Users/renchap/Dev/cegui_mk2/makefiles/mac/Xcode/CrazyEddiesGUI/../../../../src/renderers/OpenGLGUIRenderer/openglrenderer.cpp:72: error:   initializing argument 2 of 'void glGetIntegerv(GLenum, GLint*)'


And 2 files are with an absolute path :
CEGUIXercesParser.cpp and CEGUIXMLParser.cpp

User avatar
Exsortis
CEGUI Team (Retired)
Posts: 42
Joined: Mon Feb 07, 2005 17:13
Location: Palmdale, CA
Contact:

Re: Compiling CEGUI under MacOS X

Postby Exsortis » Mon Apr 25, 2005 14:29

Well, I don't have my copy of Tiger yet, so you'll have to wait until at least this weekend. As for the GL renderer error, I can only venture a guess right now that either Apple has changed their GL headers, or gcc 4.0 is busted (which wouldn't be a big shocker :shock: ).

I'll fix the absolute paths in the project. Sorry, thought I'd caught all of those. :oops:

-E

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Sat Apr 30, 2005 20:26

ok.
i am trying to make a little app using cegui, opengl and sdl.
but when i try to add the cegui support, i have a bus error with the initialization of the renderer :
whats wrong ? :

Code: Select all

CEGUI::Renderer* d_renderer;
d_renderer = new CEGUI::OpenGLRenderer(0);
new CEGUI::System(d_renderer);

(the new CEGUI::OpenGLRenderer(); as in the wiki tutorial doesn't works for me)

the error :
in openglrenderer.cpp:54 : glGetIntegerv(GL_VIEWPORT, vp);
v[0]=49
v[1]=63
v[2]=7
v[3]=-1603105756

PS : iam not very skilled, but if i can help you to test...
if u have a little time to try to solve the problem with tiger, my ichat : renchapav

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Sun May 01, 2005 08:27

oops, thats not a good idea to init cegui before creating my window :D
i have a tiny xml error now, i will try to fix this

but can you change the xcode to have 2 targets, one with xerces and the other with tinyxml ?

User avatar
zakalawe
Just popping in
Just popping in
Posts: 7
Joined: Mon May 09, 2005 07:17
Location: Edinburgh, Scotland
Contact:

Re: Compiling CEGUI under MacOS X

Postby zakalawe » Mon May 09, 2005 16:36

Some data-points:
- ftimage.h from Apple's X11 SDK on Panther definitely has the old (lowercase) names
- ftimage.h from Apple's X11 SDK on Tiger has the uper-case names

GLint* / int* converion error is something I'm hitting in many different projects under Tiger - either Apple or the GCC team have tightened up the conversion logic, so you can't assume GLint or GLuint have the same size as the machine's int type. I suspect this is necessary to make GL work correctly on 64-bit machines.

You can work-around tyhis with explicit casts, but the correct fix is to use the symbolic GL names which have been provided since OpenGL 1.0.

User avatar
zakalawe
Just popping in
Just popping in
Posts: 7
Joined: Mon May 09, 2005 07:17
Location: Edinburgh, Scotland
Contact:

Re: Compiling CEGUI under MacOS X

Postby zakalawe » Mon May 09, 2005 23:07

OK, so I just spent some happy time building a clean CVS checkout from HEAD on Tiger. Interesting things:

- Apple have moved ft2build.h up a directory. to /usr/X11R6/include. Grrr.
- CEGUIXmlParser.cpp needs to be added to the CEGUI base target, and a few
Xerces-related files removed.

- the DefaultResourceProvider still pulls in some Xerces headers, but doesn't use them.

- the OpenGL renderer has the compile issues with GLxxx types not converting to int / uint. The fixes are trivial, they look like this:
<pre>
Index: OpenGLGUIRenderer/openglrenderer.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/renderers/OpenGLGUIRenderer/openglrenderer.h,v
retrieving revision 1.5
diff -u -3 -r1.5 openglrenderer.h
--- OpenGLGUIRenderer/openglrenderer.h 11 Feb 2005 10:48:01 -0000 1.5
+++ OpenGLGUIRenderer/openglrenderer.h 9 May 2005 22:54:34 -0000
@@ -285,7 +285,7 @@
*/
struct QuadInfo
{
- uint texid;
+ GLuint texid;
Rect position;
float z;
Rect texPosition;
@@ -343,7 +343,7 @@
bool d_sorted; //!< true when data in quad list is sorted.

std::list<OpenGLTexture*> d_texturelist; //!< List used to track textures.
- int d_maxTextureSize; //!< Holds maximum supported texture size (in pixels).
+ GLint d_maxTextureSize; //!< Holds maximum supported texture size (in pixels).
};

} // End of CEGUI namespace section
</pre>

- pbxcp (used by the helper script) seems to have been vanished. Though, I can't quite figure out why this step isn't done with a 'Copy Files' phase.

User avatar
renchap
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Mar 06, 2005 11:22
Location: France
Contact:

Re: Compiling CEGUI under MacOS X

Postby renchap » Tue May 10, 2005 23:46

ok, that works fine for me :)

pbxcp can be found here : /System/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/pbxcp
so a ln -s can solve this atm


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests