刚刚学习VC,对其还不是太熟悉。最近遇到一个问题,就是我想在fileview中添加一个文件夹,这个文件夹中包含有我需要的头文件和源文件,在对话框中调用这些文件,但是编译器总是给出“This is an unexpected end of file”.查了很多资料都没有解决,哪位高手帮指点一下啊~~~
 注:编写的是在MFC下基于对话框的程序,对话框头文件在Headfiles中,源文件在Sourcefile中,我想要调用的文件在新建的文件夹中,如何在对话框的程序里调用新建文件夹的文件? 

解决方案 »

  1.   

    直接工程上右键添加现有文件,或者include具体文件路径
      

  2.   

    编译信息打全了。
    在对话框中调用这些文件?!是#include吗?
      

  3.   

    不正常的结尾,你看看是不是少了什么{}或者是#ifdefine #endif没有配对?
      

  4.   

    典型的原因:
    新添加的cpp文件最上面加上#include "stdafx.h"
      

  5.   

    编译错误是“fatal error C1010: unexpected end of file while looking for precompiled header directive”
      

  6.   

    加上include "stdafx.h"又出现一大堆错误呀
      

  7.   

    设置里,选中你编译出这个错的源文件,c/c++,precompiled headers选not using
      

  8.   

    这段代码只是其中头文件的一个
    #include "Global.h"
    // Global variable 
    WriteByte WriteByteFunction;
    int Global::advanced=0;
    int Global::cpels=0;
    //FILE * Global::debugf=0;
    int Global::headerlength=0;
    int Global::lines=0;
    int Global::long_vectors=0;
    int Global::mbc=0;
    int Global::mbr=0;
    FILE * Global::mv_file=0;
    int Global::mv_outside_frame=0;
    int Global::pb_frames=0;
    int Global::pels=0;
    int Global::search_p_frames=0;
    size_t Global::sizeof_frame=0;
    float Global::target_framerate=0;
    FILE * Global::tf=0;
    int Global::trace=0;
    int Global::uskip=0;
    int Global::vskip=0;
    Pict* Global::pic=NULL;
      

  9.   

    FileView中的文件夹只是管理不牵扯编译
    你的问题应该是stdafx.h的问题
    如果说添加stdafx.h又出现芯的问题就说明代码有错误