This week I needed to compile PuTTY to work on an Ubuntu system running 16.04 (LTS). The instructions are pretty straight-forward and will take you most of the way through compiling something you can use. A problem I ran into is that I kept on running into errors during compilation referencing dlsym, dlopen and dlclose.
Fate was on my side as I was able to work my way through the problem (with a generous dose of google) and compile an executable that actually works.
- PuTTY [chiark.greenend.org.uk]
- PuTTY [Github mirror] [github.com/Yasushi]
- Undefined Reference to dlopen, dlclose, dlerror, dlsym [projects.coin-or.org]
- Undefined reference to 'dlsym' and 'dlopen' [stackoverflow.com]
Errors during compilation
When I tried to compile the PuTTY tools on Linux I received some cryptic error messages that weren't particularly helpful for me:
Steps to Compile PuTTY
Here are the steps that worked for me to compile PuTTY on Ubuntu:
- Download the 'release source code for Unix' from the PuTTY Download Page
- Extract the .tar.gz file
- Run the ./mkauto.sh script in the root of the directory you extracted PuTTY into
- cd into the unix/ directory
- Run ./configure
- Run make -f Makefile.ux LDFLAGS="-Wl,--no-as-needed,-ldl"
The executables work when I run them, so I classify this as a success.