Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

simple C code - cannot compile real executable , why ?

Started by MH, October 22, 2019, 09:26:40 PM

Previous topic - Next topic

MH

simple C code - cannot compile real executable , why ?  >:(

Hi ,
i have compiled a simple command line "Hello World" with : gcc -c  mycode.c
But the file is not executable one.
In the context menue of right mouse klick i see that the file is "shared library"
Normally it should be compiled to a executable file.
On a different linux OS that was possible.
Something in Sparky Linux must be modified.!

You can checkout yourself.
If you compile a very simple C programm you file as shared library. no executable file.
The file is executable through the command line with  ./File.
It IS executable.
But why not compiled to a REAL executable ???
I mean the file that have a look like a "WHEEL" , as well known in linux as executable.

MH

Name                                                           Size                          Type                                    Modified

a.out                                                              7,6 kB                shared library  (WHY ???)          Today
021.c                                                           579 byte              C source file                                18.03.2019

--------------------------------------------------------------------------------------------------------------------------------------------
NORMALLY THIS FILE OUTPUT IS EXPECTED ON EVERY UNIX OS :

Name                                                           Size                          Type                                    Modified

a.out                                                              7,6 kB                Executable File  ( ! ! ! ! ! )            Today
021.c                                                           579 byte              C source file                                18.03.2019

================================================================================

Wednesday 23.10.2019  09.37 a.m.  german time.

Hey Hackers , i have NEWS.

I have installed the CLANG Compiler and that works propertly.   of course a EXECUTABLE with one klick !!!

So the question is " Why does the GCC compiler , if normally installed , NOT compile a C Code propertly on Sparky Linux??? "
I have checked out other Linux Distros. They worked with GCC.
I am glad to have solved the problem with CLANG.

Regards
MH


kanliot

basically you're passing the wrong flags.  look at the -c flag.

also apparently debian 10 doesn't come with documentation for gcc 8, so i had to do this:
https://unix.stackexchange.com/questions/523079/what-packages-the-man-pages-for-gcc-on-debian-10-buster-testing

MH

thank you i will try.

Hey. I have installed Sparky Linux on two different machines.
On both machines this simple c-script is NOT compiled to an MOUSE CLICK executable with GCC. Only an .o file. shared library to start from terminal with ./
Only Clang Compiler makes a mouse klickable executable.
It has nothing to do woth Sparky. Its on every Linux OS.

kanliot

yeah.  also the gcc-8-docs package broke this week.  Hell if I know what's wrong.

View the most recent posts on the forum