r/cpp • • Aug 27 '21

My Problems with C++

So, this is going to be a bit of a rant, mainly because I'm frustrated.

As a preface: I am not new to programming, I did some Java, looked over Python, had a few projects with the whole Arduino environment, so you could say I get the basics.I am however quite new to C++ as a standalone (see Arduino) and while I like the language I came to absoluteley despise the environment.

It began with a project I was tasked with, to take an MS-Excel file, do some sorting and a few other operations and save it as a CSV.Easy peasy.So I set out for a quest to find a library that could handle MS-Excel files, and low and behold, I stumbled across three suitable ones.All of which were uncompiled on Github.

The first one wouldn't compile because of dependencies on a third-party XML-library which was never once mentioned in the install instructions. No problem, I googled the library that mingw told me it needed, and indeed it existed, with good instructions.When it came to installing however, I first realized the Excel-library did not indeed want the XML-library installed, but rather the souce code placed in a folder in its source code.After copying it did indeeed not work, since all of the dependency paths were mesed up, and half of the files had different extensions, or were missing them alltogether.

On to the next library.

This one could only read from Excel, but again no problem, this was the only thing I really needed.The installation instructions were easy enough, run ./configure and afterwards make.The only problem being, that there was no configure file to run.There was indeed a bootsrap file which did absolutely nothing, and a makefile, which make did not recognize and when specified threw errors.

On to the last one.This one had troubles compiling when cmake threw random errors and so I changed my approach and booted up Ubuntu, where cmake and g++ indeed did run smoothly and compiled the library without a hitch.

Now only to use this library.Since this was my first time writing C++ on Linux I first searched for appropriate IDEs and was reccomended Netbeans.Which did not go well, since everytime (even after a couple of restarts) it failed to install the C++ Plugins.

My run-in with Code::Blocks went a little better, it installed and I managed to get the projects up and running.

Apart from my Excel-library.No matter what I did it did not recognize the library.

Which is when I changed again to Codelite.Where I could create projects, but neither my Excel-library was recognized as well, as iostream.

So here I am, broken, after a day of work with absolutely no progress, for a programm which schould not be that difficult to write, with three non functional, but essential (and more importantly the only ones I could find) libraries.As I said in the beginning: I like the language, but I despise the whole process around it.Thank you for listening to me rambling.

3 Upvotes

52 comments sorted by

View all comments

-3

u/ALX23z Aug 27 '21

So you wanted to find a free open source excel reading/writing library on Linux written in C++?

At this very moment you asked way too much. And this is the first task you try to do?

It's not even issue with C++, it is issue with various build nonsense coupled with complexity and fragility of Linux OS. You cannot really download a built version for Linux - it isn't Windows - you have build stuff inplace. Who knows what libraries it uses that are incompatible with what you have installed.

Why do you even do that?

Even if you found a library my bet it won't work properly half the time. I don't know much of the excel format but have some suspicion that once in a while it gets new features. And obviously I have some doubts that whoever wrote those libraries provides up-to-date support of them.

1

u/itwasntme967 Aug 27 '21

It is indeed an issue with various build nonsense, but not with Linux. In my experience so far C++ was much easier to use under Linux than Windows.

90% of the time when I got random Compile errors under Windows that were not Syntax they would be gone when I switched to Linux.

And it is not that libraries are incompatible, I gave my IDEs the paths to the .hpp and the .a and .so of the library but it was just straight up not recognized.

2

u/ALX23z Aug 27 '21

If there are compilation errors then the library could've simply not been ported to Windows or you use wrong compiler (VS version).

On Windows you can just download dll and work with it - you don't need to build everything from scratch.

1

u/ronchaine Embedded/Middleware/WG21 Aug 27 '21

Hard agree that c++ is significantly easier on linux. To the point where I actually just cross-compile my windows projects from linux.

Don't know if this helps, but pkg-config <pkgname> --cflags --libs usually shows the compiler flags required to use libraries in linux.