Skip to content

Jakub777/C-Cpp-study-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to my repository about learning C i C++

Worth mentioning:

GCC Part:

In order to work comfy you need to adjust code runner in vscode.
Here is little script made in power bash of win 10.
You need to add this line to executor map of code runner.
"c": "cd $dir && if ('$fileName' -eq 'main.c') {gcc -I$workspaceRoot\\00_my_lib\\ $workspaceRoot\\00_my_lib\\*.c *.c -o $fileNameWithoutExt} else {gcc -I$workspaceRoot\\00_my_lib\\ $workspaceRoot\\00_my_lib\\*.c $fileName -o $fileNameWithoutExt} && $dir$fileNameWithoutExt"

This adds a place for gcc to look for header files.
-I$workspaceRoot\\00_my_lib\\

This adds all files to compilation (however you could probably, be ok with using *.o files) .
This is added to compilation because of practical reasons, so you don't have to think about adding *.o files after making changes in my_lib.c functions .
$workspaceRoot\\00_my_lib\\*.c

VSCode part:

To have visual studio code working with such a weird path of compilation you need to modify c_cpp_properties.json to have sth like this.
Without this you will have redline underscored under #include.

"includePath": [
    "${workspaceFolder}/**",
    "${workspaceFolder}/00_my_lib"
],

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published