 |
CML Discussion Forums
|
| View previous topic :: View next topic |
| Author |
Message |
nairou
Joined: 11 Mar 2009 Posts: 23
|
Posted: Fri Mar 30, 2012 7:07 pm Post subject: Errors compiling with MinGW |
|
|
I'm attempting to rebuild my project under Windows using MinGW (using GCC 4.6.2)., but I'm getting an error immediately at the line where I include cml.h (before I even use it).
It looks like the main issue is in regard to the use of "ssize_t". I'm not sure if this problem is specific to MinGW or GCC, or if MSVC was just more tolerant of something CML is doing?
I tried both the 1.0.3 release, and the latest in SVN, and both give the same result.
| Code: | In file included from ../../../../libraries/cml/cml/vector.h:52:0,
from ../../../../libraries/cml/cml/cml.h:66,
from ../../src/camera.h:4,
from ../../src/camera.cpp:1:
../../../../libraries/cml/cml/vector/vector_comparison.h: In function 'bool cml::detail::vector_weak_order(const LeftT&, const RightT&, OpT)':
../../../../libraries/cml/cml/vector/vector_comparison.h:103:5: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/vector/vector_comparison.h:103:13: error: expected ';' before 'N'
../../../../libraries/cml/cml/vector/vector_comparison.h:104:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/vector/vector_comparison.h:104:24: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/vector/vector_comparison.h:104:28: error: 'N' was not declared in this scope
../../../../libraries/cml/cml/vector/vector_comparison.h: In function 'bool cml::detail::vector_total_order(const LeftT&, const RightT&, OpT)':
../../../../libraries/cml/cml/vector/vector_comparison.h:161:5: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/vector/vector_comparison.h:161:13: error: expected ';' before 'N'
../../../../libraries/cml/cml/vector/vector_comparison.h:162:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/vector/vector_comparison.h:162:24: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/vector/vector_comparison.h:162:28: error: 'N' was not declared in this scope
In file included from ../../../../libraries/cml/cml/matrix.h:50:0,
from ../../../../libraries/cml/cml/cml.h:67,
from ../../src/camera.h:4,
from ../../src/camera.cpp:1:
../../../../libraries/cml/cml/matrix/matrix_comparison.h: In function 'bool cml::detail::matrix_weak_order(const LeftT&, const RightT&, OpT)':
../../../../libraries/cml/cml/matrix/matrix_comparison.h:109:9: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/matrix/matrix_comparison.h:109:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/matrix/matrix_comparison.h:109:24: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/matrix/matrix_comparison.h:110:21: error: expected ';' before 'j'
../../../../libraries/cml/cml/matrix/matrix_comparison.h:110:28: error: 'j' was not declared in this scope
In file included from ../../../../libraries/cml/cml/matrix.h:51:0,
from ../../../../libraries/cml/cml/cml.h:67,
from ../../src/camera.h:4,
from ../../src/camera.cpp:1:
../../../../libraries/cml/cml/matrix/lu.h: In function 'void cml::detail::lu_inplace(MatT&)':
../../../../libraries/cml/cml/matrix/lu.h:70:3: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:70:11: error: expected ';' before 'N'
../../../../libraries/cml/cml/matrix/lu.h:71:15: error: expected ';' before 'k'
../../../../libraries/cml/cml/matrix/lu.h:71:22: error: 'k' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:71:26: error: 'N' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:74:17: error: expected ';' before 'j'
../../../../libraries/cml/cml/matrix/lu.h:74:24: error: 'j' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:76:19: error: expected ';' before 'p'
../../../../libraries/cml/cml/matrix/lu.h:76:26: error: 'p' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:81:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/matrix/lu.h:81:26: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:83:19: error: expected ';' before 'p'
../../../../libraries/cml/cml/matrix/lu.h:83:26: error: 'p' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h: In function 'typename cml::et::MatVecPromote<LeftT, RightT>::temporary_type cml::lu_solve(const MatT&, const VecT&)':
../../../../libraries/cml/cml/matrix/lu.h:161:3: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:161:11: error: expected ';' before 'N'
../../../../libraries/cml/cml/matrix/lu.h:171:44: error: 'N' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:172:15: error: expected ';' before 'i'
../../../../libraries/cml/cml/matrix/lu.h:172:22: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:174:17: error: expected ';' before 'j'
../../../../libraries/cml/cml/matrix/lu.h:174:24: error: 'j' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:182:15: error: expected ';' before 'i'
../../../../libraries/cml/cml/matrix/lu.h:182:24: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/matrix/lu.h:184:17: error: expected ';' before 'j'
../../../../libraries/cml/cml/matrix/lu.h:184:26: error: 'j' was not declared in this scope
In file included from ../../../../libraries/cml/cml/quaternion.h:60:0,
from ../../../../libraries/cml/cml/cml.h:68,
from ../../src/camera.h:4,
from ../../src/camera.cpp:1:
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h: In function 'bool cml::detail::quaternion_weak_order(const LeftT&, const RightT&, OpT)':
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:101:9: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:101:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:101:24: error: 'i' was not declared in this scope
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h: In function 'bool cml::detail::quaternion_total_order(const LeftT&, const RightT&, OpT)':
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:157:9: error: 'ssize_t' was not declared in this scope
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:157:17: error: expected ';' before 'i'
../../../../libraries/cml/cml/quaternion/quaternion_comparison.h:157:24: error: 'i' was not declared in this scope
|
|
|
| Back to top |
|
 |
Jesse Anders Site Admin
Joined: 01 Jan 1970 Posts: 305
|
Posted: Fri Mar 30, 2012 7:16 pm Post subject: |
|
|
| I don't currently have that particular toolchain available (maybe Demian will have an answer), but in the meantime, could you post a minimal program that generates the error? (Ideally something with no dependencies so that one of us can drop it into our compiler if needed.) |
|
| Back to top |
|
 |
nairou
Joined: 11 Mar 2009 Posts: 23
|
Posted: Fri Mar 30, 2012 7:47 pm Post subject: |
|
|
The error is triggered by including the header, so this does the same thing:
| Code: | #include <cml/cml.h>
int main( void )
{
return 0;
}
|
However, in the process of testing this, I've narrowed the problem down, and it may just be a GCC issue. The above file compiles fine, as long as you don't enable GCC's C++0x support (via "-std=c++0x"). Once you add that flag, it spews the errors I listed previously.
On the other hand, I just found that using the "-std=gnu++0x" flag (which allows for GCC-specific extensions on top of C++0x) allows it to compile again. Again, I don't know if this is a GCC issue, or if CML is doing something that isn't conforming to the new standard without the use of an extension. But at least it's compiling now.  |
|
| Back to top |
|
 |
dnave
Joined: 29 Jun 2007 Posts: 96 Location: Pittsburgh, PA
|
Posted: Sat Mar 31, 2012 4:44 am Post subject: |
|
|
I uploaded a quick fix to the SVN repository, but I could only test it on gcc 4.6.2 (no -std, -std=c++0x, -std=gnu++0x) and VC10 Express at this point. The changes also fix some compilation errors in the performance tests, but shouldn't affect general use.
Cheers,
Demian |
|
| Back to top |
|
 |
nairou
Joined: 11 Mar 2009 Posts: 23
|
Posted: Sun Apr 01, 2012 9:38 pm Post subject: |
|
|
| That appears to have done the trick! The test compiles successfully now, both with -std=c++0x and -std=gnu++0x. Thanks! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|