First, I would like to ask you if you have tried Eclipse's official guide to add SQLite (Connecting to SQLite - Eclipsepedia ). And if you did, how did it go? Did you have any error messages or anything that could be of help?
I would also like to ask you which OS are you running Eclipse on? As you might imagine, it's not the same thing on Windows, Linux or OSX.
Let me know.
Thank you for your reply. I had a look at the thread link - and I think you posted the wrong link. It's nothing to do with sqlite.
To answer your questions, I'm using Intel System Studio IOT Edison - Eclipse C/C++ out of the box on Windows 10. All of my code is written in C using mraa for the Intel Edison. I would now like to link in the sqlite3 database into my Eclipse project. The original error message is: undefined reference to sqlite_open
I know the problem is not syntax or code - it's that Eclipse is not aware of the sqlite3 pre-compiled library.
Since posting the original question - on another forum I've been given help to compile and link in sqlite directly on the Edison using: gcc main.c -l sqlite -l mraa
This works, but is not my preferred method of building my system. I would like to stay completely within Eclipse. Just like doing a Google search - it comes down to knowing what question to ask.
I hope that my question is now a little more clear - and if there was a mistake with the thread link - I'd be very keen to look.
I apologize, you are correct, I posted the wrong link, it is now corrected.
The method you were provided in the other thread is in fact the one that I prefer as it avoids some issues that occasionally appear when using Eclipse.
If you would like to only use Eclipse, then you will have to add the sqlite libraries to Eclipse. It needs to identify the libraries on the IDE in order to know that there's no issues with the code and to make sure everything runs smoothly on the IDE. You will also need sqlite on Edison as it is where it'll end up actually running.
Try the guide in the link above (now corrected) and let us know how it goes.
I was wondering if you still need help with this. Please let us know if you were able to try the guide in the link that Peter suggested you.
The answer is that if I want to use sqlite3 I must copy my source to the Edison and 'make' directly on the Edison. Unfortunately that means that I can only use Eclipse as a text editor. All calls to the sqlite3 are #if def out in Eclipse , and #if def in on the Edison. Putting the sqlite3 libraries into Eclipse is a nightmare - if someone has done this, it would be great if a step-by-step instruction manual was created to manage all of the #if everything's through the build.
Unfortunately, the only guide I know about this subject it the one that I posted before: https://wiki.eclipse.org/Connecting_to_SQLite. But there are some other useful links online that might help you like:
Thank you for your follow up and further details.
What I noticed with each of the examples you've provided is that they are either compiling directly on the target (which I'm able to do also) or they are running on a Linux/Ubuntu operating system. In the second case, they are able to add the sqlite3 library directly into their operating system and reference it from the Eclispe compiler.
I'm running on Windows 10 - which means that I would have to add the sqlite3 source to my project. I tried to do this, and I think you had the same conclusion that it's a minefield due to the exhaustive number of #define and if you're not an expert you'd never figure it out.
Does what I've said make sense? It seems that most of the programmers working in the space are old school and are either on Linux OS or compiling directly. I'm new school and like the GUI's
I'm not sure what the real solution is?
I guess it'll come down to compiling directly on the Edison
or someone with knowledge and skill need to provide clear instructions on how to use the sqlite3 source directly in the Eclipse environment
or an in-built library to Eclipse would be magic.
I completely understand your point, however, the process I mentioned above is currently the only way to add it to Eclipse.
Considering what you have explained so far, it seems that the best approach for your project is to compile directly on Edison. I know this is not the option you prefer, but it would be the easiest one considering the fact that adding sqlite3 to Eclipse is not as straight forward as we wish.