Ask Your Question
1

Compiler errors on Arm

asked 2013-08-01 18:09:52 -0600

abrykt gravatar image

updated 2013-08-05 05:57:24 -0600

When compiling on ubuntu 12.04 desktop with gcc 4.6 things works fine. When compiling on a beaglebone with an arm processor and arm-angstrom-linux-gnueabi-g++, the following compilation errors appear.

/usr/include/opencv2/core/core.hpp:443:23: error: statement-expressions are not allowed outside functions nor in template-argument lists
/usr/include/opencv2/core/core.hpp:443:35: error: template argument 2 is invalid

and

/usr/include/opencv2/core/operations.hpp: In static member function 'static cv::Matx<_Tp, m, n> cv::Matx<_Tp, m, n>::diag(const diag_type&)':
/usr/include/opencv2/core/operations.hpp:367:24: error: 'd' cannot be used as a function
/usr/include/opencv2/core/operations.hpp: In member function 'cv::Matx<_Tp, m, n>::diag_type cv::Matx<_Tp, m, n>::diag() const':
/usr/include/opencv2/core/operations.hpp:443:11: error: request for member 'val' in 'd', which is of non-class type 'cv::Matx<_Tp, m, n>::diag_type {aka int}'

There is no object named d with a member val, no object named d at all.

Any help or pointers is very appreciated!

(If you would like to try to build the project, just message me and I will give you permissions to do a checkout)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-08-02 06:49:20 -0600

What is your compiler version? Do you try to use cross compilation approach like that?

edit flag offensive delete link more

Comments

Hi Alexander, thanks for your comment. I should have mentioned the compiler used. The compiler used in beaglebone, which is running an Angstrom distribution, is arm-angstrom-linux-gnueabi-g++ I am cross-compling with this compiler from my desktop, and I also tried compiling directly on the beaglebone, but the errors are the same. OpenCv comes pre-installed on the beaglebone, so it would be strange if it did not work with the default compiler, or?

Do you have any experience using arm-angstrom-linux-gnueabi-g++ with OpenCv?

Maybe I should try gcc-arm-linux-gnueabi instead.

abrykt gravatar imageabrykt ( 2013-08-02 08:26:04 -0600 )edit

Do you use OpenCV release or code from Git repo. I recommend you to use 2.4 branch. It is base branch for all 2.4 releases and it is mostly stable. Master is in experimental state now and can have some functional or compilation issues. OpenCV team works with some ARM-based embedded devices with Linux and everything is ok. We used both versions GCC 4.4 and 4.6 in native and cross compiler way (default Ubuntu cross compilers arm-linux-gnueabi and arm-linux-gnueabihf). I recommend you to check compiler version and upgrade it if needed. Also try to take code from 2.4 branch and build it. If build fails the best solution is ticket on code.opencv.org with full information about OpenCV version, compiler version, build log, etc.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-08-03 12:33:59 -0600 )edit

Im a using the pre-installed verison on the beaglebone black, it is version 2.4.2. I will try the compiler you used and rebuild with those.

abrykt gravatar imageabrykt ( 2013-08-04 14:32:04 -0600 )edit
1

I booted the Beaglebone Blackfrom and mini Sd-card with BeageBone Black Ubuntu Precise 12.04.2 LTS from this page http://www.armhf.com/index.php/download/. I then followed the same pages instruction on how to resize the card to get more space. I the used the 2.4.6 release version of OpenCv and recompiled it with gcc version 4.6. The compiler errrors described above is gone. Great!

abrykt gravatar imageabrykt ( 2013-08-05 05:42:22 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-01 18:09:52 -0600

Seen: 848 times

Last updated: Aug 05 '13