我在Debug版本中可以正常运行,但当我静态编译为Relase版本后,运行起来就会出现错误!

解决方案 »

  1.   

    继续检查你的程序吧debug版本会忽略或是自动修复一些错误而release 版本没有这些调试代码 不做这些工作说明你的程序还是有漏洞
      

  2.   

    你的问题比较笼统,说说我遇到的同样情况处理办法,供你参考:一种时序问题,第二种是变量没有初始化,因为Debug版和release 版对没有初始化的变量处理是不同的,在Debug下正常的程序,在Release版就可能出现严重错误。排错还是很花了一些时间。
      

  3.   

    注意初始化变量;将warning lerver 设为4 重新编译不放过任何警告。
      

  4.   

    First-chance exception in DataCenter.exe (KERNEL32.DLL): 0x000006BA: (no name).
    就是这个问题!大家请帮忙
      

  5.   

    再编译过程中如下:
    --------------------Configuration: DataCenter - Win32 Release--------------------
    Compiling resources...
    Compiling...
    StdAfx.cpp
    e:\vc程序\datacenter\release\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
    Compiling...
    ColorStatic.cpp
    DataCenter.cpp
    DataCenterDoc.cpp
    DataCenterView.cpp
    DealData.cpp
    E:\VC程序\DataCenter\DealData.cpp(87) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
    DlgColor.cpp
    DlgDB.cpp
    DlgGME1.cpp
    DlgPort.cpp
    LeftView.cpp
    ListenSck.cpp
    MainFrm.cpp
    RecvSck.cpp
    E:\VC程序\DataCenter\RecvSck.cpp(39) : warning C4154: deletion of an array expression; conversion to pointer supplied
    RegGME.cpp
    ShowDlg.cpp
    Generating Code...
    Linking...DataCenter.exe - 0 error(s), 3 warning(s)
      

  6.   

    你把这个警告去掉试一试!
    E:\VC程序\DataCenter\RecvSck.cpp(39) : warning C4154: deletion of an array expression; conversion to pointer supplied
    不能在数组上使用 delete,所以编译器将数组转换为指针。
    code1 产生警告:
    int array[ 10 ];
    delete array; 
    code2 正确的写法:
    去掉delete array;因为你没有用到new,它会自己释放的。