我在编译的时候出了一个问题:
D:\driver\sourceinsight\循序渐进学用系列 学用Visual C++ 6_0_10028545\Timers\TimersDlg.cpp(219) : error C2601: 'OnStarttimer' : local function definitions are illegal
D:\driver\sourceinsight\循序渐进学用系列 学用Visual C++ 6_0_10028545\Timers\TimersDlg.cpp(230) : error C2601: 'OnStoptimer' : local function definitions are illegal
D:\driver\sourceinsight\循序渐进学用系列 学用Visual C++ 6_0_10028545\Timers\TimersDlg.cpp(237) : error C2601: 'OnChangeInterval' : local function definitions are illegal
D:\driver\sourceinsight\循序渐进学用系列 学用Visual C++ 6_0_10028545\Timers\TimersDlg.cpp(246) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
但我不知道错在哪儿?谢谢高手指点。

解决方案 »

  1.   

    是不是头文件里面的函数申明和cpp里的函数申明不一样呀
      

  2.   

    把函数定义在了 {} 里面,比如:
    {
        void f()
        {
        }
    }
      

  3.   

    OnStarttimer函数前面一个函数少了一个大括号“}”
      

  4.   

    查一下OnStarttimer()函数前面的那个函数的{}是否匹配,很可能你写它的时候少加了或者误删了“}”。比如;
    void f1()
    {
      for (...)
      {
    }void f2()
    {
    }
      

  5.   

    1.括号不匹配
    2.最后一个错误添加#include "stdafx.h"
      

  6.   

    去掉错误添加#include "stdafx.h"
    又多出这个错误:
    d:\driver\sourceinsight\循序渐进学用系列 学用visual c++ 6_0_10028545\timers\timersdlg.cpp(246) : fatal error C1010: unexpected end of file while looking for precompiled header directive