Opened 13 years ago
Closed 13 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)
Change History (11)
Changed 13 years ago by saskathex@…
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.0 → opencv @2.2.0_1 build fails |
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 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 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 fails → opencv: error: non-const static data member must be initialized out of line |
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 13 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: | new → assigned |
Has duplicate #31817 which says that using llvm-gcc-4.2 works.
comment:10 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
log file of build