Setting up Apache Arrow and Parquet Libraries in C++ - c++

I'm trying to do something simple: save data in Apache Parquet format in C++. However, I cannot figure out how to properly link the Apache Arrow library to my project in order to use the necessary #include<".h"> headers. I haven't used C++ in decades and I wasn't very good even back then, so this is out of my league.
I've used NuGet (for pthreads library) and have physically linked libraries using the Project Properties of Visual Studio 2019 on Windows 10 (for Npcap library), but following the Apache Arrow instructions (https://arrow.apache.org/docs/developers/cpp/index.html) is currently beyond me.
So far I've installed Git and CMake and I can get CMake to put arrow VS Project files into a ./build folder I've created, but I cannot run any example nor can I link the header files. I've tried adding a VS Project to the 'arrow' solution in the build folder, but I never got that code to compile. In previous attempts I've used CMake through VS as well as used Ninja to try and build the libraries. But for the most part, I am straight-up guessing on pretty much every step of this process.
Some questions that come to mind are: do I even want to specify the "Visual Studio 16 2019" generator to CMake or should I do something different? How do I use the files that were built? Do I need to modify the CMakeLists.txt files included in the arrow download? Do I need to write a script for the build or is it preferable to run from the command line?
Regarding the Optional Components of the build; I'm pretty sure I should have -DARROW_PARQUET=ON but what about -DARROW_PLASMA=ON? It's related to Shared Memory Object Store and in order to save as a parquet file I'll need to load my data into an arrow Table in the memory, so is this applicable? What about the other 50 or so options?
I apologize in advance for my naiveté on this subject and appreciate any help or advice. Thank you.

Related

Missing libgcc_s_seh-1.dll starting the .exe on Windows

Intro
I have a CMake-based C++ project. Until now I build and ran the project via CLion. Everything worked fine until I tried to run the .exe-file directly (not via CLion).
Problem
When I navigate to the cmake build directory in order to start my program via the executable file, it fails with the following message in the popup: Cannot continue the code execution because libgcc_s so-1.dll was not found. Reinstalling the program may resolve the issue.
I have the following questions
If I interpret the error message correctly, then this dll is missing on my computer. So I ask myself, why does my program still work when I start it via the development environment (CLion), although the error message expressly states that the source code requires this dll?
Is it the fault of my application/source code that the error appears or rather the current state of my computer? If the former, how can I prevent this error from appearing for other users?
What is the best way to fix this error? It's obvious that I need to download this dll, but where is the best place to put it (which directory and environment variable to use on Window)?
Which source is trustworthy to download this dll? I don't want to download any malware under this dll-name.
Optional: What kind of library is that? What functionalities does it offer?
Additional information
I use CMake as my build tool, CLion as the IDE and MinGW as the compiler.
What I have did so far?
I made sure it still works through the IDE.
I found this dll does not exist in the MinGW installation folder.
I searched the web for more information. Unfortunately, there are only pages unknown to me that only offer the download of this dll. That doesn't satisfy me.
I found the cause of my problem: I had two MingGW installations on my machine. Once the installation that comes with CLion and a separate one. The latter did not have the required dll. However, CLion used its own installation, which in turn owns the DLL. So the solution was to remove the separate installation and include the path to the CLion installation's bin/ directory in the PATH environment variable.
This file is part of MinGW-w64 when using SEH as exception model (as opposed to Dwarf or SJLJ). You need to distribute the .dll files your .exe file(s) depend on in the same folder as the .exe file(s).
If you don't have that file, then you probably have been using libraries compiled with different versions of GCC/MinGW(-w64). I recommend building everything with the same compiler to ensure stable binaries.
Tools like Dependency Walker can help you figure out which .dll files your .exe file depends on.
Or use the command line tool copypedeps -r from https://github.com/brechtsanders/pedeps to copy the .exe files along with it's dependencies.

Running my GIS application using dev-c++ gives "gdal201.dll is missing"

I'm working on a GIS application in C++ using Dev-C++, and to start for now I'm using the code given in the tutorial in Link
I got it to compile without errors or warnings, but when I try to run it I get the error "The program can't start because gdal201.dll is missing from your computer. Try reinstalling the program to fix this problem."
I was looking at another question with the similar problem and tried to search this dll on internet, but couldn't find it anywhere, and somebody mentioned to ignore the error, but I don't know how to do that.
Can anybody help me on what to do here?
Thanks in advance.
You need the DLL file(s) to be present either in the same directory as the executable, or in your Path variable for the system to be able to find them. I personally prefer setting Path. You might consider either adding GDAL_DIR\bin to your permanent Path by editing system or user environment variables, or else create a small batch file on the desktop which adds the directory to Path then starts devenv.exe if you need to manage several incompatible development environments for different projects.
(This has several advantages in my experience over copying the DLL files to the same directory as the executable: It's easier to manage dependencies by including all the necessary directories, as opposed to manually tracking down all the recursive dependencies. It's also easier to manage updates of the DLLs if you can just update the GDAL installation directory, or update Path or the batch file to a newer GDAL installation directory, rather than having to track down all the places you've copied the DLLs to or having to manage post-build scripts to copy the DLLs every time.)
(Of course, when it comes time to create a self-contained installer, it's going to be easiest to copy the dependent DLLs to the installer image directory before building the installer. Then something like CMake's BundleUtilities module can help in tracking down what DLLs need to be included.)
Usually I copy private DLLs to the output folder of the project, i.e. the same folder as the executable. For a commercial application, you may want to install the DLL, let the OS handle the management of it and use the Assemblies Manifest to help the loader find it.

How to deal with commits from different development environments?

I decided to convert my Visual Studio project to CMake to develop on multiple platforms. But I wonder how to effectively apply versioning to a CMake project.
Say, from the CMake project I generated a Visual Studio project on Windows, and set up a make file on Linux. I don't want to include those platform specific files in commits. Is it best practice to exclude all those files using .gitignore?
This is what first came to my mind, and I would like to know if this is how its done right. For example, I could also include projects for all different platforms in my repository.
Yes, if you use CMake as a base project file, by all means do not add the generated files to the repository. They're effectively useless as a shared thing and often very computer-specific.
As said in the comments (by #Peter, which I shamelessly copy here for better visibility), it is often a good idea to build outside your source tree (unlike the default behavior of Visual Studio). Basically, you do (from the source directory)
cd ..
mkdir project-build && cd project-build
cmake ../project
You can tell CMake to use a specific "generator" with the -G commandline option. Check its help output for details. You can also do this through CMake's GUI.

Fundamental cURL c++ install

With fear of being mocked due to the simplicity I venture out to ask you are question:
What do i have to download and what do i include in my project to get going with the cURL library?
I have tried different things but all resulting in unresolved externals meaning i am including it wrong, i guess.
An explanation of the install process in whole would be awesome! I'm not quite sure exactly what files to use and where to put them. Im using visual studio 2012.
Can anyone shed some light on this?
You need to link the library during link phase of the build. There is an option in the project properties for additional library dependencies - add the .lib file(s) that comes with curl there. Just including a file in your source is rarely enough to use a library.
Ok I am using visual studio (2008) for your work but I will answer to the best of my knowledge.I am assuming you have built libcurl using .sln file or are using a prebuilt set of binaries.
First of all build a solution in project wizard and get a project in it. Right click on project and select properties
In properties go the C++ general tab, add the include directories of curl. Now go to Linker general tab and put the lib directory(which contains the dlls and obj files of your build) in the additional library directories. Now go to input option and put libcurl_imp.lib or libcurldll.a(depending upon your version and compile method). These names can be different and depend upon your build, but the extensions will be of these two types. It is the linker step in which you are making a mistake.
After this compile and run.

Setting Up OpenCV and .lib files

I have been trying to set up OpenCV for the past few days with no results. I am using Windows 7 and VS C++ 2008 express edition. I have downloaded and installed OpenCV 2.1 and some of the examples work. I downloaded CMake and ran it to generate the VS project files and built all of them but there with several errors, and couldn't get any farther than that.
When I ran CMake I configured it to use the VS 9 compiler, and then it brought up a list of items in red such as BUILD_EXAMPLES, BUILD_LATEX_DOCS, ect. All of them were unchecked except BUILD_NEW_PYTHON_SUPPORT, BUILD_TESTS, ENABLE_OPENMP, and OPENCV_BUILD_3RDPARTY_LIBS. I configured and generate without changing anything and then it generated the VS files such as ALL_BUILD.vcproj. I built the OpenCV VS solution in debug mode and it had 15 failures (maybe this is part of the problem or is it because I don't have python and stuff like that?)
Now there was a lib folder created after building but inside there was just this VC++ Minimum Rebuild Dependency file and Program Debug Database file, both called cvhaartraining. I believe it should have created the .lib files I need instead of this. Also, the bin folder now has a folder called Debug with the same types of files with names like cv200d and cvaux200d.
Believe I need those .lib files to move forward.
I would also greatly appreciate if someone could direct me to a reliable tutorial to set up VS for OpenCV because I have been reading a lot of tutorials and they all say different things such as some say to configure Window's environment variables and other say files are located in folders such as OpenCV/cv which I don't have. I have gotten past the point of clear headed thinking so if anyone could offer some direction or a simple list of the files I need to link then I would be thankful.
Also a side question: why when linking the OpenCV libs do you have to put them in quotes?
If you're just getting started, you should probably grab the prebuilt libraries for OpenCV instead. It's OpenCV-2.1.0-win32-vs2008.exe from this page.
Once you have that, there is really no setup. Just link to the (already built) lib files in any VS project you create, and make sure the OpenCV include directory is in the projects include path.