注册 登录
编程论坛 C++教室

c程序调试出现错误,怎么解决?

黑哥 发布于 2013-11-01 18:30, 742 次点击
//------begain from-------//
#include"stdafx.h"
#include"windows.h"
#include
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
void CheckIP(void)
{
     WORD wVersionrequested;
   
     WSADATA wsaData;
     
     char name[255];
     
     CSrring ip;
   
     PHOSTENT hostinfo;
     
     wVersionRequested =MAKEWORD(2,0);
     if(WSAStartup(wVersionREQuested,&wsadata)==0)
     {
        if(gethostname(name,sizof(name))==0)
        {
           if(hostinfo =gethostbyname(name))!=NU;;)
           {
            LPCSTR ip = inet_ntoa(*(structin_addr*)*hostinfo->h_addr_list);
            printf("%s\n",ip);
            WSACleanup();
           }
        }
     }

}
int main(int argc,char*argv[])
{
    CheckIP();
    return0;
}
调试出现这个问题:d:\microsoft visual studio\vc98\atl\include\atlbase.h(15) : fatal error C1189: #error :  ATL requires C++ compilation (use a .cpp suffix)
Error executing cl.exe.
不知道怎么解决
2 回复
#2
黑哥2013-11-01 18:31
急急
#3
blueskiner2013-11-01 19:42
不是告诉你了吗?ATL需要C++编译器,请使用.cpp后缀的文件进行代码编写
1