Cross Compilation error in starting with opencv in imx6 processors

i am following Starting with opencv in IMX6 processors in toradex website
i have done till here below… i created a src directory in my_project folder…
mkdir src
gedit src/myApp.cpp

#include <iostream>
#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

int main(int argc, char** argv ){
cout << "OpenCV version: " << CV_MAJOR_VERSION << '.' << CV_MINOR_VERSION << "\n";

    if ( argc != 2 ){
        cout << "usage: ./myApp \n";
        return -1;
    }

    Mat image;
    image = imread( argv[1], 1 );

    if ( !image.data ){
        cout << "No image data \n";
        return -1;
    }
bitwise_not(image, image);
    namedWindow("Display Image", WINDOW_AUTOSIZE );
    imshow("Display Image", image);

    waitKey(0);

    return 0;
}

After this i have run the command “make”. And the following errors have occured…

bmit@bmit-HP:~/my_project$ make
Scanning dependencies of target myApp

[100%] Building CXX object CMakeFiles/myApp.dir/src/myApp.cpp.o
Linking CXX executable bin/myApp
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/libexec/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/5.2.1/real-ld: error: cannot open /lib/libc.so.6: No such file or directory
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/libexec/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/5.2.1/real-ld: error: cannot open /usr/lib/libc_nonshared.a: No such file or directory
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/libexec/arm-angstrom-linux-gnueabi/gcc/arm-angstrom-linux-gnueabi/5.2.1/real-ld: error: cannot open /lib/ld-linux-armhf.so.3: No such file or directory
../sysdeps/arm/start.S:124: error: undefined reference to '__libc_start_main'
../sysdeps/arm/start.S:128: error: undefined reference to 'abort'
../sysdeps/arm/start.S:113: error: undefined reference to '__libc_csu_fini'
../sysdeps/arm/start.S:120: error: undefined reference to '__libc_csu_init'
/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/include/c++/5.2.1/bits/char_traits.h:267: error: undefined reference to 'strlen'
/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/include/c++/5.2.1/bits/char_traits.h:290: error: undefined reference to 'memcpy'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/myApp] Error 1
make[1]: *** [CMakeFiles/myApp.dir/all] Error 2
make: *** [all] Error 2
bmit@bmit-HP:~/my_project$ ^C
bmit@bmit-HP:~/my_project$ ^C
bmit@bmit-HP:~/my_project$ 

Please solve this.

Hi @hemasree

Could you provide the version of Software ( uname -a) of your module? Which carrier board are you using?

Did you compile yourself the image for the module and the corresponding SDK? If yes, could you provide the information (changes in files, building commands, …) how you did it?

Thanks and best regards,
Jaski

Linux colibri-imx6 3.14.52-v2.6.1b1+g3894f6d #1 SMP Wed Jun 12 16:08:30 IST 2019 armv7l GNU/Linux
Carrier board: Col Evaluation V3.2

I had run the commands that the Toradex website has provided in ‘Starting with opencv in iMX6 processors’ ,the commands for generating SDK, Preparing for cross-compilation and then cross compiling and deploying.
I pasted the code in myApp script file and ran the command make.
Then the above mentioned error had occurred.

Thanks for the Information.
Bsp 2.6 is not supported any more. Could you update to 2.8b6 and check if you still have the issue?

Thanks and best regards,
Jaski

Thanks for your reply. Presently, I am following ‘Starting with OpenCV on IMX6 processors’ -Toradex. What step should i have to take to update the BSP from 2.6.1b to 2.8b6

i have followed this link and installed opencv2.4 package that has been given in. We are trying to build linux image with openCV as given and followed all the steps as it is. So, what should my next step to be taken?

You need to build an Image and SDK with Bsp 2.8 as discuessd here.

I could able to cross compile basic c++ program.
But i could able to cross compile the opencv c++ codes.
please go through the errors in the attachment below.

first ‘make’ is for hello world program. second ‘make’ is for opencv cpp code.
[upload|cO6VCDxh50SYPj11Y/HlRLd2r0k=]

And also i tried to compile in another way which was shown in 2nd attachment and the following error has occured[upload|kD4xAlRJw9MCgcmDu+OsyCYanck=]

Could you provide your makefile? Thanks.

link text
Hi @jaski.tx

You would refer the makefile and for any further info you would also refer the ‘myproject’ directory. I have attached both of them.

Thanks

hi @hemasree

I could compile the project with SDK built with opencv included as explained here and with the attached Makefile.

Best regards,
Jaski

Thank you so much. I could able to run the make file.
Now i would like to run the executable file on my arm. How could i do this? please help me by giving some idea about it.

You just have to copy it to the module and run it by typing ./myApp.