编译器未创建可执行文件

发布于 2025-01-01 02:01:44 字数 547 浏览 3 评论 0原文

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

-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

I was recompiling the existing source files but it is not able to create the executable though it file generated has execute permission

-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

The command used for compilation

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

Is there any option missing

If we have both gcc and g++ and the source written for g++ in order to recompile with gcc what could be done as the as the currently in this environment we can use only gcc

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝天 2025-01-08 02:01:44

根据 GCC 手册

3.17.41 System V 选项

这些附加选项可在 System V Release 4 上使用
与这些系统上的其他编译器的兼容性:

-G
创建共享对象。建议改用-symbolic或-shared。

[...剪...]

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

According to the 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 ...]

Seeing as you're on (SysV-derived) Solaris, it would seem you're asking GCC to create a shared object. Is there a specific reason you have that -G?

在你怀里撒娇 2025-01-08 02:01:44

根据file,您创建了一个共享对象(通常命名为*.so)。

According to file, you made a shared object (which usually would be named *.so).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文