24小时热门版块排行榜    

查看: 1440  |  回复: 8

swustxxl

金虫 (正式写手)

[交流] 【求助】VC++数值算法集应用到MFC中报错,程序调试求助

这是数值算法集中的一个程序,需要将其应用到MFC应用程序中,原程序为WIN32控制台应用程序,运行一切正常,但转换成MFC对话框应用程序时报错,鄙人对VC编程不甚精通,特发帖求助,高手一看程序便知,谢谢




http://www.namipan.com/d/xxl11.r ... 6c70e03867c29471c00
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

magic7004

金虫 (职业作家)


余泽成(金币+1):谢谢参与应助! 2010-09-21 11:07:08
swustxxl(金币+1): 多谢 2011-02-19 09:39:28
那楼主就把有用的部分copy(或者#include)到MFC的应用程序中,就可以了啊。

console和MFC的框架是不一样的,不能直接转换的。
流氓不可怕,可怕的是流氓有文化,有文化又BH的流氓无敌~~!
2楼2010-09-21 09:45:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jason.masc

铜虫 (初入文坛)

需要加入MFC的预编译头文件


余泽成(金币+1):谢谢参与应助! 2010-09-21 16:59:10
swustxxl(金币+1): 1 2011-02-19 09:39:36
请在所有的*.cpp文件的开头,加上#include "stdafx.h"
C++无所不能
3楼2010-09-21 16:15:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

swustxxl

金虫 (正式写手)

引用回帖:
Originally posted by magic7004 at 2010-09-21 09:45:25:
那楼主就把有用的部分copy(或者#include)到MFC的应用程序中,就可以了啊。

console和MFC的框架是不一样的,不能直接转换的。

仔细看看我上传的程序好吗?编译可以通过,连接报错
4楼2010-09-21 18:16:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

swustxxl

金虫 (正式写手)

引用回帖:
Originally posted by jason.masc at 2010-09-21 16:15:01:
请在所有的*.cpp文件的开头,加上#include "stdafx.h"

仔细看看我上传的程序好吗,我的每个CPP文件可都是有这个语句的
5楼2010-09-21 18:17:55
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jason.masc

铜虫 (初入文坛)

swustxxl(金币+1): 多谢 2011-02-19 09:39:48
我觉得你其实可以把错误信息直接贴出来,毕竟VC6.0在Win7下无法进行编译和连接。很多连接的错误其实从信息上就可以判断出来的。
C++无所不能
6楼2010-09-21 20:19:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jason.masc

铜虫 (初入文坛)


余泽成(金币+1):谢谢参与应助! 2010-09-23 18:50:29
swustxxl(金币+1): 多谢 2011-02-19 09:39:58
1.请在工程的include目录下加入你自己工程的include文件夹目录。
2.加入后,在VC6.0下应该会通过,但如果在VC2005以上版本,请在for语句内加入对变量i的临时定义。
C++无所不能
7楼2010-09-21 20:30:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

swustxxl

金虫 (正式写手)

引用回帖:
Originally posted by jason.masc at 2010-09-21 20:30:19:
1.请在工程的include目录下加入你自己工程的include文件夹目录。
2.加入后,在VC6.0下应该会通过,但如果在VC2005以上版本,请在for语句内加入对变量i的临时定义。

include目录下添加了相应文件,否则编译是通不过的;我的操作系统是XP2,用的是VC++6.0,我的程序需要面对的是一堆和我机子配置差不多的老机型和老操作系统以及比我自己好的新机型和新操作系统。所有的报错都是出现在之前没有任何改动的原程序文件中

--------------------Configuration: XXL11 - Win32 Debug--------------------
Compiling...
XXL11Dlg.cpp
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
        c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(41) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
        c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2065: '_P' : undeclared identifier
Error executing cl.exe.

XXL11.exe - 11 error(s), 0 warning(s)
8楼2010-09-22 11:42:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jason.masc

铜虫 (初入文坛)


余泽成(金币+1):谢谢参与应助! 2010-09-23 18:51:22
swustxxl(金币+1): 1 2011-02-19 09:40:05
不要添加相应文件,只需要添加include目录,并将添加好的目录优先级设置为最高
C++无所不能
9楼2010-09-22 11:52:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 swustxxl 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见