-
Notifications
You must be signed in to change notification settings - Fork 240
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
Invalid conversion compiler warnings #61
Comments
Looks like you're compiling tinyexpr as C++. You need to compile it as C code, then link it into your C++ project. |
Also, this line is not what you want:
To pass a C++ string to a C function, you would do something like this:
|
Same error, but I think it could be from C & C++ incompatibilities. |
This is the full code then; #include <stdio.h> int main() |
How are you compiling? |
@EvilPudding Using Dev-C++ 5.11 with TDM GCC 4.9.2 64-bit |
This line is your problem:
You need to remove that line! Then add tinyexpr.c to your project in your IDE. Your IDE should compile it separately as C code, and then link it in after. As stated previously, your error comes from you compiling tinyexpr.c as C++, when it is in fact C code. You should find a tutorial about how C and C++ compilers work. To be productive with programming, you need to not only know the programming language, but you need to understand how your tools work as well. |
@codeplea Ok, I will try it tonight. |
te_expr ret = malloc(size);
88 31 D:\ ...\Mywork\Cpp\Starter\tinyexpr.c [Error] invalid conversion from 'void' to 'te_expr*' [-fpermissive]
case TE_FUNCTION7: case TE_CLOSURE7: te_free(n->parameters[6]); / Falls through. /
102 69 D:\ ...\Mywork\Cpp\Starter\tinyexpr.c [Error] invalid conversion from 'void*' to 'te_expr*' [-fpermissive]
...
183 1 D:\ ...\Mywork\Cpp\Starter\tinyexpr.c [Error] invalid conversion from 'double ()(double)' to 'const void' [-fpermissive]
Call code:
The text was updated successfully, but these errors were encountered: