Build systems in Sublime Text

前端 未结 4 1609
北海茫月
北海茫月 2021-01-31 04:34

I\'m just beginning to learn programming (on C++ and Python), and by beginning I mean total beginning (\"hello world\" beginning...). Not wanting to use multiple IDE\'s, I would

相关标签:
4条回答
  • 2021-01-31 04:59

    for c++ I actually made sublime to produce colorful error messages which are easier to read and you can also click on the errors which takes you to the file with the error.

    You can look at how I modified the build to do what I wanted in here

    0 讨论(0)
  • 2021-01-31 05:00

    So, you don't want to use an IDE but then you want IDE features from a text editor? :)

    Most people who use a text editor for writing code use terminal to build and run the code.

    So, for C++, the instructions are:

    make (or gcc myprogram.c)
    ./myprogram
    

    for a Python program, it's even simpler:

    python ./myprogram.py
    

    If you're not comfortable with terminal, then you probably need an IDE.

    0 讨论(0)
  • 2021-01-31 05:05

    windows(install minigw, python2.7 and added to the system path)
    cpp:

    1. build: ctrl+b
    2. run: ctrl+shift+b

    python:

    1. build and run: ctrl+b

    you may try to learn the the .sublime-build files in your Tools -> Build system -> New build system

    0 讨论(0)
  • 2021-01-31 05:09

    Sublime Text 2 already comes with scripts for building and running Python and C++ programs.

    Simply press Cmd+B (or Ctrl+B on Windows & Linux) when a .py or .cpp file is open. The Python file will automatically execute and show the result in the built in console.

    For C++, you need to press Cmd+Shift+B (Ctrl+Shift+B on Windows & Linux) to run it after building.

    You need to have Python installed (get it here for Windows), and also a C++ compiler. The build system for C++ tries to call g++ by default (get it here for Windows. Remember to select the C++ compiler when installing!).

    You will need to add the directories to path (c:\python32\ or similar for python, c:\mingw\bin or similar for the C++ compiler).

    On windows, you may experience problems running the C++ programs (it tries to use bash). But Ctrl+B builds the program, and you can then use a command line to run it. Python works flawlessly on Windows.

    0 讨论(0)
提交回复
热议问题