Nuclide C ++ simple Buck setup

I want to create and run C ++ programs from Nuclide using Buck. The problem is that I don’t know how to set up a simple Buck configuration file in Nuclide to build, and then run the file .cpp.

Anyone have a suggestion?

+4
source share
1 answer

Creating a hi-world program with Buck is easy. Create the following files in the project directory:

.buckconfig

(may be empty)

main.cpp:

#include <iostream>

int main() {
  std::cout << "Hello, world. " << std::endl;
  return 0;
}

BUCK

cxx_binary(
  name = 'hello-world',
  srcs = [
    'main.cpp'
  ],
)

The nuclide should find everything for you if you open Atom from the project folder.

To verify that everything works, run:

buck run //:hello-world

This should be enough to begin with; more information can be found on the Buck website .

+2

Source: https://habr.com/ru/post/1666314/


All Articles