Opened 13 years ago

Closed 12 years ago

#30693 closed defect (fixed)

opencv: error: non-const static data member must be initialized out of line

Reported by: saskathex@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.1
Keywords: clang Cc: mgf64mba@…, genegraphy@…, jens.is.located@…, shankga@…
Port: opencv

Description

Executed a Selfupdate. Cleaned some ports and also cleaned and uninstalled opencv. Reinstalled opencv -> Error

Uninstalled opencv once again and reinstalled.

Attached the log file

Attachments (1)

main.log (1.3 MB) - added by saskathex@… 13 years ago.
log file of build

Download all attachments as: .zip

Change History (11)

Changed 13 years ago by saskathex@…

Attachment: main.log added

log file of build

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: lion added; opencv removed
Summary: opencv-2.2.0_1.darwin_11.x86_64.tbz2 fails on Lion 10.7.0opencv @2.2.0_1 build fails

comment:2 Changed 13 years ago by saskathex@…

Cc: saskathex@… added

Cc Me!

comment:3 Changed 13 years ago by saskathex@…

Cc: saskathex@… removed

Cc Me!

comment:4 Changed 13 years ago by m.haller@…

opencv 2.3.0 seems to work with lion ... see http://br1ckb0x.fancy-bits.net/blog/?page_id=417

comment:5 in reply to:  description Changed 13 years ago by balazs.vagvolgyi@…

The issue seems to be an interference with the default MIN(a,b) macro in one of the OS X frameworks.

Got it working by modifying the following files:

OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp OpenCV-2.2.0/modules/core/include/opencv2/core/operations.hpp

The modification involved creating another MIN macro in both files, I called it __MIN(a,b):

#define __MIN(a,b) ((a)<(b)?(a):(b))

and replacing all MIN(...) calls with __MIN(...).

After the changes opencv compiles without errors.

comment:6 in reply to:  description Changed 13 years ago by balazs.vagvolgyi@…

Issue only seems to occur with Xcode 4.2 beta.

Compilation succeeds without issues on Xcode 4.1 stable.

comment:7 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… mgf64mba@… genegraphy@… jens.is.located@… added
Summary: opencv @2.2.0_1 build failsopencv: error: non-const static data member must be initialized out of line

Has duplicates #31602, #31686, #31719.

I had been working on an update to opencv 2.3.1; it seemed to have other issues but I'll see what I can do to finish that up.

comment:8 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Meanwhile, try building opencv with llvm-gcc-4.2 instead of clang:

sudo port clean opencv
sudo port install opencv configure.compiler=llvm-gcc-4.2

comment:9 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: shankga@… added; ryandesign@… removed
Keywords: clang added; lion removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

Has duplicate #31817 which says that using llvm-gcc-4.2 works.

comment:10 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Committed r86572 to make opencv use llvm-gcc-4.2 instead of clang.

Filed #31818 to update opencv to latest version.

Note: See TracTickets for help on using tickets.