diff --git a/src/main.c b/src/main.c index fc634d5..3e95e42 100644 --- a/src/main.c +++ b/src/main.c @@ -19,6 +19,30 @@ #include "stdbool.h" +// To setup this project on windows +// 1. Install CMake +// 2. Install Ninja with winget in windows 11: "winget install --id=Ninja-build.Ninja -e" +// 3. Make a build directory in this project and cd into it +// 4. Run this CMake command: "cmake -GNinja .." +// 5. Change into Debug/Release folder +// 6. Run this command to build: "cmake --build .. --config Debug" + +// https://phoenixnap.com/kb/install-gcc-windows +// https://stackoverflow.com/questions/36770716/mingw64-make-build-error-bash-make-command-not-found +// To build without installing Visual Studio: +// 1. Download MingW64 from here: https://winlibs.com/#download-release +// 2. Place the folder into C:\ +// 3. Add this folder to the path: "C:\mingw64\bin" +// 4. Download Make without guile from here: https://sourceforge.net/projects/ezwinports/files/ +// 5. Copy files from make into "C:\mingw64", do not replace existing files! +// 6. Create a build folder and cd into it +// 7. Run this CMake command to generate build files: "cmake -G "MinGW Makefiles" .." +// 8. To build Run "make" + + +// TODO Look into getting current directory in Windows and Linux +// https://stackoverflow.com/questions/27585930/get-the-current-working-directory-in-c-on-windows + // TODO Move this into a different project. #ifdef _WIN32 @@ -77,7 +101,7 @@ int main() { // } // check_even_odd(1); - // new_struct(); + // print_struct(); read_file("test.txt"); diff --git a/src/struct_test.c b/src/struct_test.c index 08c415e..61dc44a 100644 --- a/src/struct_test.c +++ b/src/struct_test.c @@ -7,16 +7,17 @@ // https://www.w3schools.com/c/c_structs.php -void new_struct() { - struct structT1_ s1; +// Causes make error by using MinGW on the laptop.. +// void new_struct() { +// struct structT1_ s1; - strcpy(structT1.username, "user"); - structT1.tag_number = 22; - // s1.username = "user"; - // s1.tag_number = 22; +// strcpy(structT1.username, "user"); +// structT1.tag_number = 22; +// // s1.username = "user"; +// // s1.tag_number = 22; - printf("Username: %s\nTag number: %i", structT1.username, structT1.tag_number); -} +// printf("Username: %s\nTag number: %i", structT1.username, structT1.tag_number); +// } void print_struct(){ struct TestStruct s1; diff --git a/src/struct_test.h b/src/struct_test.h index a3ffa2c..d62aa88 100644 --- a/src/struct_test.h +++ b/src/struct_test.h @@ -8,11 +8,12 @@ struct TestStruct { int age; }; -struct structT1_ { - char username[20]; - int tag_number; +// Causes make error by using MinGW on the laptop.. +// struct structT1_ { +// char username[20]; +// int tag_number; -} structT1; +// } structT1; // Not sure how to use this #ifdef _TEST @@ -31,4 +32,4 @@ char *addr, char*bd, char sex); #endif //_TEST void print_struct(); -void new_struct(); +// void new_struct();