Problem mit IcmpCreateFile

  • Themenstarter Themenstarter Amarr
  • Beginndatum Beginndatum
A

Amarr

Hallo,
ich sitze zur Zeit an einem Schulprojekt und zwar muss ich einen IP und Portscanner in C++ programmieren.
Da meine Vorkenntnisse nicht so überragend sind hänge ich im Moment an einem Problem fest und weis einfach nicht mehr weiter.

Ich benutze zum Programmieren Eclipse IDE for C/C++ und MinGW, mein OS ist Windows7 32bit.

Mein Problem ist nun, dass ich obwohl libws2_32.a und libiphlpapi.a über den linker eingebunden sind immernoch die Fehlermeldung

workspace/win/Debug/../win.cpp:109: undefined reference to `IcmpCreateFile@0'

bekomme. Hier mal meinem Quellcode:

#include <windows.h>
#include <stdio.h>
#include <winsock2.h>
#include <io.h>
#include <string.h>
#include <iostream>
#include <iphlpapi.h>
#include <ipexport.h>
#include "icmpapi.h" // Da die icmpapi.h nicht dabei war habe ich sie von http://www.koders.com/c/fidB304BDC3036C040B5B1063271EC986BDC9957618.aspx?s=windows.h genommen.

using namespace std;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

void IntToString(int i, char* buffer)
{
sprintf(buffer, "%d", i);
}

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szComLine, int iCmdShow){
char szName[] = "Fenster";
char szTitel[] = "ScanU";

int xPos = 0;
int yPos = 0;
int xSize = 600;
int ySize = 400;
HBRUSH bgColor = CreateSolidBrush(RGB(180,120,90));
WNDCLASS wc;

wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hI;
wc.hIcon = LoadIcon (NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = bgColor;
wc.lpszMenuName = NULL;
wc.lpszClassName = szName;

RegisterClass (&wc);

HWND hwnd = CreateWindow (szName, szTitel, WS_OVERLAPPEDWINDOW, xPos, yPos, xSize, ySize, NULL, NULL, hI, NULL);
HWND BCX_Listbox(char*,HWND,int,int,int,int,int,int=0,int=-1);
ShowWindow (hwnd, iCmdShow);
UpdateWindow (hwnd);

MSG msg;
while(GetMessage (&msg, NULL, 0, 0)){
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
HDC hdc;
PAINTSTRUCT ps;
static HWND hwndButton1, hwndButton2, sIP, eIP, sPort, ePort, list1, list2;
char vIP[16], bIP[16];
struct sockaddr_in addr;
unsigned long start, end, temp;

HANDLE IcmpFile;
DWORD ReturnValue = 0;
char SendData[] = "Ping";
LPVOID ReplyBuffer = NULL;
DWORD ReplySize = 0;

switch (message){
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps);
SetTextColor(hdc,RGB(0,0,0));
SetBkColor(hdc,RGB(180,120,90));
TextOut (hdc, 37, 10, "Start IP:", 9);
TextOut (hdc, 42, 30, "End IP:", 7);
TextOut (hdc, 400, 10, "Start Port:", 11);
TextOut (hdc, 405, 30, "End Port:", 9);
EndPaint (hwnd, &ps);
return (0);
case WM_CREATE:
hwndButton1 = CreateWindow ("button", "Netz Scannen", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 250, 50, 100, 20, hwnd, (HMENU)1,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
hwndButton2 = CreateWindow ("button", "Ports Scannen", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 250, 180, 100, 20, hwnd, (HMENU)2,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
sIP = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 92,10,110,18, hwnd, (HMENU)3, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
eIP = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 92,30,110,18, hwnd, (HMENU)4, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
sPort = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 470,10,50,18, hwnd, (HMENU)5, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
ePort = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 470,30,50,18, hwnd, (HMENU)6, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
list1 = CreateWindow ("listbox", "",WS_CHILD | WS_VISIBLE | LBS_STANDARD, 30, 75, 200, 250, hwnd, (HMENU)7,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE) , NULL);
list2 = CreateWindow ("listbox", "",WS_CHILD | WS_VISIBLE | LBS_STANDARD, 370, 75, 200, 250, hwnd, (HMENU)8,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE) , NULL);
return (0);
case WM_COMMAND:
switch(LOWORD(wParam)){
case 1:
GetWindowText(sIP,vIP,16);
GetWindowText(eIP,bIP,16);
SendMessage(list1, LB_RESETCONTENT, 0, 0);
start = ntohl(inet_addr(vIP));
end = ntohl(inet_addr(bIP));
if (start > end){
temp = start;
start = end;
end = temp;
}
for(temp = start; temp <= end; temp++){
addr.sin_addr.s_addr = htonl(temp);
IcmpFile = IcmpCreateFile();

SendMessage(list1, LB_ADDSTRING, NULL, (LPARAM)inet_ntoa(addr.sin_addr));
}
break;
case 2:
break;
}
return(0);
case WM_DESTROY:
PostQuitMessage (0);
return (0);
}
return DefWindowProc (hwnd, message, wParam, lParam);
}

Ich weis, das man das noch schöner gestallten könnte, aber es erfüllt seinen Zweck. Das Programm ist (soll) eigendlich ganz simpel sein, man gibt die erste und die letzte IP des zu scannenden Bereiches ein und er scannt alles was dazwischen ist und gibt die erreichten IPs in einer liste aus.
Zur Hilfe nehme ich http://msdn.microsoft.com/en-us/library/aa366050(VS.85).aspx aber ich bekomme dieses Problem im Moment nicht gelöst, ein Schulkollege meint es könnte an der library liegen.

Habt ihr vielleicht eine Idee wo der fehler ist?
 
Das war er ursprünglich, ich weis blos nicht ob das geht wenn man nicht angemeldet ist (als Gast) und wie (in anderen Foren geht das mit [code][/code] hab ich hier auch probiert ging aber nicht)

gruß
Amarr
 
So hab mich mal angemeldet.

@ badday: Danke werd ich mal Probieren.

Hier nochmal der formatierte Code:
Code:
#include <windows.h>
#include <stdio.h>
#include <winsock2.h>
#include <io.h>
#include <string.h>
#include <iostream>
#include <iphlpapi.h>
#include <ipexport.h>
#include "icmpapi.h"

using namespace std;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);



void  IntToString(int i, char* buffer)
{
    sprintf(buffer, "%d", i);
}

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szComLine, int iCmdShow){
	char szName[] = "Fenster";
	char szTitel[] = "ScanU";

	int xPos = 0;
	int yPos = 0;
	int xSize = 600;
	int ySize = 400;
	HBRUSH bgColor = CreateSolidBrush(RGB(180,120,90));
	WNDCLASS wc;

	wc.style = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc = WndProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hI;
	wc.hIcon = LoadIcon (NULL, IDI_WINLOGO);
	wc.hCursor = LoadCursor (NULL, IDC_ARROW);
	wc.hbrBackground = bgColor;
	wc.lpszMenuName = NULL;
	wc.lpszClassName = szName;

	RegisterClass (&wc);

	HWND hwnd = CreateWindow (szName, szTitel, WS_OVERLAPPEDWINDOW, xPos, yPos, xSize, ySize, NULL, NULL, hI, NULL);
	HWND BCX_Listbox(char*,HWND,int,int,int,int,int,int=0,int=-1);
	ShowWindow (hwnd, iCmdShow);
	UpdateWindow (hwnd);

	MSG msg;
	while(GetMessage (&msg, NULL, 0, 0)){
		TranslateMessage (&msg);
		DispatchMessage (&msg);
	}
	return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
	HDC hdc;
	PAINTSTRUCT ps;
	static HWND hwndButton1, hwndButton2, sIP, eIP, sPort, ePort, list1, list2;
	char vIP[16], bIP[16];
	struct sockaddr_in addr;
	unsigned long start, end, temp;

	HANDLE IcmpFile;
	DWORD ReturnValue = 0;
	char SendData[] = "Ping";
	LPVOID ReplyBuffer = NULL;
	DWORD ReplySize = 0;

	switch (message){
		case WM_PAINT:
			hdc = BeginPaint (hwnd, &ps);
				SetTextColor(hdc,RGB(0,0,0));
				SetBkColor(hdc,RGB(180,120,90));
				TextOut (hdc, 37, 10, "Start IP:", 9);
				TextOut (hdc, 42, 30, "End IP:", 7);
				TextOut (hdc, 400, 10, "Start Port:", 11);
				TextOut (hdc, 405, 30, "End Port:", 9);
			EndPaint (hwnd, &ps);
			return (0);
		case WM_CREATE:
			hwndButton1 = CreateWindow ("button", "Netz Scannen", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 250, 50, 100, 20, hwnd, (HMENU)1,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			hwndButton2 = CreateWindow ("button", "Ports Scannen", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 250, 180, 100, 20, hwnd, (HMENU)2,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			sIP = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 92,10,110,18, hwnd, (HMENU)3, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			eIP = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 92,30,110,18, hwnd, (HMENU)4, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			sPort = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 470,10,50,18, hwnd, (HMENU)5, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			ePort = CreateWindow("edit","",WS_CHILD | WS_VISIBLE, 470,30,50,18, hwnd, (HMENU)6, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			list1 = CreateWindow ("listbox", "",WS_CHILD | WS_VISIBLE | LBS_STANDARD, 30, 75, 200, 250, hwnd, (HMENU)7,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE) , NULL);
			list2 = CreateWindow ("listbox", "",WS_CHILD | WS_VISIBLE | LBS_STANDARD, 370, 75, 200, 250, hwnd, (HMENU)8,(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE) , NULL);
			return (0);
		case WM_COMMAND:
			switch(LOWORD(wParam)){
				case 1:
					GetWindowText(sIP,vIP,16);
					GetWindowText(eIP,bIP,16);
					SendMessage(list1, LB_RESETCONTENT, 0, 0);
					start = ntohl(inet_addr(vIP));
					end = ntohl(inet_addr(bIP));
					if (start > end){
						temp = start;
						start = end;
						end = temp;
					}
					for(temp = start; temp <= end; temp++){
						addr.sin_addr.s_addr = htonl(temp);
						IcmpFile = IcmpCreateFile();

						SendMessage(list1, LB_ADDSTRING, NULL, (LPARAM)inet_ntoa(addr.sin_addr));
					}
					break;
				case 2:
					break;
			}
			return(0);
		case WM_DESTROY:
			PostQuitMessage (0);
			return (0);
	}
	return DefWindowProc (hwnd, message, wParam, lParam);
}
 
Hi.
#include "icmpapi.h" // Da die icmpapi.h nicht dabei war habe ich sie von http://www.koders.com/c/fidB304BDC3036C040B5B1063271EC986BDC9957618.aspx?s=windows.h genommen.
Wenn die Headerdatei nicht vorhanden ist, dann kannst du davon ausgehen, das die Funktionen die dort deklariert werden nicht in der entsprechenden MinGW Bibliothek vorhanden sind.

Gruß

PS: Man kann übrigens vom Programm nm auflisten lassen welche Symbole in einer Bibliothek definiert sind bzw. referenziert werden:
Code:
nm libiphlpapi.a | findstr /i icmp
00000000 T _GetIcmpStatistics@4
00000000 I __imp__GetIcmpStatistics@4
Eine IcmpCreateFile Funktion ist jedenfalls nicht enthalten.

Aber es hindert einen ja keiner daran direkt die IpHlpApi.lib aus dem Plattform SDK zu verwenden...
 
Zuletzt bearbeitet:
Danke für die Hilfe deepthroat,
aber nun ist ein anderer Fehler aufgetreten, nachdem ich die die lib aus dem SDK eingebunden hatte, hatte ich noch immer den selben fehler, dann habe ich die IcmpAPI.h ausm SDK auch über den Pfad eingebunden, dann war zumindest der erste Fehler weg, dafür sind jetzt eine ganze Reihe anderer Aufgetauch, ich tippe darauf, dass der Compiler das nicht "versteht".

Code:
**** Build of configuration Debug for project win ****

**** Internal Builder is used for build               ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -owin.o ..\win.cpp
In file included from ..\win.cpp:9:
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:118: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:119: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:172: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:173: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:174: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:175: error: `RequestSize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:175: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:176: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:177: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:178: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:178: error: `__out_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:179: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:180: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:181: error: initializer expression list treated as compound expression
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:254: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:255: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:256: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:260: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:262: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:263: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:264: error: `RequestSize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:264: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:265: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:266: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:267: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:267: error: `__out_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:268: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:269: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:270: error: initializer expression list treated as compound expression
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:275: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:276: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:277: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:281: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:283: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:284: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:285: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:286: error: `RequestSize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:286: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:287: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:288: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:289: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:289: error: `__out_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:290: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:291: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:292: error: initializer expression list treated as compound expression
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:298: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:299: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:300: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:304: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:306: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:307: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:308: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:309: error: `RequestSize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:309: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:310: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:311: error: `__in_opt' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:312: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:312: error: `__out_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:313: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:314: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:315: error: initializer expression list treated as compound expression
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:344: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:345: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:345: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:346: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:347: error: initializer expression list treated as compound expression
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:352: warning: `__stdcall__' attribute only applies to function types
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:353: error: `ReplySize' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:353: error: `__in_bcount' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:354: error: `__in' was not declared in this scope
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\IcmpAPI.H:355: error: initializer expression list treated as compound expression
..\win.cpp: In function `LRESULT WndProc(HWND__*, UINT, WPARAM, LPARAM)':
..\win.cpp:111: warning: passing NULL used for non-pointer converting 3 of `LRESULT SendMessageA(HWND__*, UINT, WPARAM, LPARAM)'
..\win.cpp:68: warning: unused variable 'ReturnValue'
..\win.cpp:69: warning: unused variable 'SendData'
..\win.cpp:70: warning: unused variable 'ReplyBuffer'
..\win.cpp:71: warning: unused variable 'ReplySize'
Build error occurred, build is stopped
Time consumed: 3395  ms.

Gibts da ne möglichkeit das verständlich zu machen, oder sollte ich lieber auf VC++ umsteigen? (will ich aber nicht unbedingt)
 
Danke für die Hilfe deepthroat,
aber nun ist ein anderer Fehler aufgetreten, nachdem ich die die lib aus dem SDK eingebunden hatte, hatte ich noch immer den selben fehler, dann habe ich die IcmpAPI.h ausm SDK auch über den Pfad eingebunden, dann war zumindest der erste Fehler weg, dafür sind jetzt eine ganze Reihe anderer Aufgetauch, ich tippe darauf, dass der Compiler das nicht "versteht".
Die Header aus dem SDK kannst du nur mit dem Microsoft Compiler verwenden.

Gruß
 
Zurück