1 2 Previous Next 18 Replies Latest reply on Jan 28, 2015 2:26 PM by annu_shah

    Question regarding Yocto tiny linux image

    NithishChauhan

      Sir i hav compiled and runned C C++ programs using the yocto linux tiny which supports Arduino ide also ...but when i tried to do so  with open cv related programs like this

      g++ opencv_ex1.cpp  'pkg-config opencv --cflags --libs' -o opencv_ex1 it showed me

       

      pkg-config opencv --cflags --libs: No such file or directory


      so i thought to search files and i see that there are opencv related files in /usr/lib/

       

      IMG_20141010_202021.JPG



       


      IMG_20141010_202124.JPG

      i don't know how to make use of these libraries please help me....!!!!





        • 1. Re: Question regarding Yocto tiny linux image
          mhahn

          I know the images typically don't come with manpages installed. But you can search the internet for "man g++" and should find hits like g++(1): GNU project C/C++ compiler - Linux man page

          There you can find a section "Options for linking"

          Wihin there you can find:

           

          "

          -llibrary

          -l

          librarySearch the library named

          library when linking. (The second alternative with the library as a separate argument is only for

          POSIX compliance and is not recommended.)

          It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus,foo.o -lz bar.o searches library z after file foo.o but before bar.o. If bar.o refers to functions in z, those functions may not be loaded.

          The linker searches a standard list of directories for the library, which is actually a file named liblibrary.a. The linker then uses this file as if it had been specified precisely by name.

          "

           

          In particular there is no such option "--libs" and also no such option "--cflags"

          • 2. Re: Question regarding Yocto tiny linux image
            AlexT_Intel

            That error comes from pkg-config command inserted in backticks into the g++ command line.

             

            NithishChauhan, you need to install "opencv-dev" package for pkg-config to work like that, it's available in my package repo

            • 3. Re: Question regarding Yocto tiny linux image
              mhahn

              thanks AlexT_Intel - NithishChauhan - sorry,I missed that part. Was just looking at "g++ --libs"

              • 4. Re: Question regarding Yocto tiny linux image
                NithishChauhan

                i didn't get that sir ....sir i need to install 'opencv-dev ' how...?

                how to install these repos on galileo after getting them downloaded...?

                sir please explain....!!

                • 5. Re: Question regarding Yocto tiny linux image
                  NithishChauhan

                  Sir i want both OpenCV to be executed C++ on galileo along with arduino compatibility via Arduino ide...

                  • 6. Re: Question regarding Yocto tiny linux image
                    AlexT_Intel

                    NithishChauhan, go to this page: http://alextgalileo.altervista.org/package-repo-configuration-instructions.html Configure the package repo connection as described there. Then run "opkg update" and make sure you get the expected output (also listed on that page). After that run "opkg install opencv-dev" to install the package you need for such compilation you ask about in the first post.

                    • 7. Re: Question regarding Yocto tiny linux image
                      NithishChauhan

                      Sir i did like u said in that page i mean  "Galileo configuration instructions:" but got error like wget 'http:...' bad download address

                      so downloaded all the necessary packages in my PC and copied it to a folder in SD card ....and then via SSH i ran this command in that directory like this

                      " opkg install *.ipk" i got almost all installed except for few it was unsuccessful.......anyhow i did compile the opencv program written in C++ like "g++ opencv_ex1.cpp 'pkg config opencv --cflags  --libs' opencv_ex1" and got the result .........i am very much impressed with this board.....it took around 5 min to compile but took less than a second to execute binaries.......i got the result as expected .....Thank you sir without those packages this would have not been possible............Thanks a lot

                       

                      One question sir can this galileo linux image environment be simulated like in virtual machine....? so that compilation happens bit faster..........?

                      • 8. Re: Question regarding Yocto tiny linux image
                        NithishChauhan

                        Sir in the morning  i successfully compiled the opencv C++ code and got the binary file which is still getting executed producing "result.jpg " each time i run it.........

                        But i don't know what happened ,, in evening  i just changed the name of input image and wanted to test with HD image but its not getting compiled

                        please see the below image

                        IMG_20141014_170356.JPG

                        as u can see its showing like 'No such file or directory for 'pkg-config opencv --cflags --libs '  but when i type in pkg-config opencv --cflags --libs as  command it lists all opencv related files ......Please help me compile i am getting error every time ....for compilation..............Please help me out sir..........

                        • 9. Re: Question regarding Yocto tiny linux image
                          AlexT_Intel

                          NithishChauhan, answering your prvious question, there's no VM image available for something like a Galileo simulator (though I think that should be possible with qemu and some time spent on configuring it properly), however there's something called "cross-compilation toolchain", which is in the Downloads section of this community.  It's available for Linux, Windows and Mac, you just download it, unpack/install and you can compile programs for Galileo on your normal PC.

                           

                          As far as the error is concerned, the images are blurred (by the way, why don't you just copy and paste the text from the terminal? I guess making and uploading photos is more hassle than that), but it looks to me like you're using single quotation marks instead of backticks in that command, so it doesn't work.

                           

                          It should be

                          g++ `pkg-config opencv --cflags --libs` -o opencv_ex2

                          • 10. Re: Question regarding Yocto tiny linux image
                            NithishChauhan

                            Yes sir you were right .....the problem was with quotes and its solved now thank you sir it worked successfully ........can u please help me out with cross compiler toolchain...i have downloaded it and extracted all windows related files but i am not getting how to get it to work .....can u please guide me...?.......

                            • 11. Re: Question regarding Yocto tiny linux image
                              AlexT_Intel

                              Check out this thread: https://communities.intel.com/message/247829#247829

                              It's about the Linux version of the toolchain, but the Windows one is very similar. I'm downloading it now and will add a post later with more details.

                              • 12. Re: Question regarding Yocto tiny linux image
                                AlexT_Intel

                                Okay, looks like you'll need to install Cygwin (with bash, tar and gzip, at least) or a similar emulator first as the toolchain is still UNIX-like with scripts using the *nix paths notation.

                                1. Start Cygwin bash shell
                                2. Create a /opt/poky-edison/1.6 directory by running
                                  mkdir -p /opt/poky-edison/1.6
                                3. Unpack the contents of the toochain archive and put it into the dir you created (the below is for 32-bit toolchain, adjust accordingly for 64 bit).
                                  cd /path/to/download/dir
                                  unzip edison-sdk-win32-weekly-68.zip
                                  cd /opt/poky-edison/1.6
                                  tar xjvf /path/to/download/dir/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.6.tar.bz2
                                4. After that set up environment variables by running
                                  source /poky-edison/1.6/environment-setup-core2-32-poky-linux
                                5. And now you can compile stuff by running
                                  ${CC} testfile.c -o testprogram

                                Something along these lines. Now I haven't actually run those steps myself, so there may be small omissions, feel free to post any further problems you face in this thread and we'll sort them out.

                                • 13. Re: Question regarding Yocto tiny linux image
                                  annu_shah

                                  Intel Galileo Gen 2 Eurobot videos :-

                                  annu shah - Videos - Google+

                                   

                                   

                                  i used the same steps :-

                                  made a connection with linux

                                  Run "opkg update"

                                  Run "opkg install opencv-dev"


                                  then i compiled the cpp file with the following command :-


                                  g++ shah.cpp `pkg-config opencv --cflags --libs` -o shah


                                  but i get this error :-


                                  /usr/lib/gcc/i586 poky-linux-uclibc/4.7.2/../../../../i586-poky-linux-uclibc/bin/ld: cannot find -lopencv_ts

                                  collect2: error: ld returned 1 exit status


                                  11.png


                                  i am using galileo gen 2 and the linux is loaded from the sd card  "Poky 9.0.2 (Yocto Project 1.4 Reference Distro) 1.4.2 clanton"

                                   

                                  Regards

                                  Annu shah

                                  • 14. Re: Question regarding Yocto tiny linux image
                                    AlexT_Intel

                                    Looks like you actually need to install two packages to be able to compile such a program: opencv-dev and opencv-staticdev. The first one contains the necessary headers and the pkgconfig file, while the second one has the library itself (libopencv_ts.a).

                                    1 2 Previous Next