public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* a problem when using gcc
@ 2024-03-13 14:26 guo
  2024-03-13 16:00 ` Kai Ruottu
  0 siblings, 1 reply; 2+ messages in thread
From: guo @ 2024-03-13 14:26 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hello, i use a makefile to compile a .c file and successfully get an
executable file, but when i use command "./filename" to try to execute that
executable file, i failed and being told "bin file not specified",could you
please tell the reason why i get this error?Thank you for your help!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: a problem when using gcc
  2024-03-13 14:26 a problem when using gcc guo
@ 2024-03-13 16:00 ` Kai Ruottu
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Ruottu @ 2024-03-13 16:00 UTC (permalink / raw)
  To: guo, gcc-help


guo via Gcc-help kirjoitti 13.3.2024 klo 16.26:
> Hello, i use a makefile to compile a .c file
What do you mean with "compile"?
> and successfully get an executable file,
Getting an executable file with GCC means "compile to assembly file", 
"compile this with 'as' to an object file" and
finally "link the object file with 'ld' to all the required library 
functions (object files), startups and endfiles".
The '-o' <executable_name' makes the assembly and link phases being done 
with the defaults.
For instance creating an excutable "hello_world" from a "hello_world.c" 
C source file :

      $ gcc -v -o hello_world hello_world.c

shows all the 3 phases because of the '-v(erbose)' switch in the command.

When you have a makefile to do the compile, you should at least know 
what it tries to do, what is the name of
the executable file it should procuce.

> but when i use command "./filename" to try to execute that
> executable file, i failed and being told "bin file not specified",could you
> please tell the reason why i get this error?Thank you for your help!

Does the run platform give this error or the executable you are running? 
Googling with this error message gives
no results...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-13 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-13 14:26 a problem when using gcc guo
2024-03-13 16:00 ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).