24小时热门版块排行榜    

查看: 1809  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 朋友圈看到的 +7 wangzilk 2026-08-18 9/450 2026-08-24 10:50 by cmrandy
[基金申请] 能否退出参与的面上项目解除限项 +11 koalala 2026-08-24 13/650 2026-08-24 10:49 by anjeeshine
[基金申请] 放榜前的不淡定 20+4 snowwithsea 2026-08-19 17/850 2026-08-24 10:20 by echo8914667
[基金申请] 明天应该可查了!? +4 chengyan1220 2026-08-23 4/200 2026-08-24 08:47 by gloomy6159
[基金申请] 建议基金发布提前给出明确的时间点 +11 kulium 2026-08-21 14/700 2026-08-24 02:12 by 流流伤
[基金申请] 2026国自然函评费到账 +16 羊腰板 2026-08-21 17/850 2026-08-23 23:02 by tianxiaochun
[基金申请] 2026年的国家社科基金项目通讯评审的新规则与新动向、新挑战 +4 process2012 2026-08-23 5/250 2026-08-23 19:58 by jurkat.1640
[基金申请] 今天放榜吗? +15 布布和一二 2026-08-19 16/800 2026-08-23 09:55 by 张春生
[基金申请] 只有每年这种时候来逛逛小木虫 +24 yaoyewhu2008 2026-08-20 26/1300 2026-08-22 17:43 by kammury
[基金申请] 人气不行了 +8 fansofjerry 2026-08-21 8/400 2026-08-22 16:30 by zyqchem
[基金申请] 今天基金会出结果吗?20260819 +16 kkkl_v 2026-08-19 17/850 2026-08-22 16:12 by 阿布Abu
[基金申请] 时间戳今天,20号变了 +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[基金申请] 时间戳又变了 +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by 紫杉醇
[基金申请] 我面上完蛋了 +7 且听虎啸 2026-08-20 8/400 2026-08-21 12:31 by 酷酷墨镜
[基金申请] 应该是下周三26日公布了吧? +4 哈哈蛤? 2026-08-21 4/200 2026-08-21 10:58 by Vivilian
[论文投稿] 投稿咨询 +5 wwm09 2026-08-17 7/350 2026-08-21 10:11 by 期刊论文帮手
[基金申请] 今天放榜没戏了吧 +9 yuleib84 2026-08-19 11/550 2026-08-21 10:06 by gltch
[基金申请] 基金啊基金 +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
[基金申请] 估计是周四 +3 archvillain 2026-08-18 3/150 2026-08-21 01:48 by jnhyjjm
[基金申请] 今天维护系统维护 祝所有人 高中 +8 gjjjzhong 2026-08-18 9/450 2026-08-18 13:01 by 家与远方
信息提示
请填处理意见