Compile on SD-Card
Recently I added a (used) SD-Card into my Jolla. I used it before in my old Android device. I did NOT reformat the card. I copied one of my hobby projects remotely onto the sd card and tried to compile it which did not work because of C++11 not being supported by the given compiler version (gcc/g++ 4.6.4). I then tried to compile a little test program consisting of pretty basic C++ Code. (See below) It compiled but I could not run it. (./a.out failed) The error was:
[nemo@localhost sandbox]$ ./a.out
-bash: ./a.out: Permission denied
However executing it with devel-su did fix the error but I got no output at all. A look with ls -lis
gave me:
[nemo@localhost sandbox]$ ls -lis a.out
1095 32 -rwxr-xr-x 1 nemo nemo 6837 2014-04-02 23:26 a.out
Moving the source to my home directory and compiling it there worked as usual - Compile and execute with user rights with my numbers being printed. Even moving the compiled fille to the home directory gave me my output. Is it normal that the file cannot be executed with user rights from SD-Card and if done with super user does not work (as it should?) Might it be a right management problem since the SD came from android or is that a general problem? Thanks for help.
Appendix A - Used Code
test.cpp:
#include <iostream></iostream>
int main() { for( int i = 0; i < 12; ++i ) std::cout << i << std::endl; }
Compiled with: g++ test.cpp