Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
I can confirm the problem with round(). A quick fix/hack is to change it to
take and return a double instead of float -- so it matches the existing library
definition. Look in platform.c/h.
Cross compatibility is a bit of a mess since freetype-gl is written in C99
(which has round() I believe), so for MSVC a definition is needed (since it has
no C99-support) but not so for MinGW -- but the only distinction currently is
between Windows/MacOS/Linux which doesn't account for this.
So a more proper fix is probably to surround round() with a "#if
_MSC_VER"-block, keeping the surrounding "#if defined(_WIN32)||defined(_WIN64)"
so strndup() is still added for both MSVC and MinGW.
Alternatively, maybe it's -- in general -- better to do all such distinctions
on the compiler level and disregard OS completely? So the rule becomes
something like "assume C99 on GCC, everything else is a special case with
ifdefs for different compilers".
Original comment by cforf...@gmail.com
on 23 Mar 2013 at 12:27
[deleted comment]
Oh, and yeah GLUT is only for the demos. GLEW could probably be linked (I've
submitted a patch to Nicolas which does this, and also fixes the linking of
GLUT), but there's still the issue of differentiating between MSVC and MinGW
versions of non-binary compatible libraries (which GLEW was for me -- I think
it linked the bundled GLUT successfully however).
In general I think is probably a good idea to (re-)build all the external
libraries yourself however -- even if it technically works there could still be
some hidden issues. For instance, MSVC warns "LINK : warning LNK4098:
defaultlib 'LIBCMT' conflicts with use of other libs; use
/NODEFAULTLIB:library" if I use the bundled FreeType. Probably because it was
linked with /MT instead of /MD. By compiling all of them myself I can be sure
they're compatible. In this case, for GLEW/FreeType/(GLUT), it's very quick a
painless as well, so there's really no reason not to.
Original comment by cforf...@gmail.com
on 23 Mar 2013 at 12:53
I managed to fix all issues. I just noticed that most errors were caused by
minor mistakes in the CMakeLists.txt:
*GLUT_GLUT_LIBRARY should be GLUT_LIBRARY.
*FREETYPE_INCLUDE_DIRS is used even though it's never defined.
Original comment by jlod...@gmail.com
on 24 Mar 2013 at 9:34
Only warning I'm getting is the following:
freetype-gl/vertex-buffer.c:238:17: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
(long) self->attributes[i]->pointer);
It's being cast to long as an argument to printf("%ld"), why not just use %p
instead?
Original comment by jlod...@gmail.com
on 24 Mar 2013 at 9:41
I fixed the warning.
Should I close this issue then ?
Original comment by Nicolas.Rougier@gmail.com
on 29 Mar 2013 at 7:25
The main reason I opened this issue was because the cmakefile didn't work
properly with msys/mingw.
For instance, on windows, it just includes the libraries in the windows folder,
I think it should at least check first if find_package finds the libraries.
And also, there's the round() problem I mentioned in the first post.
If those issues are resolved, you can close this with a clean conscience. :)
Original comment by jlod...@gmail.com
on 29 Mar 2013 at 11:43
This is the error I'm getting:
In file included from d:/Dev/lib/freetype-gl/texture-font.c:45:0:
d:/Dev/lib/freetype-gl/platform.h:61:11: error: conflicting types for 'round'
float round (float v);
Post #2 suggests a fix.
Original comment by jlod...@gmail.com
on 29 Mar 2013 at 11:54
Done !
Original comment by Nicolas.Rougier@gmail.com
on 30 Mar 2013 at 12:18
Original issue reported on code.google.com by
jlod...@gmail.com
on 18 Mar 2013 at 4:08