How to build/run a cpp file in Cygwin

Assuming I installed the packages in this page, what would be the command to build and run a cpp file? I also installed an "automake" pkg
closed account (Dy7SLyTq)
well it depends how you compile. i do g++ -std=c++11 [other options like -Wall and -Wextra when im working on releases] source_files.cpp -o elf_file_name* [any libraries to link to]

you probably want to do g++ yourfile.cpp -o whateveryouwanttocallthebinary

*elf is for linux. yours will end in .exe
Hmm. I suppose what i'm asking is how do I get it to run? For instance n Code::Blocks, you press F9/Click the Green Arrow with the crank behind it and the program compiles(I think is the right term) and executes so if it was hello world, you'd get the black box appearing and saying "Hello World!".

With g++ main.cpp I can get it to compile(again not sure if the right term) but I can't get it to execute and say "Hello World" Instead, if I try something like run main.exe I get a white box that flashes quickly then Cygwin says "Aborted (core dumped). Or maybe that's what it was supposed to do? Maybe the white box said Hello World but it happens too fast for me to see it, should Hello World! appear in the Cygwin terminal though?
Solved, it was ./a (where a is the executable) I was doing something like a/a.out and a whole bunch of other things.
Topic archived. No new replies allowed.