- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从手册 gnucobol 中练习调用 cobol 程序 (say.cob) 的 C 程序 (hello.c)。
---- say.cob ------
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 HELLO PIC X(6).
01 WORLD PIC X(6).
PROCEDURE DIVISION USING HELLO WORLD.
DISPLAY HELLO WORLD.
EXIT PROGRAM.
---- hello.c -
#include <libcob.h>
extern int say(char *hello, char *world);
int
main()
{
int ret;
char hello[7] = "Hello ";
char world[7] = "World!";
cob_init(0, NULL);
ret = say(hello, world);
return ret;
}
C:\Users\S M Rao>gcc -c ‘cob-config --cflags‘ hello.c
gcc: error: `cob-config: No such file or directory
gcc: error: unrecognized command line option '--cflags`'
if I run with commands
cobc -c hello.c
cobc -c -static say.cob
cobc -x -o hello hello.o say.o
getting following error
C:\Users\S M Rao>cobc -x -o hello hello.o say.o
hello.o:hello.c:(.text+0x5c): undefined reference to `say'
collect2.exe: error: ld returned 1 exit status
我可以看到 cob-config 存在于 gnucobol 文件夹中。并在环境变量 COB_CONFIG_DIR %COB_MAIN_DIR%\config
最佳答案
cob-config
需要是一个可执行脚本,它通常是。
当您指定 Windows 路径时,我假设您使用它 - 而这个不能运行 shell 脚本。你可以通过附加 cob-config.bat
来解决这个问题。执行此 shell 脚本,但在这种情况下,它将输出 mingw/wsl/cygwin/... 可能无法在 Windows gcc 中使用的路径。
解决方案:
cob-config
作为 $PATH
中的可执行脚本cobc
的功能为您调用 C 处理器(如果需要,还可以调用链接器):cobc -c hello.c
关于cobol - gnucobol gcc : error: `cob-config: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67107460/
我编写了以下程序,我很困惑为什么在编译程序时出现错误,说 A-COL(1,1) 不是数值,而显示 A-COL(1,1) 给我 1。 IDENTIFICATION DIVISION. PRO
需要将 4 个字符串连接到 cobol 中的目标变量。 喜欢, 01 WS-S1 X(10) VALUE "HI ". 01 WS-S2 X(10) VALUE "HOW ". 01 WS-S3 X(
大家好,这里有一大堆问题。我已经完成了一个我必须为大学作业做的程序,但是当我运行它时,输出几乎没有显示它应该显示的内容。这只发生在我运行它时。如果我在整个过程中按住 F11 到 STEP,它会显示预期
正如标题所暗示的,我正在做一个软件来计算和验证插入的数字是否是一个快乐的数字(或不是)。在 COBOL 语言中(有关什么是快乐数字的引用 https://mathworld.wolfram.com/H
为什么我不能在 COBOL 中执行此嵌套执行循环? 如果我把END-PERFORM。在任何一行中比我在 EXIT PROGRAM 之前拥有最后一个的地方早 - 它有效。但是我需要程序每次都显示 INP
我知道许多 COBOL 编译器确实允许嵌套副本(具有不同的深度),但我没有找到任何“官方”规则。问题: 是否有明确允许或禁止嵌套副本的 COBOL 标准? 有没有不允许嵌套copybooks的COBO
我对 COBOL 很陌生。我正在学习 Micro Focus 附带的教程,但似乎无法让示例正常工作。我正在尝试打印 -123.45 并且我不断收到以下信息, 我查了很多帖子,都没有解决我的问题。我在
COBOL 中是否有一种“等待”功能? 我写了一个计算器,为了让它更 50 多岁,我打印了“计算”。 “计算..” ecc 例如: DISPLAY "SECOND
好的,所以我正在做作业,但是随后我发现我被要求添加页码并为每4条记录更改页数。由于这是一门在线课程,我认为讲座视频中没有关于页码的任何信息。所以主要的问题是 要添加包含日期和页码的标题, 每页打印4条
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
Cobol 程序: PROGRAM-ID. SCHPROG. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION.
我正在使用屏幕部分在 Cobol 中开发一个系统,当我在另一个程序中创建的菜单中选择一个选项时,我无法调用客户注册程序。我正在使用带有 GnuCOBOL 编译器的 opencobol。 CALL "A
我正在构建一个 COBOL 程序来计算最多 15 个整数的平均值。执行显示的数字远大于预期,并带有很多尾随零。以下是相关代码: Data Division. Working
我正在开发一个 Wrapper/Bridge COBOL 程序,该程序处理程序调用并执行横切操作,如日志记录、安全检查等。 主要动机是检查消费者程序的安全访问是否有权调用生产者程序。 设桥接 COBO
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我有一项将 COBOL 代码转换为 .NET 的任务。有没有可用的转换器?我试图在高层次上理解 COBOL 代码。我无法理解 COBOL 代码。有流程图生成器吗?我很感激任何帮助。 谢谢.. 最佳答案
我有以下代码: 01 W-IX1 PIC 9(8) VALUE ZERO COMP-4. 01 W-INPUT-AMNT
我是 COBOL 编程的新手,所以我试图制作一个示例计算器,但我无法让它工作。 calc 进入无限循环,我没有找到原因,我什至尝试复制类似的代码,但没有成功。那么,这是 OpenCobolIDE 问题
我只是在学习 COBOL;我正在编写一个简单地回显用户输入的程序。我已经定义了一个变量: User-Input PIC X(30). 后来当我接受用户输入,然后显示用户输入“加上一些额外的文本”时,它
是否可以在Cobol程序中获取并显示当前行号?例如,C 允许通过以下方式进行: ... printf("Current line = %d\n", __LINE__); ... 最佳答案 简答:否。
我是一名优秀的程序员,十分优秀!