什么是未定义的引用/未解决的外部符号错误,如何在Fortran中修复该错误? [英] What is an undefined reference/unresolved external symbol error and how do I fix it in Fortran?

查看:126
本文介绍了什么是未定义的引用/未解决的外部符号错误,如何在Fortran中修复该错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建Fortran程序,但是遇到有关未定义引用或未解析的外部符号的错误.我已经看到了关于这些错误的另一个问题,但是那里的答案大多是针对C ++的.

I am trying to build a Fortran program, but I get errors about an undefined reference or an unresolved external symbol. I've seen another question about these errors, but the answers there are mostly specific to C++.

在Fortran中编写这些错误的常见原因是什么,如何解决/预防这些错误?

What are common causes of these errors when writing in Fortran, and how do I fix/prevent them?

推荐答案

有很多可能的方法可以看到这样的错误.尝试生成程序(链接错误)或运行程序(加载错误)时,您可能会看到它.不幸的是,很少有一种简单的方法来查看造成错误的原因.

There are many possible ways you can see an error like this. You may see it when trying to build your program (link error) or when running it (load error). Unfortunately, there's rarely a simple way to see which cause of your error you have.

此答案提供其他问题的摘要,并链接到其他问题,以帮助您进行导航.您可能需要阅读所有答案才能解决问题.

This answer provides a summary of and links to the other questions to help you navigate. You may need to read all answers to solve your problem.

出现这样的链接错误的最常见原因是您没有正确指定的外部依赖项.

The most common cause of getting a link error like this is that you haven't correctly specified external dependencies.

在尝试运行程序时,您可能会缺少或不兼容的运行时库.

When trying to run your program you may have a missing or incompatible runtime library.

如果构建失败并且您指定了外部依赖项,则可能会出现编程错误,这表示编译器正在寻找错误的事情.

If building fails and you have specified external dependencies, you may have a programming error which means that the compiler is looking for the wrong thing.

这篇关于什么是未定义的引用/未解决的外部符号错误,如何在Fortran中修复该错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆