Issues compiling rosbag_storage on OSX - macos

Compiling Ros (Jade) on OSX using this tutorial, I get the following error for rosbag_storage while running ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release:
ros/ros_catkin_ws/src/ros_comm/rosbag_storage/src/buffer.cpp:71:5: error: use of undeclared identifier 'assert'
assert(buffer_);
And then a bunch of errors of the kind:
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:916:9: error: use of undeclared identifier 'assert'
BOOST_ASSERT( deleter_.use_count() <= 1 );
Where could that come from?

Looks like it was coming from a conflict with GStreamer, like in this issue. Just removing /Library/Frameworks/GStreamer.framework/Headers/assert.h was enough to solve the problem:
mv /Library/Frameworks/GStreamer.framework/Headers/assert.h /Library/Frameworks/GStreamer.framework/Headers/assert.h.bak

Related

Install Qt4 on macOS Big Sur

I want to install qt4 on my mac, but whenever I type in brew install qt#4 I get the error
x86_64cpuid.s:273:7: error: invalid token in expression
cmpq $0,%rax
^
x86_64cpuid.s:273:7: error: invalid operand
cmpq $0,%rax
^
x86_64cpuid.s:274:9: error: invalid token in expression
cmoveq %rcx,%rax
^
x86_64cpuid.s:274:9: error: invalid operand
cmoveq %rcx,%rax
^
I tried brew install openssl#1.0 and got the same errors.
I tried to follow this instructions here from the Qt doc, but I get two errors while running make.
../../include/QtCore/../../src/corelib/arch/qatomic_powerpc.h:126:36: error:
invalid output constraint '=&b' in asm
: [originalValue] "=&b" (originalValue),
^
../../include/QtCore/../../src/corelib/arch/qatomic_powerpc.h:143:36: error:
invalid output constraint '=&b' in asm
: [originalValue] "=&b" (originalValue),
^
From filename qatomic_powerpc.h I can guess that it tries to build powerpc binaries, while that architecture has been dropped since 10.6 ‘Snow Leopard’.
While I imagine it is possible to patch Qt 4 sources to make it buildable on Big Sur, I'd like to ask what do you need it for? Most likely a better approach is to port the code to Qt 5.15.2.
Note there is a resolved bug report about that: https://trac.macports.org/ticket/61886

OSX: Building OpenCV 3.0.0, undeclared identifier clEnqueueSVMMap

I'm trying to get OpenCV built on OSX (Yosemite), following this guide: http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/
Got the static libs built fine but when building the shared libs I get errors, including the following:
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
use of undeclared identifier 'clEnqueueSVMUnmap'; did you mean
'svm::SVMFunctions::fn_clEnqueueSVMUnmap'? ...= clEnqueueSVMUnmap;
^~~~~~~~~~~~~~~~~
svm::SVMFunctions::fn_clEnqueueSVMUnmap
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
invalid use of non-static data member 'fn_clEnqueueSVMUnmap'
svmFunctions.fn_clEnqueueSVMUnmap = clEnqueueSVMUnmap;
Any ideas where I might be going wrong...?
As #jprice pointed out it seems I somehow got the WITH_OPENCL_SVM option enabled in CMake. Because OS X doesn't support OpenCL 2.0 yet it should be unticked.

opencv running tutorial test undeclared indentifier

I have been trying to install opencv from source for a while now on i have been using the tutorials from
http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html
I got as far a attempting to build the opencv test project in visual studio (i have built it in x86 but i have windows 7 (x64) dont really think it is related to the problem but just in case someone asks).
Now i build the project and I get the following errors:
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(64): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(65): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(66): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(67): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(79): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(80): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(81): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(82): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(85): error C2065: 'CV_CAP_PROP_FRAME_COUNT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(129): error C3861: 'cvWaitKey': identifier not found
However when i can follow the declaration of highgui.hpp in visual to the file that contains CV_CAP_PROP_FRAME_WIDTH (which for some reason is opencv2/highgui.hpp not opencv2/highgui/highgui.hpp but the latter references the first).
Can anyone explain to why visual studio is not finding the these identifiers?
I have read the link several times and i think i have done everything in there, i would appreciate any help as this is cracking me up.
EDIT AND SOLVED:
Right feel a bit dumb right now, but i will leave this here to others that might find this issue when compiling from github opencv and following the tutorials, the previous issue occurs because changes have occurred in from the version in the website and the one in github, please use the source code version in github (at the time of writing 2.4.9)
https://github.com/Itseez/opencv/blob/master/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
In this version the CV and cv prefix from enums and methods has disappeared.
I hope this helps and sorry for putting the question and replying to it after, but i did spent a while looking at it.

OpenCV 2.4.3 on Xcode 4.5

I'm trying to compile a project that uses opencv using xcode 4.5 on Mountain Lion 10.8, I followed closely the procedure on this link:
Compile OpenCV (2.3.1+) for OS X Lion / Mountain Lion with Xcode
This is the sequence that I have followed;
Installed opencv using ports: sudo port install opencv
configure.compiler = llvm-gcc-4.2
Opened Xcode and created a new project (command line app using c++).
Added the "/opt/local/lib/**" path to "Library search paths"
Added any libopencv_. Dylib to a new group
Added the "/opt/local/include/**" path to "Header search paths"
Every time I try to compile xcode fail with this error:
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:46:
In file included from /opt/local/include/opencv2/core/core_c.h:47:
/opt/local/include/opencv2/core/types_c.h:322:17: error: use of undeclared identifier 'lrint'
return (int)lrint(value);
^
/opt/local/include/opencv2/core/types_c.h:742:5: error: use of undeclared identifier 'assert'
assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F );
^
/opt/local/include/opencv2/core/types_c.h:773:5: error: use of undeclared identifier 'assert'
assert( (unsigned)row < (unsigned)mat->rows &&
^
/opt/local/include/opencv2/core/types_c.h:780:9: error: use of undeclared identifier 'assert'
assert( type == CV_64FC1 );
^
/opt/local/include/opencv2/core/types_c.h:790:5: error: use of undeclared identifier 'assert'
assert( (unsigned)row < (unsigned)mat->rows &&
^
/opt/local/include/opencv2/core/types_c.h:797:9: error: use of undeclared identifier 'assert'
assert( type == CV_64FC1 );
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:46:
/opt/local/include/opencv2/core/core_c.h:1118:5: error: use of undeclared identifier 'assert'
assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ );
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:47:
In file included from /opt/local/include/opencv2/core/core.hpp:56:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:76:5: error: use of undeclared identifier 'va_start'
va_start(__args, __fmt);
^
/usr/include/c++/4.2.1/bits/c++locale.h:84:5: error: use of undeclared identifier 'va_end'
va_end(__args);
^
/usr/include/c++/4.2.1/cstdarg:54:20: note: expanded from macro 'va_end'
#define va_end(ap) va_end (ap)
^
In file included from /Users/oliver/OpenCVHelloWorld/main.cpp:12:
In file included from /opt/local/include/opencv2/opencv.hpp:47:
In file included from /opt/local/include/opencv2/core/core.hpp:56:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:48:
In file included from /usr/include/c++/4.2.1/bits/postypes.h:45:
In file included from /usr/include/c++/4.2.1/cwchar:51:
/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the global namespace
using ::clock_t;
~~^
/usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global namespace
using ::tm;
~~^
/usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global namespace
using ::clock;
~~^
/usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the global namespace
using ::difftime;
~~^
/usr/include/c++/4.2.1/ctime:71:11: error: no member named 'mktime' in the global namespace
using ::mktime;
~~^
/usr/include/c++/4.2.1/ctime:72:11: error: no member named 'time' in the global namespace
using ::time;
~~^
/usr/include/c++/4.2.1/ctime:73:11: error: no member named 'asctime' in the global namespace
using ::asctime;
~~^
/usr/include/c++/4.2.1/ctime:74:11: error: no member named 'ctime' in the global namespace
using ::ctime;
~~^
/usr/include/c++/4.2.1/ctime:75:11: error: no member named 'gmtime' in the global namespace
using ::gmtime;
~~^
/usr/include/c++/4.2.1/ctime:76:11: error: no member named 'localtime' in the global namespace
using ::localtime;
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
I Tried also to change compiler to LLVM GCC 4.2 compiler with no luck.
Someone can 'tell me the exact steps to build projects on xcode using opencv Mountain Lion and Xcode 4.5?
Without access to your code, I can't say whether this would be a complete fix but, in order to to resolve your "no member named..." compilation errors, you might try substituting "/opt/local/lib" for "/opt/local/lib/**" by double clicking on the "Header Search Paths" field and selecting the "non-recursive" option under XCode's "Build Settings" > "Search Paths" > "Header Search Paths".
You could also try recompiling after navigating to "Build Settings" > "Apple LLVM compiler 4.2 - Language" > "C++ Standard Library", and selecting "libstdc++ (GNU C++ standard library)" rather than XCode 4.5's default "libc++ (LLVM C++ standard library with C++11 support)".
I would use a different installing command:
sudo port install tbb
sudo port install opencv +debug +eigen +python27 +qt4 +tbb
eigen and qt4 is optional, tbb is rather essential, since opencv uses tbb massively for multithreading when present. In other words, opencv is much slower without tbb.
I would not manually specify the compiler. As I remember that did not work for me.
make sure its compiled as c++, rename your m files to mm

Compiling Z3 for OCaml

I tried to compile the OCaml version for Z3, however when I build it, it always shows a bunch of error and warning.
These are several of the errors:
z3_stubs.c:7384: error: storage size of `_ctxs' isn't known
z3_stubs.c:7385: error: `camlidl_ctx' undeclared (first use in this function)
z3_stubs.c:7385: error: expected `;' before `_ctx'
I dont really get it, I just try to run the build.cmd, and the error happens, anyone has an idea?
Do you have camlidl installed?

Resources