gpt4 book ai didi

c++ - 编译器不创建可执行文件

转载 作者:行者123 更新时间:2023-11-28 01:00:21 25 4
gpt4 key购买 nike

我正在重新编译现有的源文件,但它无法创建可执行文件,尽管生成的文件具有执行权限

-rwxrwxr-x   1 ilvweb ilv      2949112 Jan 31 09:34 karny

$ file karny
karny: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped

编译使用的命令

g++ -m64 -mcpu=v9  -DSUNOS -DNDEBUG -g -Wno-deprecated  -o karny    tkm.o THlm.o Connection.o Socket.o  ThLogger.o File.o TextFile.o File.o Timer.o lPlugin.o \
-G -lm

是否缺少任何选项

如果我们同时拥有 gcc 和 g++ 以及为 g++ 编写的源代码以便用 gcc 重新编译我们可以只使用 gcc 在这个环境中做些什么

最佳答案

根据GCC manual :

3.17.41 Options for System V

These additional options are available on System V Release 4 for compatibility with other compilers on those systems:

-G Create a shared object. It is recommended that -symbolic or -shared be used instead.

[... snip ...]

鉴于您在(SysV 派生的)Solaris 上,您似乎在要求 GCC 创建一个共享对象。你有那个 -G 有什么具体原因吗?

关于c++ - 编译器不创建可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9074499/

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