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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / OCC 62 sample compilation for new users on VC8

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
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

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