>>107272643
I assume you compile your stuff doing something like
c++ my_one_and_only_file.cpp
so start by setting up a build system, for C++ the three modern alternatives are meson, cmake and vcxproj (the msvc proprietary building system). meson being the easier to use and setup, you just write a meson.build file like this:
project('project_name', 'cpp', version : '0.1.0',)
inc = include_directories(
'include/',
)
src = files (
'src/main.cpp',
)
dep = [
dependency('threads'),
]
exe = executable(
'project_name',
sources : src,
dependencies : dep,
include_directories : inc,
install : true,
)
nowadays it is also common to just keep the header files in the same directory as the source files (src/), so if you find the include/src dichotomy inconvenient, feel free to replace 'include/' with 'src/' in the include_directories list
the way you share functions between different source files is through headers (.h). you declare functions, classes and templates in header files and then implement them in source files (.cpp). for example, consider util.h:
#pragma once
int f();
then util.cpp:
#include "util.h"
int f() { return 1; }
and main.cpp:
#include <iostream>
#include "util.h"
int main() { std::cout << f() << "\n"; }
where to put the different stuff? disregard the clean code and other universal guidelines, the modern way of doing it is just vibes. do whatever you find convenient, clear and elegant. optionally, post your repo here and ask people if they can understand the structure of your project, but take the feedback with a grain of salt