I have been looking for Qt USB solution and came across this QtUSB wrapper, which looks the most promising. It wraps around libusb 1.0 And upon examining the source code in the /src directory, I see a reference to
#include <libusb-1.0/libusb.h>
I have not compiled libusb not I have it installed using apt-get on my Ubuntu machine. I would like to have a solution, where all source files are included in my master solution and I compile this at once on all platforms I need.
I.E. I do not wish to compile the 3 modules separately and link to each other, rather I'd like to include them into my solution and build all at once.
How should I proceed? Whatever I try is giving me some errors with some components not present or some classes not defined. I placed all QtUSB files into /QUSB directory in my project and I imported all files into Qt Creator. I then did the same for /QUSB/libusb-1.0 files.
Related
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 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.
EDIT : OK, I fixed the issue I outlined originally with not being able to find headers for curl and cryptlib. But, after fixing these issues by installing curl and libcryptopp with macports, I encountered a zillion errors in the associated files. I'm marking this answer as complete though
I'm trying to add the Mega.co.nz client SDK to an Objective-C XCode project. The client is written in C++, with .h header files and .cpp implementation files. XCode recognizes these as needing to be compiled with the C++ compiler (I presume).
At this point all I want to do is get the project to compile with no errors. At this time I am getting two errors, both of them on some #include statements.
#include <curl/curl.h> 'curl/curl.h file not found'
#include <crypto++/cryptlib.h> 'crypto++/cryptlib.h file not found'
I think it has something to do with me not having the correct components installed or not referenced correctly within XCode. Should I be linking against a static library to get these headers? Is there a project setting I need to change to search in a specific directory to find these files?
If you can help, thank you very much.
Xcode cannot find the above headers. This is because they are not in the include path. This is most likely to one of two reasons.
You don't have the above libraries installed.
You haven't added the correct path to your build config (like /opt/local/include if you are using macports)
Solutions to try:
Make sure that you actually installed Curl and cryptopp (crypto++) (i.e. compiled them yourself or used a package manager like macports or brew)
Make sure that your build includes the paths to these files (Look at the "header search paths" in xcode project settings
PS. Do not think about linking or such - this has nothing to do with it. You will run into these problems after you've actually compiled the code - i.e. in the linking phase :)
I would like it to operate similarly to how the normal test framework works - if you the tests from the Product->Run tests menu item, the output should appear in the left sidebar window.
I found a guide for using xcode 3 with boost test, but couldn't figure out how to translate those instructions for xcode 4 (if it is even possible).
Finally, I'm building an iPhone application. I could get boost running using the #include <boost/test/included/unit_test.hpp>, however it is pretty slow. Using the standard #include <boost/test/unit_test.hpp> results in link errors due to the library being built for the wrong architecture.
You should build the boost library to a static library ".a" using .configure and make.
According to this:
No special build options or macro definitions are required to build
the static library. Using the Boost.Build system you can build the
static library with the following command from libs/test/build
directory:
bjam [-sTOOLS=] {-sBUILD=boost_unit_test_framework}
This library or libraries and their respective headers need to be added to the project. (Two built versions are needed, one i386 for the simulator and one ARM for devices).
The static library is imported from Link Binary with Libraries in
Build Phases.
Also you need to tell XCode which of these to use, you
can do this by setting contidional build settings in `Build settings-
Library search paths. Above this line is where you add the Header
Search Path to the boost header files.
After this you should be able to include the headers (Added above) in C++ or objective-C++ code of yours. (To make Obj-C files Obj-C++ files you need to change all deppendent .m files to .mm)
If there is a some problems after this, switching Compiler or standard library for C++ in Build Settings might help.
main.cpp which should be executable C++ app. It shall depend on
Lib1 be a required to be compiled first (before main.cpp) project-lib (with lib1.h and lib1.cpp inside some separate folders)
'Lib2.lib' with its dependency given precompiled libs (like cross-platform OpenCV for example)
I need it to work for Windows and Linux and if possible Mac OS
found for windows: look here - "Common tasks" page 26
exe hello : hello.cpp some_library.lib /some_project//library
: <threading>multi
;
I hoped for better - more readable syntax form Boost creators... And BTW
What the hell on earth does
On Windows, if an application uses
shared libraries, and both the
application and the libraries are
built using Boost.Build, it is not
possible to immediately run the
application, because the PATH
environment variable should include
the path to the libraries. It means
you have to either add the paths
manually, or have the build place the
application and the libraries into the
same directory.
mean? I can not have a project with 2 nested project - one for .lib and one for app using that .lib?
With this I see how to connect 1 .lib but how to connect a folder with them? And how to connect includes? And when I'll go to Linux what shall be changed?
How should my bjam make/config file look like?
It sounds like you want a framework which works on a cross-platform(Multiple operating system) scenario.
Simplest option would be to install cygwin and create a standard makefile for linux. Compile in a cygwin environment to generate the windows equivalent.
You will save substantial time in creating the makefile.
Another option is mksnt.