- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用ifort并尝试使用编译器选项编译程序时出现链接错误。不过,我已经在一个很小的简单程序上测试了这些选项,但还是遇到了同样的问题。
因此,我怀疑这与ifort的安装方式或我使用的系统类型有关,但我不确定。这些程序在没有选项的情况下可以编译。我的问题是我在做错什么,在使用编译器选项或与我使用的系统不兼容的编译器选项时,有没有办法避免这些错误。
这是程序定期编译的方式:
ifort -free testrealprint.out testrealprint.f90
ifort -free -O2 -stand f03 -check all -traceback -warn all -fstack-protector - assume protect_parens -implicitnone testrealprint.out testrealprint.f90
program main
implicit none
real, dimension(1:3) :: adremvect
integer :: j
character (LEN = 7) :: adremchar, adremcharadj,adremcharadjtrm, adremcharnew
adremvect = (/ 2.0, 1.3, 1.0 /)
do j = 1, 3
write(adremchar, '(f5.1)') adremvect(j)
adremcharadj = adjustl(adremchar)
adremcharadjtrm = trim(adremcharadj)
adremcharnew = adremchar(4:)
print *, adremvect(j), adremcharadj, adremcharadjtrm, adremcharnew
end do
testrealprint.out: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/crt1.o:(.text+0x0): first defined here
testrealprint.out: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/crti.o:(.fini+0x0): first defined here
testrealprint.out:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/crt1.o: (.rodata.cst4+0x0): first defined here
testrealprint.out: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
ld: error in testrealprint.out(.eh_frame); no .eh_frame_hdr table will be created.
最佳答案
看起来非常像您缺少用于命名编译器发出的可执行文件的命令行选项。我假设您实际上想要这样的东西(请注意-o
选项):
ifort -free -O2 -stand f03 -check all -traceback -warn all -fstack-protector -assume protect_parens -implicitnone -o testrealprint.out testrealprint.f90
testrealprint.f90
并将其与现有的可执行文件
testrealprint.out
链接来制作可执行文件。这就是为什么您从链接器中收到重复的符号错误的原因-您试图将现有的应用程序链接到当前的链接器调用中。我很惊讶您在搜索路径中没有现有
testrealprint.out
的情况下尝试编译时没有得到未找到文件错误...。
关于linker - ifort在Linux上的编译器选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10074754/
我的makefile的一部分看起来像这样...... ifdef vis flg += -framework GLUT -framework OpenGL -Dvis obj += camfun.o
我正在尝试将 MPI 与 D 编程语言结合使用。 D 完全支持 C ABI,可以链接和调用任何 C 代码。我已经完成了显而易见的工作并将 MPI header 翻译为 D。然后我翻译了 a test
我研究了 makefile 项目。我正在使用 gnu gcc 并作为链接器,我使用带有以下参数的 gcc: linkerCmdLine=$(exe) -Wl,--start-group -nostdl
我尝试使用 FMDB 数据库,但出现错误: Undefined symbols for architecture i386: "_OBJC_CLASS_$_FMDatabase", referen
我想知道“本地链接器符号”和“本地程序变量”之间的区别? 我正在读一本书,里面有这样的: alt text http://img682.imageshack.us/img682/9816/symbol
假设我正在使用 clang 构建和链接我的应用程序 clang -I/usr/local/include -c -o app.o main.c clang -L/usr/local/lib -o ap
我正在从程序员的角度阅读计算机系统,关于链接的章节。它解释了如何使用程序 ld 在 linux x86-64 中进行链接。作者声称,为了从可重定位的目标文件构建可执行文件,链接器做了两件事:符号解析和
所以,这是我发现自己想到的任务。假装一下,我有大量的内容。我想查看哪些网站链接到我的内容。我知道我可以研究 TrackBack 或 PingBack,但是那些不使用能够处理这些问题的工具的人呢? 似乎
我认为 动态加载意味着在加载或运行时将库(或任何其他二进制文件)加载到内存中。所以在下面的程序中,当 dlopen() 调用动态加载器时,它会出现,如果库尚未加载,它会将库加载到内存中。 动态链接是指
我想澄清我对共享库的困惑。当我在网上搜索时,我在对静态链接的解释中发现,由于库包含在可执行文件本身中,因此它会导致更大的可执行文件,从而增加程序的内存占用。 而在动态库/共享库的情况下,库是在运行时链
我正在开发一个嵌入式系统(Stellaris Launchpad)并编写一个简单的操作系统(作为一个爱好项目)。使用的工具链是 gcc-none-eabi。 我的下一步是习惯 MPU 以允许内核阻止用
我正在与 JNI 合作。我有一个包装库 (wrapper.so),它使用两个共享库:one.so 和 two.so 一切正常。所有 *.so 都在 lib 文件夹中,在程序文件夹内。 问题是,如果我将
使用通过“node-gyp”传递的链接器命令行选项,我指定了我希望程序链接的库路径和库名称。但是生成的可执行文件没有引用我指定的文件,它在 /usr/lib 中引用了一个不同的名称。 . 我正在使用
我正在为 AWS lambda 开发 native 节点模块。此节点模块需要 json-c 根据 AWS lambda guidelines节点模块不应具有动态依赖关系。所以尝试链接json-c库的静
我想配置一个自动工具化的项目来调用一个非标准的 链接器( gold linker ), 使用 Linux Mint 16/Ubuntu 13.10 的库存自动工具 我相信我会通过以下方式实现这一目标:
要将可执行文件与位于标准位置的库链接,可以在 CmakeLists.txt 文件中执行以下操作: create_executable(generate_mesh generate_mesh.cpp)
链接描述脚本是否可以访问makefile/shell变量并根据所述变量做出决定? 例如,假设我想在不使用其他链接程序脚本的情况下更改下面RAM区域的开始,是否可以使用make变量来执行此操作? MEM
第三方为我提供了一个静态lib(.a)以便与solaris站链接。 我尝试使用sunpro进行编译,但在链接步骤失败。 我想问题出在我使用的编译器(而不是gcc?)或它的版本(由于编译器提供的std
当我们编译代码时,将生成一个目标文件。在链接过程中,从该目标文件生成一个可执行文件。 为什么我们需要一个目标文件?目标文件有什么用?不可能直接生成可执行文件吗?毕竟,我们使用可执行文件来运行该程序。
我知道头文件包含函数和变量的声明,它们在编译期间帮助判断输入的参数是否有效。 所有的库函数都是默认链接的吗? //#include //#include int main() { printf
我是一名优秀的程序员,十分优秀!