FS#23741 - [opencv] needs fix for gcc-4.6.0

Attached to Project: Arch Linux
Opened by Eduardo Lopes (duca) - Wednesday, 13 April 2011, 04:27 GMT
Last edited by Ray Rashif (schivmeister) - Wednesday, 13 April 2011, 23:50 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Ray Rashif (schivmeister)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I've been working on a C++ project that depends on opencv (2.20), but unfortunally gcc-4.6.0 cannot link the required libs into the final bin. I tried both 4.6.0-1 and 4.6.0-2 only in the sake of testing.

Additional info:
* package version(s)
opencv-2.20-3
gcc-4.6.0-1
gcc-4.6.0-2
* config and/or log files etc.


Steps to reproduce:
Compile any opencv example will reproduce the bug.
This task depends upon

Closed by  Ray Rashif (schivmeister)
Wednesday, 13 April 2011, 23:50 GMT
Reason for closing:  Fixed
Additional comments about closing:  testing/opencv 2.2.0-4
Comment by Eduardo Lopes (duca) - Wednesday, 13 April 2011, 04:29 GMT
using the core/gcc-4.5.2-6 gives no error.
Comment by Allan McRae (Allan) - Wednesday, 13 April 2011, 05:15 GMT
Give some actual output.

I get a bunch of this sort of output:

> g++ -o test test.cpp -lopencv_core -lopencv_highgui
In file included from /usr/include/opencv/cv.h:64:0,
from test.cpp:3:
/usr/include/opencv2/core/core.hpp:354:13: error: ‘ptrdiff_t’ does not name a type
In file included from /usr/include/opencv/cv.h:64:0,
from test.cpp:3:
/usr/include/opencv2/core/core.hpp:2600:13: error: ‘ptrdiff_t’ does not name a type


That is fixed by including the cstddef header. That is an opencv issue...
Comment by Eduardo Lopes (duca) - Wednesday, 13 April 2011, 06:02 GMT
This is exactly the message i receive, Allan and as expected, including stddef in /usr/include/opencv2/opencv.hpp solved the issue and the bugreport could be closed.

Allan, it's a bit rhetoric but do you recommend i contact the opencv team regarding this issue?

Just for the record, this is the entire error log:

/usr/include/opencv2/core/core.hpp|354|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/core.hpp|2600|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/core.hpp|2623|error: declaration of ‘operator[]’ as non-function|
/usr/include/opencv2/core/core.hpp|2623|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2623|error: expected ‘)’ before ‘i’|
/usr/include/opencv2/core/core.hpp|2626|error: declaration of ‘operator+=’ as non-function|
/usr/include/opencv2/core/core.hpp|2626|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2626|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/core.hpp|2628|error: declaration of ‘operator-=’ as non-function|
/usr/include/opencv2/core/core.hpp|2628|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2628|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/core.hpp|2641|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/core.hpp|2642|error: ‘ptrdiff_t’ has not been declared|
/usr/include/opencv2/core/core.hpp|2661|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/core.hpp|2684|error: ‘ptrdiff_t’ has not been declared|
/usr/include/opencv2/core/core.hpp|2687|error: declaration of ‘operator+=’ as non-function|
/usr/include/opencv2/core/core.hpp|2687|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2687|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/core.hpp|2689|error: declaration of ‘operator-=’ as non-function|
/usr/include/opencv2/core/core.hpp|2689|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2689|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/core.hpp|2733|error: declaration of ‘operator[]’ as non-function|
/usr/include/opencv2/core/core.hpp|2733|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2733|error: expected ‘)’ before ‘i’|
/usr/include/opencv2/core/core.hpp|2736|error: declaration of ‘operator+=’ as non-function|
/usr/include/opencv2/core/core.hpp|2736|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2736|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/core.hpp|2738|error: declaration of ‘operator-=’ as non-function|
/usr/include/opencv2/core/core.hpp|2738|error: expected ‘;’ at end of member declaration|
/usr/include/opencv2/core/core.hpp|2738|error: expected ‘)’ before ‘ofs’|
/usr/include/opencv2/core/operations.hpp|2822|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/operations.hpp|3383|error: ‘ptrdiff_t’ does not name a type|
/usr/include/opencv2/core/mat.hpp|1629|error: declaration of ‘operator+=’ as non-function|
/usr/include/opencv2/core/mat.hpp|1629|error: ‘ptrdiff_t’ was not declared in this scope|
/usr/include/opencv2/core/mat.hpp|1629|note: suggested alternatives:|
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/i686-pc-linux-gnu/bits/c++config.h|156|note: ‘std::ptrdiff_t’|
/usr/lib/gcc/i686-pc-linux-gnu/4.6.0/../../../../include/c++/4.6.0/i686-pc-linux-gnu/bits/c++config.h|156|note: ‘std::ptrdiff_t’|
/home/eduardo/work/dev/cpp/vision/ernesto_corr/main.cpp|401|error: expected ‘}’ at end of input|
||=== Build finished: 38 errors, 0 warnings ===|



[ EDIT ] Shamely (for me) this issue is already reported on their Trac.
Comment by Allan McRae (Allan) - Wednesday, 13 April 2011, 07:09 GMT
  • Field changed: Summary (gcc-4.6.0-1 (both 1 and 2) cannot link opencv libs into my code (c++) → [opencv] needs fix for gcc-4.6.0)
  • Task reassigned to Ray Rashif (schivmeister)
Reassigning as an opencv issue,
Comment by Eduardo Lopes (duca) - Wednesday, 13 April 2011, 07:46 GMT
i promise the next time i report a bug, i will check more throughly and give the proper information. Here is their's bugtrack reference to the gcc-4.6 incompatibility

https://code.ros.org/trac/opencv/changeset/4861

Thanks Allan, for your support!!

Cheers,
Eduardo - duca

Loading...