randi120 / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

MinGW build and execution #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

The current trunk does not build correctly with MinGW, and every example 
segfaults as the glezwInit() function is not called (thus every gl* function is 
a non-initialized pointer).

I have attached a patch to correct this problem, and it also makes some 
modifications to platform.h (there was an ifdef WIN32 that really was an ifdef 
_MSC_VER).

I also modified the CMakeLists.txt to be require GLEW (as it is used by the 
project), and removed the headers from the source variable (CMake does not need 
this, and it makes the CMakeLists cleaner IMHO).

If you want me to add more to this patch I'll be glad.

Best.

Original issue reported on code.google.com by packadal on 12 Nov 2012 at 2:47

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks a lot for the patch.

I've no experience at compiling using windows so I did not even notice it was 
not compiling. Do you know if your patch still allows to compile with other 
compilers ?

Original comment by Nicolas.Rougier@gmail.com on 14 Nov 2012 at 8:26

GoogleCodeExporter commented 8 years ago
I tried compiling with MSVC, but there were some issues about MSVC not 
supporting C99 (so it needed to use C++ mode, and CMake does not detect it by 
default).

I guess to better support MSVC the best would be to change the file extensions 
to .cpp (which is how I managed to get it to compile, but as I use MinGW 
primarily I switched back to this toolchain when I managed to get everything 
working.

Also, I did not manage to get things working using the libraries on the svn, so 
I used libs I compiled myself some time ago.

Original comment by packadal on 14 Nov 2012 at 8:35

GoogleCodeExporter commented 8 years ago
Did you see the proposed enhancement in the freetype-gl group for handling C99:

if(MSVC)
  foreach(flag_var
          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
    set(${flag_var} "${${flag_var}} /TP")
  endforeach(flag_var)
endif()

/f

maybe this could added with your patch ?
Also, issue 40 reports missing instructions for compiling the 
demo-distance-field-2, would that be possible for you to make a new patch with 
all of these changes ? That would be great.

Nicolas

Original comment by Nicolas.Rougier@gmail.com on 20 Nov 2012 at 6:12

GoogleCodeExporter commented 8 years ago
Ok, I integrated the glew init stuff in all the demos and integrated the 
proposed MSVC patch without testing since I don't have access to windows.

I'll close this issue, please re-open a new one for mingw

Original comment by Nicolas.Rougier@gmail.com on 16 Dec 2012 at 9:27