cannot open source input file "RTL.h": No such file or directory

展开阅读全文

Cannot open include file : 'strsafe.h': No such file or directory

03-29

编译的时候出现错误,怎么解决? 哪位大虾指教一下:rn----------Configuration: iseldr - Win32 Debug----------rnCompiling...rniseldr.cpprnc:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\iseldr.cpp(15) : fatal error C1083: Cannot open include file : 'strsafe.h': No such file or directoryrn执行 cl.exe 时出错.rnrniseldr.obj - 1 error(s), 0 warning(s)rnrn源代码是从微软网站上找的,不知道为何编译出错。。。郁闷ing....rnrn/* You can build the following code sample by using the following command-line arguments after you select the correct build environment, such as XP Checked:rnrncl -nologo -DUNICODE -link setupapi.librnrnNOTE: represents the name of the source file.rn*/rnrn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#include rnrn#define SIZECHARS(x) (sizeof((x))/sizeof(TCHAR))rn//rn// The following is the prototype for the newdev!InstallSelectedDriver API.rn//rntypedefrnBOOLrn(*PINSTALLSELECTEDDRIVER)(rn HWND hwndParent,rn HDEVINFO DeviceInfoSet,rn LPCWSTR Reserved,rn BOOL Backup,rn PDWORD pReboot rn );rnrnrnintrn__cdeclrnwmain(rn IN int argc,rn IN WCHAR *argv[]rn )rnrn DWORD Err = NO_ERROR;rn HDEVINFO DeviceInfoSet = INVALID_HANDLE_VALUE;rn SP_DEVINFO_DATA DeviceInfoData;rn SP_DRVINFO_DATA DriverInfoData;rn SP_DEVINSTALL_PARAMS DeviceInstallParams;rn TCHAR NewDevPath[MAX_PATH];rn HMODULE hNewDev = NULL;rn PINSTALLSELECTEDDRIVER pInstallSelectedDriver = NULL;rn DWORD Reboot;rnrn //rn // The command line will contain a device instance Id and a fullrn // path of an INF.rn //rn if (argc < 3) rn printf("Usage: iseldr \"device instance id\" \"full path to the INF file\"\n");rn return ERROR_INVALID_PARAMETER;rn rnrn printf("%ws\n", argv[1]);rn printf("%ws\n", argv[2]);rnrn //rn // Create an empty device information list.rn //rn DeviceInfoSet = SetupDiCreateDeviceInfoList(NULL, NULL);rn if (DeviceInfoSet == INVALID_HANDLE_VALUE) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Add the device that is referenced by the device instance id parameterrn // to the device information list.rn //rn DeviceInfoData.cbSize = sizeof(DeviceInfoData);rn if (!SetupDiOpenDeviceInfo(DeviceInfoSet,rn (PCWSTR)argv[1],rn NULL,rn 0,rn &DeviceInfoData)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // InstallSelectedDriver works on the selected device and on thern // selected driver on that device. Therefore, set this device as thern // selected one in the device information list.rn //rn if (!SetupDiSetSelectedDevice(DeviceInfoSet,rn &DeviceInfoData)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // You now have a SP_DEVINFO_DATA structurern // representing your device. Next, get a SP_DRVINFO_DATArn // structure to install on that device.rn //rn DeviceInstallParams.cbSize = sizeof(DeviceInstallParams);rn if (!SetupDiGetDeviceInstallParams(DeviceInfoSet,rn &DeviceInfoData,rn &DeviceInstallParams)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Only build the driver list out of the passed-in INF. rn // To do this, set the DI_ENUMSINGLEINF flag, and copy thern // full path of the INF into the DriverPath field of the rn // DeviceInstallParams structure.rn //rn DeviceInstallParams.Flags |= DI_ENUMSINGLEINF;rn if (FAILED(StringCchCopy(DeviceInstallParams.DriverPath,rn SIZECHARS(DeviceInstallParams.DriverPath),rn argv[2]))) rn //rn // The file path that was passed in was too big.rn //rn Err = ERROR_INVALID_PARAMETER;rn goto clean0;rn rnrn //rn // Set the DI_FLAGSEX_ALLOWEXCLUDEDDRVS flag so that you can usern // this INF even if it is marked as ExcludeFromSelect.rn // ExcludeFromSelect means do not show the INF in the legacy Add rn // Hardware Wizard.rn //rn DeviceInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS;rnrn if (!SetupDiSetDeviceInstallParams(DeviceInfoSet,rn &DeviceInfoData,rn &DeviceInstallParams)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Build up a Driver Information List from the specified INF.rn // Build a compatible driver list, meaning only include thern // driver nodes that match one of the hardware or compatible Ids of rn // the device.rn //rn if (!SetupDiBuildDriverInfoList(DeviceInfoSet,rn &DeviceInfoData,rn SPDIT_COMPATDRIVER)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Pick the best driver in the list of drivers that was built.rn //rn if (!SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV,rn DeviceInfoSet,rn &DeviceInfoData)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Get the selected driver node.rn // Note: If this list does not contain any drivers, this callrn // will fail with ERROR_NO_DRIVER_SELECTED.rn //rn DriverInfoData.cbSize = sizeof(DriverInfoData);rn if (!SetupDiGetSelectedDriver(DeviceInfoSet,rn &DeviceInfoData,rn &DriverInfoData)) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // At this point, you have a valid SP_DEVINFO_DATA structure and arn // valid SP_DRVINFO_DATA structure.rn // Load newdev.dll, GetProcAddress(InstallSelectedDriver), and call rn // that API.rn //rn // To be more secure, make sure to load the newdev.dll file from thern // system 32 directory.rn //rn if (GetSystemDirectory(NewDevPath, SIZECHARS(NewDevPath)) == 0) rn Err = GetLastError();rn goto clean0;rn rnrn if (FAILED(StringCchCat(NewDevPath, SIZECHARS(NewDevPath), TEXT("\\NEWDEV.DLL")))) rn Err = ERROR_INSUFFICIENT_BUFFER;rn goto clean0;rn rnrn hNewDev = LoadLibrary(NewDevPath);rn if (!hNewDev) rn Err = GetLastError();rn goto clean0;rn rnrn pInstallSelectedDriver = (PINSTALLSELECTEDDRIVER)GetProcAddress(hNewDev, "InstallSelectedDriver");rn if (!pInstallSelectedDriver) rn Err = GetLastError();rn goto clean0;rn rnrn //rn // Call pInstallSelectedDriver to install the selected driver onrn // the selected device.rn //rn pInstallSelectedDriver(NULL,rn DeviceInfoSet,rn NULL,rn TRUE,rn &Reboot);rnrn if (Reboot & (DI_NEEDREBOOT | DI_NEEDRESTART)) rn //rn // A reboot is required.rn //rn rnrnclean0:rn if (hNewDev) rn FreeLibrary(hNewDev);rn hNewDev = NULL;rn rnrn if (DeviceInfoSet != INVALID_HANDLE_VALUE) rn SetupDiDestroyDeviceInfoList(DeviceInfoSet);rn DeviceInfoSet = INVALID_HANDLE_VALUE;rn rnrn printf("iseldrv returned 0x%X\n", Err);rn return Err;rnrn 论坛

Cannot open include file: 'mstcpip.h': No such file or directory

11-29

代码如下:rn#include "stdio.h"rn#include rn#include rn#include rnrn#pragma comment(lib,"Ws2_32.lib")rnrn#include rnusing namespace std;rnrn//IP首部rntypedef struct tIPPackHeadrnrn enum PROTOCOL_TYPErn PROTOCOL_TCP = 6,rn PROTOCOL_UDP = 17,rn PROTOCOL_ICMP = 1,rn PROTOCOL_IGMP = 2 rn ;rn inline unsigned HeadLen() constrn rn //首部长度单位为4bytes。因此乘4rn return (ver_hlen & 0x0F) << 2;rn rn inline unsigned PackLen() constrn rn return wPacketLen;rn rn BYTE ver_hlen; //IP协议版本和IP首部长度。高4位为版本,低4位为首部的长度(单位为4bytes)rn BYTE byTOS; //服务类型rn WORD wPacketLen; //IP包总长度。包括首部,单位为byte。[Big endian]rn WORD wSequence; //序号,一般每个IP包的序号递增。[Big endian]rn WORD wMarkFragPoi; rn BYTE byTTL; //生存时间 rn BYTE byProtocolType; //协议类型,见PROTOCOL_TYPE定义rn WORD wHeadCheckSum; //IP首部校验和[Big endian]rn DWORD dwIPSrc; //源地址rn DWORD dwIPDes; //目的地址rn IP_PK_HEAD;rnrnrnint DecodeIP(char *buf, int len);rnrnint DecodeIP(char *buf, int len)rnrn int n = len;rnrn if( n >= sizeof(IP_PK_HEAD) )rn rn IP_PK_HEAD iphead;rn memcpy( &iphead, buf, sizeof(iphead) );rnrn //以下三个为Big Endian字节顺序,转换成主机字节顺序rn iphead.wPacketLen = ntohs( iphead.wPacketLen );rn iphead.wSequence = ntohs( iphead.wSequence );rn iphead.wHeadCheckSum = ntohs( iphead.wHeadCheckSum );rnrn in_addr src,dst;rn src.S_un.S_addr = iphead.dwIPSrc;rn dst.S_un.S_addr = iphead.dwIPDes;rnrn char strsrc[20],strdst[20];rn strcpy(strsrc, inet_ntoa(src));rn strcpy( strdst , inet_ntoa(dst));rnrn printf( "IP数据包: ver=%d,hlen=%d,protocol=%d,pklen=%d,seq=%d,src=%s,dst=%s _fcksavedurl=%s,dst=%s",rn iphead.ver_hlen >> 4,rn (iphead.ver_hlen & 0x0F) << 2,rn iphead.byProtocolType,rn iphead.wPacketLen,rn iphead.wSequence,rn strsrc,rn strdst );rn rnrn return 0;rnrnrnvoid AutoWSACleanup()rnrn ::WSACleanup();rnrnrnint main()rnrn //初始化winsock库,使用2.2版本rn u_short wVersionRequested = 0x0202;rn WSADATA wsaData;rn if( SOCKET_ERROR == WSAStartup( wVersionRequested, &wsaData ) )rn rn cout << WSAGetLastError();rn return 0;rn rn atexit( AutoWSACleanup );rnrn //创建SOCKETrn SOCKET h = socket( AF_INET, SOCK_RAW, IPPROTO_IP);rn if( h == INVALID_SOCKET )rn rn cout << WSAGetLastError();rn return 0;rn rnrn //获取本机地址rn char FAR name[128]; rn if( -1 == gethostname(name, sizeof(name)) )rn rn closesocket( h );rn cout << WSAGetLastError();rn return 0;rn rnrn struct hostent FAR * pHostent;rn pHostent = gethostbyname(name);rnrn //绑定本地地址到SOCKET句柄rn sockaddr_in addr;rn addr.sin_family = AF_INET;rn addr.sin_addr = *(in_addr*)pHostent->h_addr; //IPrn addr.sin_port = 0; //端口,IP层端口可随意填rn if( SOCKET_ERROR == bind( h,(sockaddr *)&addr,sizeof(addr) ) )rn rn closesocket( h );rn cout << WSAGetLastError();rn return 0;rn rnrn //设置该SOCKET为接收所有流经绑定的IP的网卡的所有数据,包括接收和发送的数据包rn //该函数在mstcpip.h里面,详见MSDN帮助rn u_long sioarg = 1;rn DWORD wt=0;rn if( SOCKET_ERROR == WSAIoctl( h, SIO_RCVALL , &sioarg,sizeof(sioarg),NULL,0,&wt,NULL,NULL ) )rn rn closesocket( h );rn cout << WSAGetLastError();rn return 0;rn rnrn //我们只需要接收数据,因此设置为阻塞IO,使用最简单的IO模型rn u_long bioarg = 0;rn if( SOCKET_ERROR == ioctlsocket( h, FIONBIO , &bioarg ) )rn rn closesocket( h );rn cout << WSAGetLastError();rn return 0;rn rnrn //开始接收数据rn //因为前面已经设置为阻塞IO,recv在接收到数据前不会返回。rn //当返回<=0时表示接收失败,退出循环rn //可以在另一个线程执行此循环,主线程closesocket可以使recv失败而结束循环rn char buf[102400];rn int len = 0;rn dorn rn len = recv( h, buf, sizeof(buf),0);rn if( len > 0 )rn rn DecodeIP( buf, len );rn rn while( len > 0 );rnrn closesocket( h );rnrn return 0;rnrn请大侠帮忙,说找不到这个include rn是不是,我缺少什么,需要下载安装什么?谢谢!rn 论坛

Cannot open include file: 'd3dwnd.h': No such file or directory

09-07

头文件rn[code=C/C++]#include "afxwin.h"rn#include "d3d9.h"rnrn#include "d3dx9math.h"rn#pragma comment(lib,"d3d9.lib")rnrnclass CD3DWnd: public CWndrnrnpublic:rn CD3DWnd();rnrnpublic:rn virtual ~CD3DWnd();rnprotected:rn LPDIRECT3D9 m_pD3D;//Direct3D对象的指针rn LPDIRECT3DDEVICE9 m_pDevice;//设备对象的接口指针rn void InitD3D();//这个函数用来初始化Direct3Drnrn;rnCPP文件rn[/code]rnrn[code=C/C++]#include "stdafx.h"rn#include "direct.h"rn#include "d3dwnd.h"rnrn#include "CD3DWnd.h"rnrnrnCD3DWnd::CD3DWnd()rnrnrnrnCD3DWnd::~CD3DWnd()rnrnrnrnvoid CD3DWnd::InitD3D()rnrn //创建D3D对象,并获取接口 IDirect3D9的指针rn //我们将通过指针操作该对象rn m_pD3D=::Direct3DCreate9(D3D_SDK_VERSION);rnrn D3DPRSENT_PARAMETERS d3dpp;rn ::ZeroMemory(&d3dpp,sizeof(d3dpp));rn d3dpp.Windowed=TRUE;//创建窗口模式的Direct3D程序rn d3dpp.SwapEffect=D3DSWAPEFFECT_DISCARD;rn d3dpp.BackBuffFormat=D3DFMT_UNKNOWN;rnrn //调用方法IDirect3D9::CreateDevice创建设备对象并获取rn //接口IDirect3DDevice9的指针,我们将通过该指针操作设备对象rn m_pD3D->CreateDevice(rn D3DADAPTER_DEFAULT,//使用缺省的显卡rn D3DDEVTYPE_HAL,//指定设备类型为HALrn m_hWnd, //窗口句柄rn D3DCREATE_SOFTWARE_VERTEXPROCESSING,//软件顶点处理rnrn &d3dpp,&m_pDevce);rnrn[/code]rn:\MY\direct\CD3DWnd.cpp(3) : fatal error C1083: Cannot open include file: 'd3dwnd.h': No such file or directoryrnGenerating Code...rnCompiling...rndirect.cpprnGenerating Code...rnCompiling...rnMainFrm.cpprnGenerating Code...rn执行 cl.exe 时出错.rnCreating browse info file...rnBSCMAKE: error BK1506 : cannot open file '.\Debug\CD3DWnd.sbr': No such file or directoryrn好象始终找不到d3dwnd.h这个文件,我也装了SDK了,设置,LINK都看了,都没问题rn是还要装什么插件么 论坛

ld: cannot open crtbegin.o: No such file or directory

01-06

$makerng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX -I/home/tuxedo/tuxedo81/include -c /home/banknh/Source/Serverjx/mwc.c -o /home/banknh/Source/Serverjx/mwc.orng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX -I/home/tuxedo/tuxedo81/include -c /home/banknh/Source/Serverjx/common.c -o /home/banknh/Source/Serverjx/common.orng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX -I/home/tuxedo/tuxedo81/include -c /home/banknh/Source/Serverjx/clipub.c -o /home/banknh/Source/Serverjx/clipub.orng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX -I/home/tuxedo/tuxedo81/include -I/home/banknh/Source/Server -I/home/banknh/Source/Common -c /home/banknh/Source/Serverjx/sckplus.cpp -o /home/banknh/Source/Serverjx/sckplus.orng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX -I/home/tuxedo/tuxedo81/include -I/home/banknh/Source/Server -I/home/banknh/Source/Common -c /home/banknh/Source/Serverjx/myclient.cpp -o /home/banknh/Source/Serverjx/myclient.ornrm -f /home/banknh/bin/myclient.ernecho /home/tuxedo/tuxedo81/lib -lwsc -lbuft -lwsc -lnws -lnwi -lnws -lfml -lfml32 -lgp -belf -lnsl -lsocketrn/home/tuxedo/tuxedo81/lib -lwsc -lbuft -lwsc -lnws -lnwi -lnws -lfml -lfml32 -lgp -belf -lnsl -lsocketrng++ -g -m32 -fno-defer-pop -pg -DMW_TUXEDO -DTRAN_NONE -D_DEBUG_ -DSHMNUM=500 -D_NS_STD -I/home/tuxedo/tuxedo81/include -DFOR_JX /home/banknh/Source/Serverjx/mwc.o /home/banknh/Source/Serverjx/common.o /home/banknh/Source/Serverjx/clipub.o /home/banknh/Source/Serverjx/sckplus.o /home/banknh/Source/Serverjx/myclient.o -L/home/tuxedo/tuxedo81/lib -lwsc -lbuft -lwsc -lnws -lnwi -lnws -lfml -lfml32 -lgp -belf -lnsl -lsocket -o /home/banknh/bin/myclient.ernld: cannot open crtbegin.o: No such file or directoryrnmake: *** [MYCLIENT] Error 1rnrn$ g++ -vrnReading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specsrnConfigured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linuxrnThread model: posixrngcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)rnrnrnuname -arnLinux jxbank 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linuxrnrn$ locate crtbegin.orn/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/crtbegin.orn/lib/ssa/gcc-lib/i386-redhat-linux-gnu/3.5-tree-ssa/crtbegin.ornrn我的是redhat linux as 3.0 安装系统自带的gcc安装包.编译程序出现rnld: cannot open crtbegin.o: No such file or directoryrn没找到解决方法.编译成.o没有问题.就是连接成可执行文件时出现这个错误.rnrn 论坛

没有更多推荐了,返回首页