You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: work-in-progress/build/0.0-intro.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ If there were no errors, the c++ _compiler_ generates the object file, ready for
21
21
`g++ example.o -o example`
22
22
23
23
> `example.o` - read this object file
24
-
> `-o` link and create the executable called `example`
24
+
> `-o` link and _output_ the executable called `example`
25
25
26
26
If there were no linker errors, you now have a valid executable file to run.
27
27
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.
29
29
30
30
`g++ example.cpp -o example`
31
31
@@ -52,11 +52,11 @@ To compile this to an executable, we run the Haxe compiler.
52
52
53
53
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.
54
54
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`.
56
56
57
57
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.
58
58
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:
60
60
61
61
>note: the arguments and paths are stripped away for clarity
0 commit comments