missing required architecture x86_64 in file opencv - c++

experts:
I am trying to create a C++ framework using Xcode. My framework depends on OpenCV. I am having the same issue as other have had to deal with. I found a likely answer here but when I try to copy the following code into my Prefix.pch file
#ifdef __cplusplus
#import <OpenCV/opencv2/opencv.hpp>
#endif
I get this error when I try to build: 'OpenCV/opencv2/opencv.hpp' file not found
Now, I know that it is because I'm using the opencv2.framework. So my question is:
"How do I reference that in my Prefix.pch file?"
Thank you for your help,
Lucy
-------------------------------------------------- More Info -----------------------------------------
I tried to add the framework but that isn't working. Is there something else I need to do?

I was compiling to 64-bit and OpenCV does not support that. Maybe because of cross architecture support. We changed to Universal (32/64-bit) and that seemed to make it work. There were a few more Xcode configurations that needed to be tweaked but that was the reason for the error.

Another possible option (which happened to me) is that you have accidentally downloaded the wrong OpenCV framework. For example you might have downloaded the iOS one in which case the correct architecture wont exist for your mac. Make sure to download and then extract the right version from the opencv website to a unique folder.

Related

mariadb connector/c++ : /usr/bin/ld: cannot find -lmariadbcpp

im pretty much new to c++ and im currently making a project where i need to connect to a mariadb database, so I investigated and found the official mariadb connector/c++, but im not sure if this is the way most people go... so if you have a better aproach to conect to a mariadb server using c++, please tell me bellow.
Im also using gradle for my project, so if you know how to solve my issue using gradle i'd be graceful.
Anyway, the issue is that when i follow the official guide
https://mariadb.com/docs/clients/connector-cpp/#building-the-c-application
and compile with
g++ -o app.exe app.cpp -std=c++11 -lmariadbcpp
i get the following:
enter image description here
and got no idea what to do about it.
Again, maybe I'm going the official way, but also the dumb/bad way?, and if not, how could i do it using gradle?
Thank you for your time! ^-^
When compiling whith gcc or g++ for the missing library.
You have to make shure every install command works from the mariadb official guide, since the guide is deprecated and some folders and/or files have changed names, which will cause your install commands to fail.
In my case was the fact that the downloaded file contained lib64 instead of lib as the guide suggests, but keep in mind there may be more...

CUDA opencv building fails - missing file that is actually there

I am trying to do the following: getting to work
CUDA 9.1 with
openCV 3.4.2 and
Visual Studio Enterprise 2015 (v 14.0 Update 3) on
Windows 7 Enterprise x64 SP 1 using
CMake 3.12.0
and also searching for others with the same problem - no success there.
I have worked through this tutorial on getting the software to work together. I do not intend to use Intel MKL and TBB.
I have succeeded in
installing CUDA
generating the Makefiles for openCV with CMake, and having the CUDA libraries included without any mistakes (barring the download of optional stuff, as the PC I am working on is to stay off the internet)
generating the .sln solution file for building openCV in Visual Studio
The problem is in the next step - building openCV. The compiler claims that "opencv2/opencv_modules.hpp" cannot be opened by gpu_mat_cu when it tries to build opencv_world. The thing is that the include path works according to Visual Studio - it detects the right file in the gpu_mat.cu. The project (opencv_world) has the right directory in its include paths as static path.
I am new to Visual Studio (I worked in Linux with QT, CUDA and openCV before), so I am not too sure I am not missing some kind of settings I should change.
The opencv_world.hpp only consists of #define instructions. I have tried deleting the include of opencv_world.hpp and instead just defining the parameter in gpu_mat.cu itself, but if I do, the next include (that, again, VS finds the path to without problems) is not resolved.
I guess there is something obvious I am missing, but I don't seem to be able to resolve this issue, so thanks in advance for your help.
Cr4sh
P.S.: The files CMake wanted to download for openCV and failed at (obviously; no internet connection) are: opencv_ffmpeg.dll, opencv_ffmped64.dll, ffmpeg_version.cmake, ippicv_2017u3_win_intel64_general_20180518.zip, res10_300x300_ssd_iter_140000_fp16.caffemodel and opencv_face_detector_uint8.pb
I'd add the CMakeCache.txt file in a spoiler tag, but it has too many characters. If you think it would help, let me know and I'll upload it somewhere.
I got the solution, just in case someone stumbles over the same problem: it's the most simple thing that everybody knows until they don't - my include path contained a white space that apparently somewhere was treated as a String divider for whatever interprets that path.

OpenCV in Code::Blocks: The application was unable to start correctly (0xc00000be)

I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.

OpenCV - How do I get started?

I just don't seem to be able to get OpenCV to work properly. Here's what I want to accomplish:
Use CodeBlocks (which I installed using codeblocks-10.05mingw-setup.exe) with OpenCV (installer: OpenCV-2.4.2.exe) on my Windows x64.
I've tried a lot of different configurations which will only bother you if I posted them all, so I hope you don't mind if I just ask the simple question: how do I get this to work?
I think I'm missing the smallest detail right now, so a detailed description of how to get started would be welcome.
If the OpenCV installer did the job, you should have by now OpenCV libraries and headers already installed in your system.
I would then go ahead and try to compile a hello world basic code, like the one you can get from here. If you would like to program using an IDE, like VisualC++ in Windows, you can follow this guide that will help you setting up the environment.
OpenCV team just introduced their new web site. There you can find Introduction to OpenCV section with installation instructions, including detailed instructions for Windows. Don't forget to cleanup your system before installation to avoid problems with mixing different install options. If you still can't get it working with CodeBlocks, follow Dan's advice and try compiling from command line.
When you are done with installation, go on and read there great new tutorials!

OpenCV: "Feature Matching with FLANN" tutorial - getting exception

I am starting up with OpenCV (using C++) and was playing around with the "Feature matching with FLANN" tutorial from here:
http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html
I did not modify anything, just tried running it as it is. Unfortunately, when running it, I am getting this error when the program tries to detect the keypoints (on the line detector.detect(img_1, keypoints_1)) :
I had no problems with running other OpenCV tutorials out of the box...did anyone experience similar problems?
My system: Visual Express 2010 and OpenCV 2.3, under Windows 7 64-bit. Could this be a bug of v2.3, or some issues related to the 64-bitness of my system?
It sure helps to know more about C++ than a worm :) I realized I had linked against the release version of the feature2d lib. As always, solved automatically by virtue of the "power of posting"...
I have same mistake with your‘s,because you have use different Version of lib file.
If you use debug,you must use lib ended by 'd'.