I am trying to compile a C++ project that uses OpenCV in Xcode 6.2. I have downloaded OpenCV and the header and library files and setting as follow:
Header Search Path: /usr/local/include/opencv2**
Library Search Path:/usr/local/lib
and opencv is truly in this Path,but I get error:
Lexical or Preprocessor Issue
/Users/radio_lee/Desktop/project/OpenCV/OpenCV/main.cpp:1:10: 'cv.h' file not found
when I change the Header Search Path and Library Search Path like that:
Header Search Path:
/usr/local/include/opencv2** and /usr/local/include/opencv
Library Search Path:/usr/local/lib
another error:
Lexical or Preprocessor Issue /usr/local/include/opencv/cv.h:63:10: 'opencv2/core/core_c.h' file not found
/Users/radio_lee/Desktop/project/OpenCV/OpenCV/main.cpp:1:10: In file included from /Users/radio_lee/Desktop/project/OpenCV/OpenCV/main.cpp:1:
OpenCV is a Private Framework,Since it is a Private Framework, it must be copied to the Frameworks/ directory of an Application Bundle, which means, it is useless for plain unix console applications.
We can see the detail in this web site :http://docs.opencv.org/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction
This folder contains toolchains and additional files that are needed for cross compilation.
For more information see introduction tutorials for target platform in documentation.
Related
I'm developing a plugin for mac. I'm trying to use afnetworking and other frameworks which needs arc. I'm trying to create a .a(library) for the framework and access it in firebreath. I tried adding the directory which contains .a using include_directories in projectdef.cmake then linking it in target_link_libraries. Please lemme know how to add this and whether the framework can be used in firebreath without any pitfalls
I have used external libraries in firebreath. Though I have used editors to link the libraries. You need to specify .h files for the function prototypes, along with .a files which will dynamically link to .dylib
Try adding these via Xcode and see if that works.
I'm trying to link the shared library of boost thread into my application.
System: Windows8
IDE: Visual Studio 2010
I build the boost library using:
b2 --with-thread --build-type=complete link=shared
I can see the
boost_thread-vc100-mt-gd-1_55.dll
boost_thread-vc100-mt-gd-1_55.lib
and other file inside the stage/lib directory
I've added the path to Additional Library Directories and Input in linker option as:
Additional Library Directories: C:/boost_1_55_0_dyn/stage/lib
Input: C:\boost_1_55_0_dyn\stage\lib\boost_thread-vc100-mt-gd-1_55.lib
I don't know why on the earth Visual Studio is looking for libboost_thread-vc100-mt-gd-1_55.lib. I haven't mentioned the libboost_thread-vc100-mt-gd-1_55.lib anywhere in the properties or any place. I even search all my files and folders inside the project, libboost_thread-vc100-mt-gd-1_55.lib is not mentioned anywhere.
Well I forgot to put BOOST_ALL_DYN_LINK in preprocessor definition. If the BOOST_ALL_DYN_LINK is not defined, boost looks for static library, that is why its looking for libboost_thread-vc100-mt-gd-1_55.lib
This is additional information to the answer Pritesh already posted, but I'm new here so I can't comment.
It boils down to compatibility between your VS project settings and the way the boost libraries were built. It gets a little tricky because boost and VS do some autolinking for you. Check out the file …\Include\boost\config\Auto_link.hpp. It explains the algorithms and macros that will cause libraries that you didn't explicitly include to show up in your project.
For example, BOOST_ALL_DYN_LINK is used to help determine if the boost library name should have "lib" pre-pended to the name during autolink.
Additionally ,
If you are using cmake and qibuild you can try this :
It automatically links with the corresponding libraries and make their headers available.
qi_use_lib(yourProgramName your libraries)
like this:
qi_use_lib(getimages ALCOMMON ALPROXIES ALVISION OPENCV2_CORE OPENCV2_HIGHGUI OPENCV2_IMGPROC)
I'm trying to build System.data.sqlite (from now on SDS) from source with ICU Tokenizer enabled. I'm using Visual studio -2010 and having trouble adding the precompiled ICU files so that SDS can compile.
I've added #define SQLITE_ENABLE_ICU 1 to sqlite3.c, but that then gives me an error where SDS tries to include a couple of ICU header files (utypes, uregex, ustring and ucol).
Where can I include the folder containing all these files so that this will get fixed? I have never used VS more than a couple of hours in my life and I can't find a single thread that can point me in the right direction.
I've tried the c/c++ under project properties, I've tried under linker, but nothing works.
All advice appreciated.
You have to add ICU's include directoy.
If you have extracted the ICU package in C:\somewhere, then the directory to add would be C:\somewhere\icu\include.
You also need to add C:\somewhere\icu\lib to the library path.
I'm very new to OMNeT++ and I'd like to use the serialization-library contained in the boost framework. However, when trying to use it, I get quite many errors such as:
Description Resource Path Location Type
undefined reference to `boost::archive::archive_exception::~archive_exception()'
OmCCN line 36, external location: /home/alexander/UniBE/BT/simulator/boost-compiledLibs
/include/boost/serialization/throw_exception.hpp C/C++ Problem
. I guess the problem is that I didn't yet link the compiled library in OMNeT. I've had a look at the makefile but any changes there are worthless since it is generated automatically by makemake. Furthermore, trying to access the menu item 'makemake' in project > properties > OMNeT++ IDE throws an error (The currently displayed page contains invalid values).
Can anyone give me a hint concerning what the error could cause or how to link the compiled library correctly?
Any hints are very appreciated!
cheers
alex
First you should get the library files.
For example in Ubuntu you should install these two packages: libboost1.46-dev, and libboost-serialization1.46-dev. Header files will be installed in usr/include/boost and library files will be installed in usr/lib.
To link the serialization library to your program:
Right click on your project and click properties. Then go to OMNET++ > Makemake.
find the Link tab, and in the "Additional objects to link with: (wildcards, ..." section, specify the path to your serialization library (say /usr/lib/libboost_serialization-mt.a).
we're building a cross-platform utility which must have a small footprint. We've been pulling header files from boost as and when we need them but now we must link against some boost C++ thread code. The easiest immediate solution was to create our own custom library using CMake's "add_library" command to create a static library composed of some boost thread source files. These compile without any problems.
The difficulty arises when I try to link to this library from an executable. Visual Studio 2008 returns an error saying that it cannot link to "libboost_thread-vc90-mt-sgd-1_40.lib". What really puzzles me is that I've grepped through all the source code and CMake config files and I can't find any reference to this libboost library, leading me to think that this has been autogenerated in some way.
This works OK in Linux, can anyone point out why I'm experiencing these issues in Windows?
#Gearoid
You found the correct reason for your problem, but not the correct solution. The BOOST_AUTO_LINK_NOMANGLE is an internal, i.e. for library authors, definition to control the auto-linking. The user level definition is BOOST_ALL_NO_LIB which when defined disables the auto-linking feature for all Boost Libraries code you use. This is described in the user.hpp configuration header (see user.hpp near the bottom and the Boost Config documentation). You can also control this on a per library level as describe in that header.
Ok, well, it turns out that Boost uses this auto-link feature for Visual Studio which embeds references to a mangled (ie, platform-compiler-mult-threaded, etc) boost library name.
The header file which controls this is called "auto_link.hpp" which lives in the config directory of the boost include tree. There's a special preprocessor definition called "BOOST_AUTO_LINK_NOMANGLE" which toggles this behaviour.
Another triumph of mediocrity for Microsoft.