20 March 2009

Win32 Clutter (0.9.2 and Bleeding edge) compilation...

... Still using code::blocks:

Okay i enhanced my scripts to make all this compiling with a native code::blocks install, but various clutter versions...

Basically all you need is:

- to get Clutter sources: using GIT repository (origin/master branch fe), or here : http://www.clutter-project.org/sources/clutter/0.9/ (0.9.2)
- to create some %CLUTTER%\clutter\build\codeblocks directory
- to unzip in there, content of http://alimbourg.googlepages.com/codeblocks.zip
- to modify 'prebuild.bat' which configures various compilation defines, plus generates some .h/.c files using glib tools: so you have to change some paths to point your glib directory...
- run 'prebuild.bat': it will ask for perl.exe, but if you don't have it installed, will copy my own "clutter-enum-types.c/.h" (hence, should be out of sync at some point)

Read http://www.clutter-project.org/blog/?p=68 for dependencies. See previous posts about how to get them.

After that, everything should be ok for you to compile...

For Visual Studio Users: all you have to do is to create .vcproj with all the source files... But probably that some typical gcc include files would be missing (i dont have visual right right now to check that) like libintl.h, iconv.h (?).
gettext, libiconv package for win32 are available here, but i dont know how they integrate themselves into a visual studio framework...

PM or Comment if you need some more ;-).

6 comments:

Unknown said...

Hey! I tried to get this working, and i have all the dependencies in a recongnizable location, but now when i try to compile it returns the following error. I'm on windows vista. Can you help?

Compiling: ..\..\tests\conform\test-actor-invariants.c
In file included from ../../clutter/cogl/cogl.h:33,
from ../../clutter/clutter-fixed.h:33,
from ../../clutter/clutter-color.h:34,
from ../../clutter/clutter-actor.h:36,
from ../../clutter/clutter.h:33,
from C:\Prog\clutter-0.9.2\tests\conform\test-actor-invariants.c:4:
../../clutter/cogl/cogl-defines-GL.h:794: error: syntax error before '*' token
../../clutter/cogl/cogl-defines-GL.h:795: warning: type defaults to `int' in declaration of `GLhandleARB'
../../clutter/cogl/cogl-defines-GL.h:795: error: `GLhandleARB' declared as function returning a function
../../clutter/cogl/cogl-defines-GL.h:799: error: `COGL_PFNGLCREATESHADEROBJECTARBPROC' declared as function returning a function
../../clutter/cogl/cogl-defines-GL.h:805: warning: type defaults to `int' in declaration of `GLcharARB'
../../clutter/cogl/cogl-defines-GL.h:805: error: syntax error before '*' token
../../clutter/cogl/cogl-defines-GL.h:828: warning: type defaults to `int' in declaration of `GLcharARB'
../../clutter/cogl/cogl-defines-GL.h:828: error: syntax error before '*' token
../../clutter/cogl/cogl-defines-GL.h:839: error: syntax error before "GLcharARB"
../../clutter/cogl/cogl-defines-GL.h:877: error: syntax error before "GLsizeiptr"
../../clutter/cogl/cogl-defines-GL.h:884: error: syntax error before "GLintptr"

Ash said...

I would say that you're using an old GL/GLExt.h. The one available with standard mingw (mingw\include\GL\GLext.h) has to be updated with this
http://www.opengl.org/registry/api/glext.h

Fortunately(?) i'm going to write some new (more standard) howto (to be released this week)

Unknown said...

Can't wait! I got it to build (0.9.2) finally! Woopee! (remember to activate clutter project first, for those who aren't familiar with codeblocks like me) Is there any reason why it builds in debug version but not in release version? Is the speed going to be affected?
Also, i tried to build 0.9.8, but it gave me the following error:


Compiling: ..\..\clutter\cogl\common\cogl-matrix.c
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c: In function `cogl_matrix_ortho':
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c:221: error: parameter name omitted
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c:222: error: parameter name omitted
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c:241: error: syntax error before ')' token
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c:247: error: syntax error before ')' token
C:\Prog\clutter-0.9.8\clutter\cogl\common\cogl-matrix.c:247: error: syntax error before ')' token

Ash said...

No, running in debug is not a problem, unless you're doing uber heavy rendering on a small computer.
Your error is strange, looks like 'near' and/or 'far' parameter names are a problem (had been wrongly defined as something bad/void in some headers ?... cant tell you precisely before one day or two unfortunately: again i'm just writing a procedure and a perl script to compile 1.0 on win32)

addendum: Well i did compile clutter-1.0.0 without any problem (havent tried it yet, though) with new perl scripts. Need to do some concerning the test suite... But presumingly: 'it should work'.

Unknown said...

Hey! I finally got 0.9.8 to build. That problem was the near and far are defined as blank macros (substituted by nothing). So i had to say #undef near, #undef far. Then, i had to include more files which were with the 0.9.8. Then i had to delete the cogl/gles files because i didn't have open el installed (and don't need it)! Then, when linking to opengl32.a, I got an error which said 'undefined reference to glClientActiveTexture' or something (can't remember). Thus, I remembered i had already made mesa gl , which adds support for greater versions of opengl. (easy to make on windows with microsoft visual c++). Then, i goofed because i linked to the lib in the wrong order. All the gl functions were then giving errors. Then, it built.
You should give mesa opengl a look, it claims to have support for opengl 2.1.

Unknown said...

I got 1.0.0 to build. Your prebuild.bat script worked beautifully. Sure, i also got 489 warnings, but no matter! I'm guessing the usage of mesa gl makes it easier, since it supports a later version of opengl.