I will try to help you find out why the cross compilation tools aren't letting you compile code that includes mysql.
Please correct me if I'm wrong, you are trying to execute the command above on the root user, right?
Could you please let us know step by step what you did (from installing the SDK to installing mysql and mraa) and the steps to replicate the issue? We would like to see if we can replicate this behavior.
I'll be waiting for your reply.
1 step. linux 32bit MCU SDK file(.sh) installed.
3) in a terminal, "sudo sh poky-edison-glibc-i686-edison-image-core-32-toolchain-1.7.2.sh" enter as a command
2 step. Install MRAA Library
1) in a terminal "sudo apt-get install git cmake swig libpcre3-dev python-dev build-essential" enter as a command
2) in a terminal "git clone http://github.com/intel-iot-devkit/mraa.git" enter as a command
3) in a terminal "cd mraa" enter as a command
4) in a terminal "mkdir build" enter as a command
5) in a terminal "sudo cmake .. -DBUILDSWIGNODE=OFF" enter as a command
6) in a terminal "sudo make" enter as a command
7) in a terminal "sudo make install" enter as a command
8) in a terminal "source /opt/poky-edison/1.7.2/environment-setup-core2-32-poky-linux" enter as a command
3 step. Install mysql
1) in a terminal "sudo apt-get install mysql-server" enter as a command
2) mysql root passward setting
3) in a terminal "sudo apt-get install libmysqlclient-dev" enter as a command
4 step. code compile
in a terminal "$CC -lmraa -lmysqlclient -L/usr/lib/i386-linux-gnu -I/usr/include/mysql gps_0902.c -o gps_0902" enter as a command
and, when in ubuntu 64bit,
Intel system studio IoT Edition (eclipse) should not be compiled.
I was testing the steps you provided us but on a Linux 64 bit machine (I don't have access to a 32 bit one). I received a different issue but one that could in fact be related, the issue I received was that mysql could not be found. I would like to ask you in which path you stored your code and in if you tried executing the command with sudo.
I'll be waiting for your response.
If you can not find or do not have to install mysql for libmysqlclient, you can not mysql.h did the path setting.
in a terminal "sudo apt-get install libmysqlclient-dev" enter as a command
or, mysql.h no path setting
in a terminal "sudo find / -name mysql.h " enter as a command
Please write out the path to it.
I was able to replicate the error message using a slightly different command: $CC -lmraa gps_0902.c -o gps_0902 -I/usr/include/mysql/ -L/usr/lib -lmysqlclient.
Let me try to investigate what could be happening and I'll get back to you.
Could you please enter the command mysql_config --libs? What's the output of that command?
Could you please try compiling the code but this time including the output of the previous command with $(mysql_config --lib)? Does it also throw an error? Could you please post a screenshot of the compilation?
Also, have you tried compiling this code on directly on Edison? If so, what happens?
I'll be waiting for your response.
Thank you for sending us the screenshot, it will be of help.
I'm sorry, but I don't understand what you mean by "...Intel probably would have tried to compile in Edison. It was an error…”
Could you please explain us what you meant with this?
Also, were you able to compile your code including the mysql libraries with $(mysql_config --lib)? If so, what happened?
Could you please also let us know if you tried your code directly on Edison? If so, does it have any issues?
Let me know.
I have not tested the code directly on Edison (as I have not installed the other dependencies of the code), nevertheless, when I built the environment for cross compiling I did test if the code would compile with GCC and it did without issues.
However, it would be interesting to see if you can do this as well and in case you have installed the dependent packages on your board, to check if the code runs correctly on Edison.
Let me know if you can perform these tests.