Configure CodeBlocks to use the Cleansocks distro

Configuring the CodeBlocks on Windows to use the distributed cleansocks library is annoying, but not really all that hard.

  1. The cleansocksinstall.exe should install the Cleansocks headers and libraries under C:\Program Files (x86)\cleansocks. Check that this is present. If it decides to put it somewhere else, just substitute that location in the following instructions.
  2. Under the Settings menu, click on Compiler... to get the Global compiler settings tool.
  3. Along the row that starts with Compiler settings, Click the Linker settings tab.
  4. You will see a left column labeled Link libraries. You need to use the Add button at the bottom to add several libraries. These are:
    libcleansocks.a libcleantlsc.a libssl.a libcrypto.a libwsock32.a libws2_32.a libz.a libgdi32.a
    I had to enter each one individually. Congratulations if you can find a better way.
  5. Now select the Search directories tab, to the right of Link libraries. This will show second-level tabs for Compiler, Linker and Resource compiler, with Compiler selected initially.
  6. Here, use the Add button to add the search directory for the include files. It is C:\Program Files (x86)\cleansocks\include.
  7. Change from Compiler to Linker in the sub-tab, and add the library search path, which is C:\Program Files (x86)\cleansocks\lib.
  8. At the bottom, tell it OK

That should be all you need to compile and run C++ programs using cleansocks in CodeBlocks. You might want to download and try some of the examples to test your configuration.