We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is more of a brain dump each of these are likely an issue
The text was updated successfully, but these errors were encountered:
It would be nice to also include a section about working with c-sources in project.
c-sources
I was able to make a quick example, storing it here for reference. In project folder, I created c-src folder, to put any C libraries in there.
c-src
. └── c-src └── mylib ├── include │ └── mylib.h └── src └── mylib.c
mylib.c has and include for the header #include "mylib.h"
mylib.c
#include "mylib.h"
This is then glued together via project.json options:
{ "c-sources": [ "./c-src/mylib/src/" ], "c-include-dirs": [ "./c-src/mylib/include" ], }
When running c3c build these options are just passed to cc:
c3c build
cc
cc -I ./c-src/mylib/include/ -fPIE -fPIC -c ./c-src/mylib/src/*.c -o build/tmp/tmp_c_compile/mylib.o
And the result is just linked to the C3 code. This means that any functions which we want to use from mylib need to be declared in C3:
mylib
extern fn void do_stuff(int val); fn int main(String[] args) { do_stuff(0); return 0; }
Sorry, something went wrong.
No branches or pull requests
This is more of a brain dump each of these are likely an issue
The text was updated successfully, but these errors were encountered: