Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 1223  / 3 Years ago, thu, july 8, 2021, 2:48:57

I'm new to Linux and I need some help!



I am trying to compile the code taken from this post to the linux-kernel mailing list.



I have pasted the file into Libre Office and saved it as pairing_tool.c (Not as pairing_tool.c.odt. I have renamed the file to pairing_tool.c.)



But when I use this command line: gcc -o pairing_tool pairing_tool.c in the terminal, I get many errors.




  • What did I do wrong?

  • Should I paste the text into a special text editor?



Also just to be clear, I've used the text included only in between



#include <linux/input.h>



and



return 0;

}



So I haven't put the comments. I think it is good this way, is it?


More From » compiling

 Answers
2

Yes, you should use a text editor, for example gedit which is installed in Ubuntu by default. LibreOffice Writer is a text processor and it saves its files with some additional markup which C compiler does not understand.



To run gedit, press the Super (Win logo) key and type "gedit".



Apart from saving the program in plain text format, you will also need to install the C compiler and stuff, which you can do with



sudo apt-get install build-essential


(although I think you already managed to install it)



Btw, I can confirm that the program compiles nicely and even runs after that :)


[#37860] Thursday, July 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eatack

Total Points: 245
Total Questions: 120
Total Answers: 113

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
eatack questions
Sun, Mar 6, 22, 20:44, 2 Years ago
Tue, Feb 8, 22, 20:50, 2 Years ago
Sat, May 20, 23, 13:30, 1 Year ago
;