Skip to content

Commit d3ec586

Browse files
committed
build; intro; minor fixes
1 parent 41f2d84 commit d3ec586

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

work-in-progress/build/0.0-intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ If there were no errors, the c++ _compiler_ generates the object file, ready for
2121
`g++ example.o -o example`
2222

2323
> `example.o` - read this object file
24-
> `-o` link and create the executable called `example`
24+
> `-o` link and _output_ the executable called `example`
2525
2626
If there were no linker errors, you now have a valid executable file to run.
2727

28-
One last note, the example above was expanded to show you both steps in a c++ build, you don't always split them up this way. The compiler usually will automatically link the object files it creates and go directly to the executable (the `-c` option forced it to only compile). The example below does the linking automatically and creates the executable called `example` as well.
28+
One last note, the example above was expanded to show you both steps in a c++ build and you don't always split them up this way. The compiler usually will automatically link the object files it creates and go directly to the executable (the `-c` option told it to just do the compile part). The example below does the linking automatically and creates the executable called `example` as well.
2929

3030
`g++ example.cpp -o example`
3131

@@ -52,11 +52,11 @@ To compile this to an executable, we run the Haxe compiler.
5252
5353
After you run this, you should see a `bin/` folder and inside it, an `Example` executable which you can now run. You'll also see a few other files - A `Build.xml`, and `include` and `src` directory, `Options.txt` and finally an `obj` folder. We'll learn to understand these in detail later.
5454

55-
If you peek inside the `bin/obj/` folder, you'll find a bunch of `.o` files, we recognize these. And, if you look inside the `bin/src/` folder you'll find a bunch of the Haxe/hxcpp runtime files (like `__main__.cpp`) and you'll also find `Example.cpp`.
55+
If you peek inside the `bin/obj/` folder, you'll find a bunch of `.o` files, we recognize these. And, if you look inside the `bin/src/` folder you'll find a bunch of the hxcpp runtime files (like `__main__.cpp`) and you'll also find `Example.cpp`.
5656

5757
It's not much of a leap now to fully understand what's happening from here. The Haxe compiler takes your `Example.hx` file, generates `src/Example.cpp` from it, hands it to a c++ compiler which generates an object file (like `obj/bc98a4ab_Example.o`) and then links them all together with the rest of the object files, and the c++ compiler creates the executable for us.
5858

59-
This is no different from the very basic c++ example above, the difference is that the hxcpp build toolchain is running the c++ compiler for us by default. In fact, it prints them while running, you can see the two stages clearly:
59+
This is no different from the very basic c++ example above, the difference is that the hxcpp build toolchain is running the c++ compiler for us. In fact, it prints the commands while it's running, you can see the two stages clearly:
6060

6161
>note: the arguments and paths are stripped away for clarity
6262

0 commit comments

Comments
 (0)