Hej
Jeg har et problem. Jeg får en fejlbesked i MSVC der fortæller mig at jeg har en redefinition af nogle basic types.
Det drejer sig om henholdsvis intptr_t der kan findes i MSVCs egen crtdefs.h og i et andet program jeg bruger der hedder csound sysdep.h
Jeg kan ikke lave nogle af dem om, så derfor skal jeg finde en måde at lade dem leve side om side. Jeg har fået et hint fra en hjælpsom gut:
#include <HeaderWithProblematicDefinition.h>
#ifdef PROBLEMATIC_SYMBOL
#define BACKUP_FOR_PROBLEMATIC_SYMBOL
#undef PROBLEMATIC_SYMBOL
#endif
#include <HeaderWithConflictingDefinition.h>
#ifdef BACKUP_FOR_PROBLEMATIC_SYMBOL
#define PROBLEMATIC_SYMBOL BACKUP_FOR_PROBLEMATIC_SYMBOL
#endif
Men jeg synes efterhånden jeg har prøvet lidt af hvert, uden succes. Der er nogle ting der forvirrer mig omkring det her. f.eks er intptr_t og uintptr_t i crtdefs.h defineret under _WIN64, men jeg bruger og compilerer til win32.
Jeg går også ud fra at det drejer sig om symbolet _INTPTR_T_DEFINED i crtdefs.h der skal indsættes i den ovenstående kode.
Enhver form for hjælp ville være meget tiltrængt og værdsat
Mvh
Carsten
Udpluk af crtdefs.h:
#ifndef _INTPTR_T_DEFINED
#ifdef _WIN64
typedef __int64 intptr_t;
#else
typedef _W64 int intptr_t;
#endif
#define _INTPTR_T_DEFINED
#endif
Udpluk af sysdep.h
#if defined(USE_GUSI2)
/* When compiling with GUSI on MacOS 9 (for Python), */
/* all of the other integer types are already defined */
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
#elif defined(HAVE_STDINT_H) || defined(HAVE_C99)
# include <stdint.h>
#else
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
# if defined(__GNUC__) || !defined(WIN32)
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef long long int_least64_t;
typedef unsigned long long uint_least64_t;
# else
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int_least64_t;
typedef unsigned __int64 uint_least64_t;
# endif
typedef long intptr_t; //OBS OBS OBS
typedef unsigned long uintptr_t;//DISSE TO LINIER
#endif /* !(USE_GUSI2 || HAVE_STDINT_H || HAVE_C99) */
build log:
------ Rebuild All started: Project: wxWidgetsCsound, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'wxWidgetsCsound', configuration 'Debug|Win32'
Compiling...
wxMainPanel.cpp
c:\\program files\\csound5\\h\\sysdep.h(193) : error C2371: 'intptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\crtdefs.h(448) : see declaration of 'intptr_t'
c:\\program files\\csound5\\h\\sysdep.h(194) : error C2371: 'uintptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\vadefs.h(52) : see declaration of 'uintptr_t'
wxMainApp.cpp
c:\\program files\\csound5\\h\\sysdep.h(193) : error C2371: 'intptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\crtdefs.h(448) : see declaration of 'intptr_t'
c:\\program files\\csound5\\h\\sysdep.h(194) : error C2371: 'uintptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\vadefs.h(52) : see declaration of 'uintptr_t'
treeCtrl.cpp
c:\\program files\\csound5\\h\\sysdep.h(193) : error C2371: 'intptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\crtdefs.h(448) : see declaration of 'intptr_t'
c:\\program files\\csound5\\h\\sysdep.h(194) : error C2371: 'uintptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\vadefs.h(52) : see declaration of 'uintptr_t'
dropCanvas.cpp
csoundImp.cpp
c:\\program files\\csound5\\h\\sysdep.h(193) : error C2371: 'intptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\crtdefs.h(448) : see declaration of 'intptr_t'
c:\\program files\\csound5\\h\\sysdep.h(194) : error C2371: 'uintptr_t' : redefinition; different basic types
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include\\vadefs.h(52) : see declaration of 'uintptr_t'
Generating Code...
Build log was saved at "file://c:\\Documents and Settings\\carsten\\My Documents\\Visual Studio 2005\\Projects\\wxWidgetsCsound\\wxWidgetsCsound\\Debug\\BuildLog.htm"
wxWidgetsCsound - 8 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Indlæg senest redigeret d. 03.03.2008 19:33 af Bruger #12570