Comments (10)
What is the commandline you're using to compile?
Maybe you need something like the -lm
flag to link in the math library?
I really don't know. You might have better luck posting in an Arduino forum. Please report back if you do figure it out, though.
from tinyexpr.
I am not using command line to compile. I think the arduino ide automates the process. I will try to get help with the arduino forum. But likely they will respond to contact the author to fix the issue though.
from tinyexpr.
You should be able to see what the IDE is passing to the compiler somehow. I think it could be very helpful to know.
from tinyexpr.
I assume you've also added tinyexpr.c
into your project somehow. You may need to make sure that it is being compiled as C and not as C++. Just a thought.
from tinyexpr.
Yes, I setup the ide to include your library including the source and the header file. It don't complain about undefined reference to the first function in the library which is te_interp
so the library is included in the right way. I think the error is somewhere in line 119 on tinyexpr.c
.
static const te_variable functions[] = {
118 /* must be in alphabetical order */
119 {"abs", fabs, TE_FUNCTION1 | TE_FLAG_PURE, 0},
from tinyexpr.
What happens if you comment out line 119? Does it then complain that acos
(from line 120) is undefined?
It seems like it's not linking against the math library. The usual way to do that on gcc is with the -lm
flag. It could also be a C to C++ name mangling issue.
It also may be that the Arduino doesn't support pointers to functions, in which case you'd be out of luck.
from tinyexpr.
I tried your suggestion. It compiles successfully after commenting the fabs
line. Do you know what is happening?
Maybe it is arduino issue?
from tinyexpr.
No, that's really odd. fabs
is very much part of standard C.
TinyExpr should work fine with that line commented out, you just won't have access to the abs
function (you could write your own very easily though).
You should ask someone who knows about Arduino and report back.
from tinyexpr.
Ok. I will. Thanks for the heads up.
By the way, can you add bitwise operations like &
, |
and !
?
Those operations are very important to embedded systems.
from tinyexpr.
TinyExpr works with floating point, so bitwise operators don't really make sense there.
You could probably fork TinyExpr to use integers (I know at least one person already has) and then add those operators yourself pretty easily.
from tinyexpr.
Related Issues (20)
- Feature request: add logical operators.
- Feature request : right and left shift operations HOT 4
- Look ahead Variables HOT 4
- Custom infix operators HOT 3
- How about support time expression? HOT 2
- Importing into gcc gives "error: array subscript has type 'char'" HOT 2
- The website says that this is a header-only library, but the actual code isn't HOT 2
- Extraction of tokens HOT 5
- Support for bigger whole numbers (long long) HOT 1
- When evaluate simple expression with only one variable, nan is returned over 150 HOT 6
- warning: ISO C forbids conversion of function pointer to object pointer type
- array bounds warning with gcc-11
- codeblocks compiler issue? HOT 2
- Weird behavior when calling te_free HOT 3
- Feature request: Add define to change return value from double to long double HOT 6
- Usage with different types HOT 2
- Feature Request: Implement ternary evalutation HOT 9
- Error eval expression when initializing te_variable by individual assignment HOT 7
- Function to determine the number of variables in an expression HOT 2
- Possible memory leak in te_compile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyexpr.