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

Using this in C #25

Open
hanniUwU opened this issue Apr 24, 2024 · 1 comment
Open

Using this in C #25

hanniUwU opened this issue Apr 24, 2024 · 1 comment

Comments

@hanniUwU
Copy link

Since i am kind of a newbie i have problems linking to this library in my c code. After building i #include "talsh.h" in my c file and compile using gcc. E. g.: gcc test.c -L./path_to_lib -I./path_to_lib -ltalsh. But i then get errors regarding the inclusion of the c++ headers in tensor_algebra.h, eg. cstddef.

In file included from tensor_algebra.h:54,
from talsh.h:12,
from kram.c:2:
/usr/include/c++/13.2.1/cstddef:52:8: error: expected identifier or '(' before string constant
52 | extern "C++"
| ^~~~~
In file included from /usr/include/c++/13.2.1/cstdint:35,
from tensor_algebra.h:55:
/usr/include/c++/13.2.1/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11
or -std=gnu++11 compiler options.
32 | #error This file requires compiler and library support
| ^~~~~

Compiling with e. g. -std=c++11 gives the same error.
Greetings

@DmitryLyakh
Copy link
Owner

You will need to use the C++ compiler (g++) even if you only want to use the C API.

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

2 participants