C++ ASIO driver setup - c++

I ask you for help with the setup of ASIO sdk. I would like to use it to connect some external devices to my system but before that I am struggling to even join ASIO to my programme.
I've downloaded ASIO 2.3 from there:
http://www.steinberg.net/en/company/developers.html
and unfortunately C++ isn't my strongest point. SDK contains few folders (is folder named "Common" having every file needed?), there is no *.lib file only *.cpp and *.h files.
I don't know which files are necessary so the SDK is installed completely.
I was thinking about merging everything into one library but I don't know which files are important for SDK...
Can you give me any hints how can I add files to my program so I can start using ASIO functions in my code?

Sadly I haven't documented my ordeal last year. However, here's some pointers:
How to begin building a VSTi Plugin?
Setting up VST Steinberg SDK on Windows
Build a minimal VST3 host in C++
I admit that's basically cherry-picking the list of SO results for "steinberg", but at least the first 2 seem relevant.

Related

Bundle and build libcurl along with custom lib

Problem
How can I distribute a c++ library as source code along with the source code of libcurl and let the consumer of the library handle building it as needed? I'm using FastBuild as a build system.
Context
I have a C++ library that I distribute as source and let the clients handle building it along with their code.
The repo includes the source for a dependency as well, tinyxml, which is built along with the library itself thus becoming completely transparent for the clients.
It has worked fine up to now but clearly does not scale well for more complex dependencies, such as libcurl.
Things I've considered as an alternative to bundling libcurl's source
have pre-compiled libraries of libcurl. But I don't know which platforms/flags the consumer is going to use
have libcurl installed on the build machine. It would require extra setup steps for the consumer, it won't be just pulling the code and using
Edit 1: Update with build system
You didn't mention which build system are you using.
If you are using cmake, you can make use of ExternalProject_Add to download/build/install the dependent library.
See examples:
https://cmake.org/cmake/help/git-stage/module/ExternalProject.html#examples
If I understand you correctly you need that any client who obtains source code of your library would be able to also obtain corresponding source code of libcurl and tinyxml libraries.
Personally I would use cmake for that purpose as #brokenfoot has already suggested. But instead of ExternalProject_Add it seems that in your case FetchContent would be enough and less complicated: https://cmake.org/cmake/help/latest/module/FetchContent.html

How to create a portable executable with allegro 4.4.2

So I am creating a C++ program using the allegro version 4.4.2 library and I need to be able to produce an executable package which I can submit to a course instructor and have run on his computer without issues. I am developing the program using DevC++. If I am understanding this correctly so far, I need to link to a static library for allegro and then the executable should include the library info and thus the library itself is not necessary to have included in the executable package. I have also seen some recommendations regarding third party tools that produce executable packages, but these seem to be more general (not necessarily allegro compatible?) and I am hoping to avoid downloading more third party software.
I have tried linking to the static library liballegro-4.4.2-monolith-static-mt.a but for some reason when I do this I get a whole slew of undefined reference compile time errors. I have read that it is necessary to have #define ALLEGRO_STATICLINK included in the project, I have this statement at the top of my main source file but I am not sure if I am meant to define this somewhere in the project options instead?
Any guidance or link to resources which will help me solve my problem would be extremely appreciated! I am just getting into the meat of programming with C++ beginning to learn object oriented programming methods, I still occasionally struggle with the basics so thank you in advance for your help!
Backstory (if interested/relevant?): I am taking a Game AI programming course for which we need to create some example programs to demonstrate AI algorithms. The course specifies Java but I am most familiar with C++ and the course instructor says this is fine but I must be able to submit an executable to him which he can just run on his computer without issues. To best achieve what the course asks I feel the allegro library (which I already have installed) will be of great help, mostly for drawing graphics to the screen and such.
So I just ended up using a dynamically linked version of my program and including the appropriate .dll files which turned out to be a lot less work than I thought it would be.
Basically I just had to ensure the allegro-4.4.2-md.dll from the bin folder was included in the folder with the executable. I then sent off the package (the .exe compiled file and the needed supporting files such as bitmaps sound files etc) to a few friends and had them try to run it. They then gave me the warnings from their computers along the lines of "Test.exe cannot be run ****.dll cannot be found".
I searched the exact names of the dll files they were receiving warnings for in the folder with my game and voila it now seems to execute on whatever PC it is sent to.

How do I import a set of libraries in a .pkg file into Xcode 4.6?

I am currently taking a few different online programming courses, one of which is the Programming Abstractions Stanford course. They have a set of default libraries that are utilized for the class.
You can download that package here:
http://see.stanford.edu/materials/icspacs106b/cs106libs_for_xcode.zip
I am needing assistance with figuring out how to get this package of libraries into Xcode so that I can utilize them with the programs I write. How can I go about doing that so when I create a new project I can create one that has these libraries ready to go, on top of the standard C++ libraries.
Thanks a bunch in advance!
Edit: I did install the .pkg file, but I do not where it installed. How do I utilize the installed library from within Xcode?
Bad luck. From this page:
How to install external library in X-Code 4
You need to install XCode 3.0 in order to use
CS106LibrariesForXcode.pkg library.
XCode 4 have a very different UI and functionality compared to XCode
3. So it would be unwise to study XCode 3 only. But if you're going to study C++ using those tutorials you'd probably want to install XCode 3
and use it.
Old answer [Not applicable]
If the package is a pkg file, you actually needs to install it. Double-click on it, follow the steps.
If you have a warning message,
CS106LibrariesForXcode.pkg” can’t be opened because it is from an
unidentified developer.
then right-click (or ctrl+click) and select open. The warning will then have an open option to allow you to open the package.
Once this is done, just write a new program, and include the headers you need.

Are there Windows API binaries for Subversion or do I have to build SVN to call the API from Windows C++?

I want to call a Subversion API from a Visual Studio 2003 C++ project.
I know there are threads here, here, here, and here that tell how to get started with C#.NET on Windows (the consensus seems to be SharpSvn, which I've used easily and successfully on another project) but that's not what I want.
I've read the chapter on using APIs in the red-bean book which says:
Subversion is primarily a set of C libraries, with header (.h) files that live in the subversion/include directory of the source tree. These headers are copied into your system locations (e.g., /usr/local/include) when you build and install Subversion itself from source. These headers represent the entirety of the functions and types meant to be accessible by users of the Subversion libraries.
I'd like to use CollabNet Subversion but there doesn't seem to be API binary downloads, and I'd just as soon not build the whole thing if I can avoid it.
Considering another approach, I found RapidSVN's C++ API, but it doesn't appear to offer Windows API binaries either and seems to require building SVN (which I would be willing to do as a last choice if RapidSVN's API is higher-level than the stock SVN offering.)
Does calling the API from C++ in Windows have to be this much more work compared to using SharpSvn under .NET, or is there something I haven't found that would help me achieve my goal?
You need the dev (e.g. svn-win32-1.6.16_dev.zip) package from here. Probably download also the binaries (e.g. svn-win32-1.6.16.zip) of the tools (DLLs are there).

How do I zip a directory of files using C++?

I'm working on a project using C++, Boost, and Qt. I understand how to compress single files and bytestreams using, for example, the qCompress() function in Qt.
How do I zip a directory of multiple files, including subdirectories? I am looking for a cross-platform (Mac, Win, Linux) solution; I'd prefer not to fire off a bunch of new processes.
Is there a standard way to combine bytestreams from multiple files into a zipped archive, or maybe there is a convenience function or method that would be available in the Boost iostream library?
Many thanks for the assistance.
Update: The QuaZip library looks really great. There is an example in the download package (in the "tests" dir) that shows very clearly how to zip up a directory of files.
Update 2: After completing this task on my Linux build environment, I discovered that QuaZip doesn't work at all with the Visual Studio compiler. It may be possible to tackle all those compiler errors, but a word of caution to anyone looking down this path.
I have found the following two libraries:
ZipIOS++. Seems to be "pure" C++. They don't list Windows explicitly as a supported platform. So i think you should try your luck yourself.
QuaZIP. Based on Qt4. Actually looks nice. They list Windows explicitly (Using mingw). Apparently, it is a C++ wrapper for [this] library.
Ah, and of course, i have ripped those sites from this Qt Mailinglist question about Zipping/Unzipping of directories :)
Just for the record...
Today, I needed to do something very similar in Visual C++. (Though wanted to maintain the possibility to compile the project on other platforms; however preferred not to adopt Qt just for this purpose.)
Ended up using the Minizip library. It is written in plain C, but devising a simple C++ wrapper around it was a breeze, and the end result works great, at least for my purposes.
I have built a wrapper around minizip adding some features that I needed and making it nicer to use it. Is does use the latest c++11 and is developed using Visual Studio 2013, so it should work out-of-the-box for you.
There's a full description here: https://github.com/sebastiandev/zipper
you can zip entire folders, streams, vectors, etc. Also a nice feature is doing everything entirely in memory.
Poco::Zip is also a choice, it has clearly documentation and some code for demo.
Poco::Zip Document
system("zip myarchive.zip *");
I tried QuaZIP 0.4.3 on Windows with VisualStudio 2010 -- there are still issues but can be resolved easily.
To build with VS:
Use CMake to configure and generate VS solution for QuaZIP.
Open soltion with VS and build -- you'll first notice that it can't find 'zlib.h'.
Open preferences for quazip project and add path to Qt's copy of Zlib to C/C++->General->Additional Include Directories: $(QTDIR)/src/3rdparty/zlib.
Rebuild again and you'll get lots of warnings and one error C2491: dllimport static issue on QuaZipFile::staticMetaObject.
This is because QuaZipFile is declared like "class QUAZIP_EXPORT QuaZipFile" and QUAZIP_EXPORT needs to resolve to Q_DECL_EXPORT for dll and to Q_DECL_IMPORT for application, based on whether QUAZIP_BUILD is defined or not. When building QuaZIP QUAZIP_BUILD should be defined but isn't -- configuration process defines in error completely useless "quazip_EXPORTS" instead.
To fix, just remove "quazip_EXPORTS" from all build configurations and add QUAZIP_BUILD instead -- QuaZIP will now build fine.