Skip to content
New issue

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

add a tutorial for creating a C3 library and importing it into a project or using standalone #67

Open
joshring opened this issue Oct 6, 2024 · 1 comment

Comments

@joshring
Copy link
Contributor

joshring commented Oct 6, 2024

Want a tutorial to create a simple C3 library and use it

@joshring joshring changed the title add a tutorial for creating a library and using it add a tutorial for creating a C3 library and importing it into a project or using standalone Oct 6, 2024
@joshring
Copy link
Contributor Author

joshring commented Nov 1, 2024

Let's say you have foo.c with:

int foo_add(int x, int y) {
    int sum = 0;
    sum = x + y;
    return sum;
}

If you have a project then add:

{
  ...
  "c-sources":["foo.c"]
  ...
}

Now in your code, add:

extern int foo_add(int x, int y);

Now you can use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant