Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum Linuxiarze.pl

Author Topic: simple C code - cannot compile real executable , why ?  (Read 377 times)

Offline MH

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
simple C code - cannot compile real executable , why ?
« on: October 22, 2019, 09:26:40 pm »
simple C code - cannot compile real executable , why ?  >:(

Hi ,
i have compiled a simple command line "Hello World" with :
Code: [Select]
gcc -c  mycode.cBut 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

« Last Edit: October 23, 2019, 09:37:32 am by MH »

Offline kanliot

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: simple C code - cannot compile real executable , why ?
« Reply #1 on: October 23, 2019, 11:33:17 am »
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

Offline MH

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: simple C code - cannot compile real executable , why ?
« Reply #2 on: October 23, 2019, 08:35:00 pm »
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.
« Last Edit: October 29, 2019, 06:29:29 pm by MH »

Offline kanliot

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: simple C code - cannot compile real executable , why ?
« Reply #3 on: November 01, 2019, 02:01:01 pm »
yeah.  also the gcc-8-docs package broke this week.  Hell if I know what's wrong.