Starting ANSI C++ 03

This commit is contained in:
ganome 2024-08-25 11:27:24 -06:00
parent e047f45a4b
commit 66672ff1c3
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83
5 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,13 @@
CFLAGS = -std=c++03 -O2
LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
1.1: main.cpp
c++ $(CFLAGS) -o helloworld main.cpp $(LDFLAGS)
.PHONY: test clean
test: helloworld
./helloworld
clean:
rm -f helloworld

View File

@ -0,0 +1,7 @@
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}

View File

@ -0,0 +1,13 @@
CFLAGS = -std=c++03 -O2
LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
1.1: main.cpp
g++ $(CFLAGS) -o error main.cpp $(LDFLAGS)
.PHONY: test clean
test: helloworld
./helloworld
clean:
rm -f helloworld

View File

@ -0,0 +1,6 @@
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;

View File

@ -0,0 +1,15 @@
1. What is the difference between an interpreter and a compiler?
Interpreters are Just-in-time compilers that do not make binaries. They can be edited like editing a script. Where as a compiler makes binaries that can't be changed without changing the source code and recompiling.
2. How do you compile the source code with your compiler?
I create a Makefile - that runs the command ```g++ -o PROJECT main.cpp``` creating a binary with the PROJECT name.
3. What does the linker do?
The linker uses the local system libraries (Nix, Windows) to make system calls to the CPU.
4. What are the steps in the normal development cycle?
a) brainstorm
b) roadmap
c) code
d) debug
e) publish