Sun, 04/20/2008 - 12:15
Forums:
Thinks to "Philippe Carret" for it's message "OCC 51 sample compilation for new users"
There is another problem when compiling the project mfcsample under VC8.
List of errors :
1/ ...\mfc\common\isession2d\isession2d_shape.cpp(63) : error C2065: 'i' : undeclared identifier
2/ ...\mfc\common\occ_2dview.cpp(668) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3/ ...\mfc\common\importexport\importexport.cpp(365) : error C2065: 'i' : undeclared identifier
for the erroe 1 and 3, it's not difficult.
the error 2, in line :
static LastIsGridActiveStatus = Standard_True;
I assume that LastIsGridActiveStatus is bool.
it's Correct ?
Wed, 12/17/2008 - 23:10
Its weird. Got the same compiler errors.
Looks like latest 6.3.0 (Sept) was not being updated since version 6.2 (March)
msvc8.0
Wed, 12/17/2008 - 23:11
I'm guessing it should be Standard_Boolean
Fri, 10/09/2009 - 19:45
I have also the same problem.
Any one has a idea or no one use it on windows???
Mon, 10/12/2009 - 10:06
The source of that problem is that the examples use a very old syntax from an old C standard that is not supported by C++ (which is more than 10 years old already). The two common problems found in the examples are default-int and variable scope in for loops.
Default-int looks like this (taking the 'static' example):
static SomeVar = SomeValue; // SomeVar is 'int' by default (unsupported in C++)
To fix that, just add the missing int like this:
static int SomeVar = SomeValue;
The problem that deals with scope is like this:
for (int i = ...; ...; ...) { ... } // i is only known in the for loop
for (i = ...; ...; ...) { ... } // i is no longer known here
That is not supported by C++ either. The old behavior was that 'i' would still be visible after the for loop. To fix that the code needs to be changed like this:
for (int i = ...; ...; ...) { ... }
for (int i = ...; ...; ...) { ... } // there's an instance of i now for this for loop
That should get the code to compile and run.
Mon, 10/12/2009 - 11:39
Ok,
Thank you Paul, for your answer.