kag517 / webgl-loader

Automatically exported from code.google.com/p/webgl-loader
0 stars 0 forks source link

Unable to Compile on Windows (format specification for size_t is %Iu no %zu) #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiling with MinGW (GCC for Windows) still uses the Microsoft C libraries 
which use %Iu instead of %zu for size_t format specification.

Recommendation is to add the following to base.h:

#ifdef _WIN32 // defined in MSVC and MinGW
#define SIZET_FORMAT "%Iu"
#else
#define SIZET_FORMAT "%zu"
#endif

Then replace all instances of %zu with "SIZET_FORMAT" (keeping quotes, except 
in one case the first quote needs to be removed because the string starts with 
%zu).

Original issue reported on code.google.com by j...@coderforlife.com on 28 Feb 2012 at 1:50

GoogleCodeExporter commented 8 years ago
The only files with these changes are mesh.h, objcompress.cc, and 
objanalyze.cc. I have modified my own files, I would submit them if I could.

Original comment by j...@coderforlife.com on 28 Feb 2012 at 2:02

GoogleCodeExporter commented 8 years ago
Sorry, this is a partial duplicate of issue 23: 
http://code.google.com/p/webgl-loader/issues/detail?id=23

However, I hope the fix I provide is welcome.

Original comment by j...@coderforlife.com on 28 Feb 2012 at 4:41

GoogleCodeExporter commented 8 years ago
This is an easy one, and I'll apply this fix this weekend.

Original comment by wonchun on 4 Apr 2012 at 2:32

GoogleCodeExporter commented 8 years ago

Original comment by wonchun on 9 Apr 2012 at 10:39