The rapidjson build within Xcode 5.1.1 is already old.
I found the FileStream class which is already deprecated and there is no FileReadStream.
Anyone know How to update rapidjson in Xcode 5.1.1?
rapidjson is a header only library, you should be able to just grab the latest version from the rapidjson git repository and place the files in your project/system's include path.
Note that this repository is in active development and I don't see any official stable releases yet, so you may also want to check out its old home at google code. This is discussed in this issue on the github repo.
I'm not sure about updating the libraries that come with Xcode specifically. You should be fine with just adding the rapidjson header files somewhere on your machine - either with the rest of your include files or in a directory which you specify to GCC as being an include directory using the -I(include directory here) command line option.
For example:
-I"external/includes" if you place the rapidjson files in the relative directory external/includes/rapidjson and use #include <rapidjson/(rapidjson file name)> when including a rapidjson file.
If you do either of those GCC will look there before looking in the system include paths (where XCode most likely installed rapidjson), and use the newer files you provided. I don't have any personal experience with LLVM, but I'd assume they would handle include files the same way (though the command line option may be different).
Related
I'm learning to use OpenCV (and C++) in Codeblocks. What confuses me, however, is that when I start to include header files from OpenCV in my main.cpp file, Codeblocks automatically suggests to me the files as shown in the image below.
I have not included any search paths to project build options, so how is this possible that Codeblocks can find the files? Is there some other variable working here that I'm unaware of?
Note that I'm a beginner with both Codeblocks and OpenCV and that I only have a little experience with C++.
Thank you
Of course when you install an IDE like code::blocks by default, it knows about standard path for library on your OS.
On my OS -> Ubuntu that is /usr/include
It only searches on a standard path, except you add one. If you install your library by command-line, it goes to the standard place, if you installed manually, then it depends on your option you added to installation. I can not see you screen-shot but it has access to /usr/include by default.
For more detail on Linux and OpenCV
And here is a screen-shot of codeblock on Ubuntu that I added some 3rd-party library
NOTE:
if you install any libraries by command-line, just use it.
But if you have installed them manually, you need to add 2 things to codeblock.
1. First is your path for header file
2. Second is your path for linker
And you see it in screen-shot that say: Search Directory
First is for header and second is for linker
I used Homebrew to install gphoto2 and libgphoto2 for use in a camera-control application using C++. I have confirmed that header files were linked in /usr/local/includes:
Screencap of includes folder on my system
Based on the sample code available at https://github.com/gphoto/libgphoto2/tree/master/examples, it seems like I should be able to use includes such as #include <gphoto2/gphoto2.h> to access the header files, but that approach has failed using both Clang and Xcode as the compiler. The files are not found. What am I doing wrong?
I have tried to install igraph by running the following commands (as described in the manual):
./configure
make
make check
make install
The installation instructions do not provide any further information where to go from here however. How do use the files in my ongoing projects (for instance in Eclipse)?
According to the manual, the installation process is adding files to the 'usr/local/bin', but this folder is empty after the installation (no hidden files).
What would be the easiest way to use the files in my C++ projects?
The installation process is adding include files in /usr/local/include (more precisely in /usr/local/include/igraph only) and library files in /usr/local/lib. Stick /usr/local/include to your include path in Eclipse, add /usr/local/lib to your library path in Eclipse, and add igraph to the list of linked libraries, and you are good to go. Make sure to use #include <igraph/whatever.h> in your C++ code to include igraph-specific stuff.
Also, this project tries to provide a more C++-like API for igraph. It is still experimental, the API changes all the time and many igraph functions are not wrapped in C++ equivalents yet, but it's a starting point that you can extend.
I have never had to use libraries other than ones that I have created, and even then I have simply copied the source files into the same directory as the remainder of the project. What are the steps to install and use libusb? I know that it is required to indicate to your respective IDE the pathway to the library, but to what exactly? To the folder containing the source? Is it necessary to precompile the libraries first?
I am not sure what to download from that link to get this going. There are options to sync via a repository to have the most up-to-date source, but is that necessary? I downloaded the tarball and have the source, but am not sure where to go from here.
Your compiler needs to know the path to the headers (.h), to find them when you #include and know which symbols (functions, structs ..) are available. Your linker needs to know the path to the corresponding compiled libraries (.o/.a/.so) containing the implementation. You don't need the source code (C/C++ implementation code, "private" headers) to use a library.
What you download depends on how you want to install it. If you are using a Linux distribution that already packages it, you can just install it using your package manager. You can get the newest version of libusb throught GitHub too, it is only "necessary" if you want something that is in the newest version. You can compile and install it in your /home or system wide. You can keep the sources in a separate directory next to your project's sources (git submodule can help to manage that), and compile them at the same time as your project. How you install them is your choice, then you just need to configure your IDE/build system accordingly.
I am new to the Mac OS X environment when it comes to compiling linux based libraries. Whenever I used a library i just downloaded the .framework file, added it to my /Library/Frameworks and included it in my XCODE project, and all was fine.
Now I am stuck with libnoise. I want to use it on my project and I have no idea how to generate the .framework file/directory.
Can you help me please?
If you have libnoise, most likely it contains some sort of a Makefile or a configure script.
By running the
./configure
make all
you will get the library file (libnoise.a) for your platform, the OSX10.8.
Framework is essentially a folder with specific layout and a .plist file. To generate such a folder automatically, you may create an expty Xcode project of the type Framework and add the libnoise.a you've just created as a linker's input.
There is a detailed instruction on how to create the Framework from static libraries (.a files): http://www.blackdogfoundry.com/blog/creating-a-library-to-be-shared-between-ios-and-mac-os-x/
You might be missing the header files in you framework, but then can be also added to the Xcode project from libnoise sources.
This SO answer may be of use also: Difference between framework and static library in xcode4, and how to call them
Apple's documentation is also good: https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html
I'm not entirely sure if this is what was meant by "with a different fork and cmake"
but I got libnoise to run in my mac using this git repo.
https://github.com/qknight/libnoise