gpt4 book ai didi

cobol - 尝试使用 C++ 程序运行 COBOL .exe

转载 作者:行者123 更新时间:2023-11-30 04:38:00 28 4
gpt4 key购买 nike

我仍在学习如何编程,但我有一个简单的问题。我有以下通过 C++ 运行可执行 COBOL 程序的代码,但我收到 COBOL 错误:251 和 410

#include <iostream>
#include <windows.h>

using namespace std;

int main(){
system("C:\\rmcobol\\runcobol.exe SOLOCAJA.COB c=windows.cfg L=WOWRT.DLL");
cout << "\n";
system("pause");
return 0;
}

我想这一定有一个非常简单的原因,但到目前为止我一无所知。任何帮助将不胜感激。

最佳答案

错误 410 是一个“找不到配置文件”错误,基于 user guide 的附录 A .您确定您的 windows.cfg 文件位于您运行代码的目录中吗?

否则,错误 251 会指出“运行时命令不正确”,而且我能找到的所有样本都有一个大写的 C。因此,也许更改您的 C 程序以用于:

system("C:\\rmcobol\\runcobol.exe SOLOCAJA.COB C=WINDOWS.CFG L=WOWRT.DLL");

然后看看是否可以解决问题(我知道这是一个远景,但我见过比这更奇怪的事情)。


基于更新:

I tried changing the c to a C on the C=WINDOWS.CFG, ran it in C++ and directly on the Command Line, no change. I am still looking into the reasons behind this, and I read through tek-tips.com/viewthread.cfm?qid=1119251&page=5 but I couldn't use any of that info. Any extra tips would be gold at this point. THANKS!

几个问题:

  • 曾经在这种环境中工作过吗?
  • 它是否在 cmdline 和 C 中都失败了(只是想澄清一下)?
  • 当您运行 windows.cfg 时,它是否实际存在于当前目录中?
  • 您是否在带空格的目录(如 My Documents)中运行它?

除此之外,也许可以发布 windows.cfg 文件,尽管错误看起来很明确,它是未找到的配置文件,而不是配置文件中的错误。

关于cobol - 尝试使用 C++ 程序运行 COBOL .exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3445575/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com