Hi Carsten,

as a starting point, I had just copied the source of testPassiveQT4.cpp into my 
source tree, to call it from my window manager. So the ordering of the files 
was exactly as in the testPassiveQT4.cpp.

the problem is in the OSGConfig.h

i had to comment the lines, that you described:

//# include <AvailabilityMacros.h> 
//# if !defined(MAC_OS_X_VERSION_10_5) || (MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_5) 
//#  define OSG_GLENUM_NEQ_UINT32 
//# endif 

now it works. here are the lines of my AvailabilityMacros.h, that might matter:

* Set up standard Mac OS X versions
*/
#define MAC_OS_X_VERSION_10_0 1000
#define MAC_OS_X_VERSION_10_1 1010
#define MAC_OS_X_VERSION_10_2 1020
#define MAC_OS_X_VERSION_10_3 1030
#define MAC_OS_X_VERSION_10_4 1040
#define MAC_OS_X_VERSION_10_5 1050                                              
            
#define MAC_OS_X_VERSION_10_6 1060

[…]

/*                                                                              
            
* if max OS not specified, assume largerof(10.6, min)
*/
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
   #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_6
       #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
   #else
       #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6
   #endif
#endif


i am running mac os x 10.6.7 with macports 1.9.2.

there was another problem. make install did not copy the library files to the 
destination directory, and OpenSG_LIBRARIES was empty. i solved that now, by 
copying them myself, and setting the variable by hand.

regards,
keyan


On 13 May 2011, at 17:01, Carsten Neumann wrote:

>       Hello Keyan,
> 
> On 05/13/2011 03:03 AM, Keyan wrote:
>> I am trying to include the testPassiveQT4.cpp into my application. although 
>> it compiles fine, when I only compile the OpenSG itself, I have difficulties 
>> to compile it as part of my application. for some reason, GLenum and UInt32 
>> are both defined as "unsigned int" which leads to a number of redefinition 
>> errors as the following:
>> 
>> <path>/include/OpenSG/OSGExceptionBinaryDataHandler.h:121: error: ‘void 
>> OSG::ExceptionBinaryDataHandler::putValue(const GLenum&)’ cannot be 
>> overloaded
>> <path>/include/OpenSG/OSGExceptionBinaryDataHandler.h:109: error: with ‘void 
>> OSG::ExceptionBinaryDataHandler::putValue(const OSG::UInt32&)’
>> 
>> Here is a second example, that is more explicit:
>> 
>> <path>include/OpenSG/OSGBaseFunctions.inl:2889: error: redefinition of 
>> ‘ValueTypeT OSG::osgSwapBytes(ValueTypeT) [with ValueTypeT = unsigned int]’
>> <path>/include/OpenSG/OSGBaseFunctions.inl:2869: error: ‘ValueTypeT 
>> OSG::osgSwapBytes(ValueTypeT) [with ValueTypeT = unsigned int]’ previously 
>> declared here
> 
> hmm, these are already guarded by #ifdef OSG_GLENUM_NEQ_UINT32 which in 
> OSGConfig.h is set like this:
> 
> # include <AvailabilityMacros.h>
> # if !defined(MAC_OS_X_VERSION_10_5) || (MAC_OS_X_VERSION_MAX_ALLOWED < 
> MAC_OS_X_VERSION_10_5)
> #  define OSG_GLENUM_NEQ_UINT32
> # endif
> 
> Does your application include OSGConfig.h as it's first OpenSG header? 
> Have you set any of the defines that influence the definition of 
> OSG_GLENUM_NEQ_UINT32 above?
> 
>> i use cmake, and therefore, i chose to copy the FindOpenSG.cmake into my 
>> source-directory. to include opensg, i simply call
>> 
>> find_package(OpenSG)
>> 
>> and then use:
>> 
>> IF(OpenSG_FOUND)
>>  include_directories(${OpenSG_INCLUDE_DIRS})
>>  link_directories(${OpenSG_LIBRARY_DIRS})
>> ENDIF(OpenSG_FOUND)
>> 
>> OpenSG_INCLUDE_DIRS points to the path, where I installed OpenSG (make 
>> install).
> 
> yes, that is how we use OpenSG in our projects too.
> 
>       Cheers,
>               Carsten
> 
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Opensg-users mailing list
> Opensg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensg-users


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to