w0rthy / SortingVisualizer

Program to visualize, audiolize, profile, approximate runtimes for, and anything else related to sorting algorithms
GNU General Public License v3.0
109 stars 13 forks source link

Can you please give a tutorial as to how to compile this? Trying to compile using g++ fails #9

Open obipoketbobo opened 3 years ago

Kenshiro166 commented 3 years ago

I've figured out how to compile this today. The repository indeed lacked libraries, the font asset and had a few errors in the code with the libraries I've obtained, which were fixed easily.

The following libraries are needed:

You also need the font Arial as a TTF file, which has to reside in the running working directory.

Once you got the libraries linked, and the font file provided, it should build and work. However, I had some issues on my end while trying to build at first which had to be fixed in code:

Here is my fork where I could make it work: https://github.com/GabCM/SortingVisualizer

I've used CLion to assist me in building the CMakeList.txt file and fixing code errors, and I could build it with VS 2019 and MSVC 14 on Windows. In my repo, the required libraries are linked as submodules and the arial.ttf file is supplied. All of the libraries and the font file are linked together in a single CMakeLists.txt. I'm pretty sure you can at least attempt to make the code build with any build method (like g++) and platform.

obipoketbobo commented 3 years ago

When I tried to build your fork with all of the libraries, it gave me these errors, but as far as I know these are the only other issues with building it. image

obipoketbobo commented 3 years ago

There seems to be an issue with glew about an experimental version.

Kenshiro166 commented 3 years ago

When I tried to build your fork with all of the libraries, it gave me these errors, but as far as I know these are the only other issues with building it. image

It seems you have tried with Visual Studio. Which compiler have you used?

TheoCGaming commented 1 year ago

I've figured out how to compile this today. The repository indeed lacked libraries, the font asset and had a few errors in the code with the libraries I've obtained, which were fixed easily.

The following libraries are needed:

* freetype2

* glew

* glfw

* glm

* portaudio

You also need the font Arial as a TTF file, which has to reside in the running working directory.

Once you got the libraries linked, and the font file provided, it should build and work. However, I had some issues on my end while trying to build at first which had to be fixed in code:

* For the audio, it included <PL/portaudio.h>. I had to remove the PL/ in my copy of the code since my referenced library didn't use that.

* The rest of the compiler errors were confusion between different ways to access a character in a string using the [] operator. I went with the one using "unsigned int" by changing some counter variables from "int" to "unsigned int".

Here is my fork where I could make it work: https://github.com/GabCM/SortingVisualizer

I've used CLion to assist me in building the CMakeList.txt file and fixing code errors, and I could build it with VS 2019 and MSVC 14 on Windows. In my repo, the required libraries are linked as submodules and the arial.ttf file is supplied. All of the libraries and the font file are linked together in a single CMakeLists.txt. I'm pretty sure you can at least attempt to make the code build with any build method (like g++) and platform.

Your repository doesn't seem to exist anymore.