I'm a total beginner of C. I know a fair bit of Rust though. I wanted to give C a try. I wanted to write a hello world app, which is not a big deal. So, I've thought "Maybe I can go further. What about writing a CLI app?"
So I've searched for some libraries. There seems to be this answer in SO, but the problem is it's not a cross-platform solution. I was looking for a cross platform thing, so I've found cargs.
The library seemed useful so I wanted to give it a try. Many times before, I've seen some C repos use git submodules for dependency management (kinda?). So, following installation tutorial of cargs, I've done:
git submodule add -b stable [email protected]:likle/cargs.git
I wanted to naturally include this to my hello world source:
// main.c
#include <stdio.h>
#include "cargs.h"
int main()
{
printf("Hello, World!\n");
}
But, one way or another, whenever I compile, I either get #include errors detected. Please update your includePath. or file or directory not found errors.
I've also tried these:
#include <cargs.h>#include "cargs/cargs.h"#include <cargs/cargs.h>
I've also tried compiling the cargs itself with its instructions, by simply doing:
cd cargs
mkdir build
cd build
cmake ..
make
But, none of these seemed to have worked.
I know, it's a noobie question, but I really want to understand how I'd manage the dependencies in C (kinda have a vague idea about it but mostly ignorant).
BTW, I've also learned (correct me if I'm wrong) that #include <> includes from system path while #include "" includes from local path (?). So, does that mean I gotta build cargs and install it system wide? If so, how would I ensure the users have cargs library installed on their machine as well (this is what's called dynamic linking I assume?).
Thanks in advance.