AKS
AKS

Reputation: 31

Compiler not creating an executable

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

Upvotes: 0

Views: 2283

Answers (2)

jjlin
jjlin

Reputation: 4703

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?

Upvotes: 2

Ben Voigt
Ben Voigt

Reputation: 283733

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

Upvotes: 1

Related Questions