Category: Tips

OpenGL not Found, “cannot find -lGL”, and Other Issues with NVIDIA Drivers

Under Ubuntu,  sometimes when the NVIDIA drivers are installed, CMake cannot properly find OpenGL (specifically libGL.so). As a result, linking issues may occur. The easiest fix for this is to first create a symlink of nvidia-current to nvidia-xxx where xxx is the version of the current NVIDIA driver installed (e.g. nvidia-387) . Then create a …

Continue reading

Visual Studio Setup Blocked or Can’t Uninstall

For some reason a Visual Studio 2015 Community Edition installation I had on one of my machines was experiencing problems: solution files were not loading properly, and what’s worse is that installation instance had gone totally missing from “Uninstall a Program” in Windows Control Panel. Also, every time I tried running the setup file vs_community.exe …

Continue reading

C++ Function in Header throws Linker “already defined” Errors

If you define a function in the global namespace in a C++ header file and encounter linker errors (complaining about the function already defined elsewhere), there’s a simple fix! Simply mark the function as inline. This will prevent the duplication of the function in other source files. Note that using inclusion guards does not solve …

Continue reading

Undo a Git Commit on GitHub

In case you’ve pushed an unwanted commit to GitHub (or any upstream Git repository), you can simply undo it. To do so, move the HEAD to the commit that you want to undo to and then run the following command: git push -f origin HEAD^:master

Git: Merge Specific Commit from Another Branch to Main Branch

Let’s say that in your git repository, you have a master branch and an experimental branch. You’ve fixed a bug on file A on the experimental branch and you would like to commit that fix to the master branch. This is possible using the git cherry-pick command. First, switch to the experimental branch and execute git log. Take …

Continue reading