打开并写入 FORTRAN DLL 中的文件
我正在用 fortran 编写并使用 g95 编译器进行编译。
我需要将日志文件输出到我正在编写的 DLL,该 DLL 当前正在与主程序链接并运行,但会产生不正确的结果。我对 FORTRAN 不太了解,但我确实得到了以下代码来在我编译的 EXE 中生成输出:
OPEN(UNIT=3, FILE='LOG.txt', STATUS='NEW')
WRITE(3,*) "the gospel of PTP is bestowed upon the file."
CLOSE(3)
这在独立的 EXE 中工作,当我运行它时,它会生成一个包含该字符串的文件。但是当我尝试将它包含在我正在处理的 DLL 中时,它会崩溃一切。当我将其注释掉时,一切都会再次运行并工作,但显然不会产生所需的输出。
有什么想法吗?有 FORTRAN 或 g95 人吗?
I am writing in fortran and compiling using the g95 compiler.
I need to have a log file output to a DLL i am writing, that is currently linking and running with the master program, but producing incorrect results. I don't know much about FORTRAN, but i did get the following code to produce output in an EXE i compiled:
OPEN(UNIT=3, FILE='LOG.txt', STATUS='NEW')
WRITE(3,*) "the gospel of PTP is bestowed upon the file."
CLOSE(3)
this works in a stand alone EXE, when i run it, it produces a file with the string inside. But when i try to include it in the DLL i am working on, it crashes everything. when i comment it back out, everything runs and works again, but obviously doesn't produce the desired output.
Any ideas? Any FORTRAN or g95 people?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
猜测可能有帮助,也可能没有帮助,我很少使用 Fortran DLL 直接写入任何内容:
并且,评论:
A guess which might help, or might not, I have rarely used Fortran DLLs to write anything directly:
And, a comment: