c++ unfähig windows.h zu includen

Koksi

PC-Selbstbauer(in)
c++ unfähig windows.h zu includen

Hey Leute
Ich hoffe jemand von euch kann mir bei meinem Problem helfen und zwar bei folgendem:

dies ist mein c++ code in netbeans:


#include <windows.h>
#include <cstdlib>
#include <iostream>

using namespace std;


int main(int argc, char** argv) {
return 0;
}

und hier ist die Fehlermeldung... ich werd da einfach nicht schlau draus :huh:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Koksi/Documents/NetBeansProjects/CppApplication_1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/cppapplication_1.exe
make[2]: Entering directory `/cygdrive/c/Users/Koksi/Documents/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f build/Debug/Cygwin_4.x-Windows/main.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin_4.x-Windows/main.o.d -o build/Debug/Cygwin_4.x-Windows/main.o main.cpp
/usr/include/w32api/winbase.h: In function ‘unsigned int _InterlockedIncrement(volatile unsigned int*)’:
In file included from /usr/include/w32api/windows.h:70:0,
from main.cpp:1:
/usr/include/w32api/winbase.h:2925:33: error: redefinition of ‘unsigned int _InterlockedIncrement(volatile unsigned int*)’
FORCEINLINE unsigned __LONG32 InterlockedIncrement (unsigned __LONG32 volatile *Addend) { return (unsigned __LONG32) InterlockedIncrement ((volatile __LONG32 *) Addend); }
^
/usr/include/w32api/winbase.h:2924:24: error: ‘unsigned int _InterlockedIncrement(volatile unsigned int*)’ previously defined here
FORCEINLINE unsigned InterlockedIncrement (unsigned volatile *Addend) { return (unsigned) InterlockedIncrement ((volatile __LONG32 *) Addend); }
^
/usr/include/w32api/winbase.h: In function ‘unsigned int _InterlockedDecrement(volatile unsigned int*)’:
/usr/include/w32api/winbase.h:2930:33: error: redefinition of ‘unsigned int _InterlockedDecrement(volatile unsigned int*)’
FORCEINLINE unsigned __LONG32 InterlockedDecrement (unsigned __LONG32 volatile *Addend) { return (unsigned __LONG32) InterlockedDecrement ((volatile __LONG32 *) Addend); }
^
/usr/include/w32api/winbase.h:2929:24: error: ‘unsigned int _InterlockedDecrement(volatile unsigned int*)’ previously defined here
FORCEINLINE unsigned InterlockedDecrement (unsigned volatile *Addend) { return (unsigned __LONG32) InterlockedDecrement ((volatile __LONG32 *) Addend); }
^
/usr/include/w32api/winbase.h: In function ‘unsigned int _InterlockedExchange(volatile unsigned int*, unsigned int)’:
/usr/include/w32api/winbase.h:2935:33: error: redefinition of ‘unsigned int _InterlockedExchange(volatile unsigned int*, unsigned int)’
FORCEINLINE unsigned __LONG32 InterlockedExchange (unsigned __LONG32 volatile *Target, unsigned __LONG32 Value) { return (unsigned __LONG32) InterlockedExchange ((volatile __LONG32 *) Target,(__LONG32) Value); }
^
/usr/include/w32api/winbase.h:2934:24: error: ‘unsigned int _InterlockedExchange(volatile unsigned int*, unsigned int)’ previously defined here
FORCEINLINE unsigned InterlockedExchange (unsigned volatile *Target, unsigned Value) { return (unsigned) InterlockedExchange ((volatile __LONG32 *) Target,(__LONG32) Value); }
^
/usr/include/w32api/winbase.h: In function ‘unsigned int _InterlockedExchangeAdd(volatile unsigned int*, unsigned int)’:
/usr/include/w32api/winbase.h:2941:33: error: redefinition of ‘unsigned int _InterlockedExchangeAdd(volatile unsigned int*, unsigned int)’
FORCEINLINE unsigned __LONG32 InterlockedExchangeAdd (unsigned __LONG32 volatile *Addend, unsigned __LONG32 Value) { return (unsigned __LONG32) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,(__LONG32) Value); }
^
/usr/include/w32api/winbase.h:2939:24: error: ‘unsigned int _InterlockedExchangeAdd(volatile unsigned int*, unsigned int)’ previously defined here
FORCEINLINE unsigned InterlockedExchangeAdd (unsigned volatile *Addend, unsigned Value) { return (unsigned) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,(__LONG32) Value); }
^
/usr/include/w32api/winbase.h: In function ‘unsigned int InterlockedExchangeSubtract(volatile unsigned int*, unsigned int)’:
In file included from /usr/include/w32api/windows.h:70:0,
from main.cpp:1:
/usr/include/w32api/winbase.h:2942:33: error: redefinition of ‘unsigned int InterlockedExchangeSubtract(volatile unsigned int*, unsigned int)’
FORCEINLINE unsigned __LONG32 InterlockedExchangeSubtract (unsigned __LONG32 volatile *Addend, unsigned __LONG32 Value) { return (unsigned __LONG32) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,- (__LONG32) Value); }
^
/usr/include/w32api/winbase.h:2940:24: error: ‘unsigned int InterlockedExchangeSubtract(volatile unsigned int*, unsigned int)’ previously defined here
FORCEINLINE unsigned InterlockedExchangeSubtract (unsigned volatile *Addend, unsigned Value) { return (unsigned) InterlockedExchangeAdd ((volatile __LONG32 *) Addend,- (__LONG32) Value); }
^
/usr/include/w32api/winbase.h: In function ‘unsigned int _InterlockedCompareExchange(volatile unsigned int*, unsigned int, unsigned int)’:
In file included from /usr/include/w32api/windows.h:70:0,
from main.cpp:1:
/usr/include/w32api/winbase.h:2948:33: error: redefinition of ‘unsigned int _InterlockedCompareExchange(volatile unsigned int*, unsigned int, unsigned int)’
FORCEINLINE unsigned __LONG32 InterlockedCompareExchange (unsigned __LONG32 volatile *Destination, unsigned __LONG32 Exchange, unsigned __LONG32 Comperand) { return (unsigned __LONG32) InterlockedCompareExchange ((volatile __LONG32 *) Destination,(__LONG32) Exchange,(__LONG32) Comperand); }
^
/usr/include/w32api/winbase.h:2947:24: error: ‘unsigned int _InterlockedCompareExchange(volatile unsigned int*, unsigned int, unsigned int)’ previously defined here
FORCEINLINE unsigned InterlockedCompareExchange (unsigned volatile *Destination, unsigned Exchange, unsigned Comperand) { return (unsigned) InterlockedCompareExchange ((volatile __LONG32 *) Destination,(__LONG32) Exchange,(__LONG32) Comperand); }
^
nbproject/Makefile-Debug.mk:66: recipe for target `build/Debug/Cygwin_4.x-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin_4.x-Windows/main.o] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/Koksi/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-Debug.mk:59: recipe for target `.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Koksi/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 1s)
Netbeans an sich sag als Fehlermeldung(wenn ich die maus drüber halte):
in file included from

in file included from

in file included from
 
AW: c++ unfähig windows.h zu includen

Nutzt du Linux? Sieht so aus, wo hast du also das Windows SDK her?
Eigentlich dürfte kein Fehler auftreten dabei.
 
AW: c++ unfähig windows.h zu includen

Danke euch beiden für die Antworten.
@Crysis nerd: nope benutze kein Linux
@chregubr85: hat leider nichts gebracht

Was aber geholfen hat war das ganze in MV2010 Express zu schmeißen :what: naja soll mir egal sein dann mach ich halt damit weiter :daumen:
Danke nochmal für die Hilfe :)
 
Zurück