McNeel Wiki
Using openNURBS 4.0 with Visual C++ 6.0
edit · print · help · all topics
Main Pages

AccuRender

Bongo

Brazil r/s

Developer

Flamingo

Penguin

Rhino Blogs

Rhino

Rhino Labs

Search

Languages

Česky

Deutsch

English

Español

Français

Italiano

Polish

日本語

한국어

中文(繁體)

 
.
DeveloperopenNURBS

Overview

As mentioned in the readme.txt and faq.txt files included with the toolkit, openNURBS has been successfully used with the following compilers and compiler/SDK combinations:

  • Microsoft Visual C++ 6.0 SP5 (Windows XP, Requires the November 2001, version 5.1.3590.2, Microsoft Platform SDK)
  • Microsoft Visual C++ 2005 (Windows XP and x64)
  • gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Note, the Microsoft Visual C++ 6.0 configuration mentioned above is the environment used to build Rhino 3.0.

The openNURBS toolkit includes Visual C++ 6.0 projects (.dsp) and a workspace (.dsw) that work with the above configuration. But, if you try to build the openNURBS toolkit with Microsoft Visual C++ 6.0 and you do not have Microsoft's Platform SDK, you will receive a number of the following types of errors:

  error C2676: binary '==' : 'const struct _GUID' does not define this operator or a conversion to a type acceptable to the predefined operator
  error C2676: binary '!=' : 'const struct _GUID' does not define this operator or a conversion to a type acceptable to the predefined operator

These errors occur because Microsoft Visual C++ 6.0 does not included the guiddef.h header file that defines operator== and operator!= overloads that prevent these errors from occuring. This header is included with the Platform SDK.

Solution

To get rid of the compiler errors generated by not having the guiddef.h header file included with the Platform SDK, copy the following code block into a header file named opennurbs_guiddef.h and save it into the folder where your openNURBS toolkit resides. Then, simply follow the directions listed at the top of the header file.

  /////////////////////////////////////////////////////////////////////////////
  // opennurbs_guiddef.h
  //
  // The following declarations are found in guiddef.h, which is included with
  // the Microsoft Platform SDK. If you are building openNURBS using a Microsoft
  // compiler and you do not also have the Microsoft Platform SDK, then you need
  // to included this header in the openNURBS project. Include this header in 
  // opennurbs.h, which is the pre-compiled header file for the project. Locate 
  // this include statement immediately following the #include "opennurbs_uuid.h" 
  // statement. For example:
  //
  //   #include "opennurbs_uuid.h"    /* universally unique identifiers (UUID, a.k.a, GUID) */
  //
  //   #include "opennurbs_guiddef.h" /* microsoft platform sdk uuid inlines */
  //
  //   #if defined(ON_CPLUSPLUS)
  //


  #pragma once


  #ifndef REFGUID


  #define REFGUID const GUID &


  __inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
  {
     return (
        ((unsigned long *) &rguid1)[0] == ((unsigned long *) &rguid2)[0] &&
        ((unsigned long *) &rguid1)[1] == ((unsigned long *) &rguid2)[1] &&
        ((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] &&
        ((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]);
  }


  __inline int IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
  {
      return !memcmp(&rguid1, &rguid2, sizeof(GUID));
  }


  __inline int operator==(REFGUID rguid1, REFGUID rguid2)
  {
      return IsEqualGUID(rguid1,rguid2);
  }


  __inline int operator!=(REFGUID rguid1, REFGUID rguid2)
  {
      return !(rguid1 == rguid2);
  }


  #endif // #ifndef REFGUID
rename · changes · history · subscriptions · lost and found · references · file upload