Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

OCC 62 sample compilation for new users on VC8

OCC 62 sample compilation for new users on VC8
TAZEROUALTI 2008/04/20 10:15
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 ?
Gennady Khokhorin 2008/12/17 21: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
Gennady Khokhorin 2008/12/17 21:11
I'm guessing it should be Standard_Boolean
ronan 2009/10/09 17:45
I have also the same problem.
Any one has a idea or no one use it on windows???
Paul Jimenez 2009/10/12 08: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.
ronan 2009/10/12 09:39
Ok,
Thank you Paul, for your answer.
 
 
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map