I need help with linking multiple c source code files on emacs. Could anyone show me the way on how to work this out? Thanks!

  • In C developement: c-source files are compiled to object files *.o. These object files are then linked together, sometimes also involving static or dynamic librarys, to create a binary (or library). What do you mean by "linking multiple c source code files"? – jue Jul 13 '17 at 9:51
  • By linking multiple c source code, what I meant was compiling and running source files together. And also I need to read a binary raw data file (ht3) with C. How could I achieve this? (I'm new at programming) – fizsics Aug 5 '17 at 11:09
  • As far as I understand you, you should search for "how to compile C code with gcc". If you are using the gcc compiler, then it is something like gcc -o foo *.c on the command line. You do not necessarily need emacs for this. Maybe this helps: network-theory.co.uk/docs/gccintro/gccintro_9.html Reading the ht3 data file is a complete different story. – jue Aug 10 '17 at 22:10

Emacs has a builtin tetris game, a psychoanalyst, and a bunch of other fun stuff, but AFAIK it does not have a linker (nor a C compiler), so I think you're either looking at the wrong place, or asking the wrong question.

The way I compile&link C files from Emacs is by writing an appropriate Makefile and then with C-cC-c which I have bound to compile which by default runs make.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.