请教:
我新建了一个 win32 applicaton 工程(带hello world)的,
工程名为 Xiaogw , 工程建后是能编译的
然后我新建 CPP H 两个文件夹
把 xiaogw.cpp stdafx.cpp 放到 CPP
xiaogw.h stdafx.h resorce.h放 H 文件夹可是编译有错啊--------------------Configuration: XiaoGW - Win32 Debug--------------------
Compiling resources...
C:\小股王2\XiaoGW\XiaoGW.rc(4) : fatal error RC1015: cannot open include file '..\H\resource.h'.
Error executing rc.exe.
C:\小股王2\XiaoGW\XiaoGW.rc(4): Could not find the file ..\H\resource.h.XiaoGW.exe - 1 error(s), 0 warning(s)
//Microsoft Visual C++ generated resource script.
//#include "..\H\resource.h"#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
这是什么原因啊?
谢谢!

解决方案 »

  1.   

    简单问题. 说不清楚.
    #include "..\H\resource.h"
    H绝对路径在哪?
      

  2.   

    谢谢
    删除了的

    C:\小股王2\XiaoGW\H
      

  3.   

    H目录在C:\小股王2\XiaoGW\H
    那么在 :C:\小股王2\XiaoGW\XiaoGW.rc
    应该#include "H\resource.h"
      

  4.   

    --------------------Configuration: XiaoGW - Win32 Debug--------------------
    Compiling resources...
    Compiling...
    StdAfx.cpp
    c:\小股王2\xiaogw\cpp\stdafx.cpp(9) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    XiaoGW.cpp
    c:\小股王2\xiaogw\cpp\xiaogw.cpp(192) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    Generating Code...
    Error executing cl.exe.XiaoGW.exe - 2 error(s), 0 warning(s)
    修改后变为这样的了啊谢谢!
      

  5.   

    从工程文件列表中删除这几个文件后重新添加进去,还有就是到所有文件中看看#include 语句是否与文件的现在路径是否对应,例如把#include "stdafx.h"改为#include ".\\H\\stdafx.h"