0

I am newly learning c++. I am using the Linux ubuntu operating system and a sciTE text editor. Do you know how to create a file on scite that I will be able to compile and then create an archive on terminal? also how do I create a 'make file. cpp'. Any help will be greatly appreciated. Thanks! :)

  • I suggest to check out SciTE menu "Tools" where you find the items "compile", "build" and "go" and read about using SciTE choosing in the menu "Help", "SciTE Help". – Claudio Apr 10 '20 at 08:26

1 Answers1

0

Do you know how to create a file on scite that I will be able to compile and then create an archive on terminal?

You can use any text editor to write C++ source code. There is nothing very editor-specific about it. The file itself should be assigned a name that your compiler will recognize as designating a C++ source file. Compilers generally look at the filename extension for that purpose, and ".cpp" is a very common pattern recognized as indicating C++ source. It looks like that's what you're intended to use, so when you save the file just be sure to give it a name that ends in .cpp.

In order to successfully compile, you of course need to write valid C++ source code in the file, and in order to compile it to a program (I assume that's what you meant by "archive") it must contain a valid main() function.

how do I create a 'make file. cpp'.

I think you've gotten your instructions confused. Perhaps the instruction is just meant to convey what I already said about giving your source file a name ending in ".cpp". Alternatively, you may have been asked to create a makefile, which is input to the build tool "make", that could be used to build the program instead of running the compiler directly. You may ask specific questions about make here, but we are not in the business of writing full tutorials. The first thing you should do if you need instructions about make would be to consult your course materials and lecture notes, and / or ask your instructor.

On the third hand, make doesn't even need a makefile in some simple cases. It may be that you are instructed to build the program without a makefile. If you have named the source "prog.cpp" and it contains valid C++ source for a complete program, then you should be able to build that program via the command "make prog". In that case, the resulting program will be named "prog".

John Bollinger
  • 160,171
  • 8
  • 81
  • 157
  • Thanks so much! It really helped. It seemed like all I needed to do was add .cpp to the end of the file name and I have obtained source code to create a makefile. –  Apr 21 '20 at 15:58