There are several ways to get the cleansocks library.
If you need any help with any of these, don't be afraid to ask.
If you have a laptop, feel free to bring it by the office and I'll be glad
to help you get set up.
- The library is installed on the Sandbox server. You are allowed to
have shell account there. Ask Dr. Bennet if you want one.
- RPMs for Linux. RPM is the package manager on Red Hat, Fedora and
several other distributions. Not, unfortunately, on Ubuntu and Mint.
Once the RPM is installed, you should be able to compile client programs
by adding -lcleansocks to the end of the compile command.
- If you must use Windows, this binary distribution should work
with CodeBlocks. No fancy installer. These instructions are for adding
the library globally, but it is possible to add it to a specific project
instead. Look here.
- Download the Windows binary distribution
This is built with the (latest) standard download of CodeBlocks (13.12)
using the gcc compiler 4.7.1.
- Unpack it anywhere you like, but remember where.
- Choose the settings menu which gives you a drop-down.
Select “compiler” to get a complex pop-up.
- Choose the tab for
“Search Directories”. You should see something like this:
- Push the Add button. Use the pop-up to enter the full path of the
directory containing the unpacked files. The name should now appear:
Of course, your location may differ. This adds the listed directory
to the places the compiler will search for #include files.
- Click on the Linker tab (right of Compiler, still under Search directories)
and add the same directory path there.
This adds the directory to the places to search for link libraries.
- Now click on the Linker settings tab just left of Search directories.
Add the line -lcleansocks -lws2_32 to the right-hand options window
This tells the system to actually load the Cleansocks library, and also
the Winsock2 library that implements sockets on Windows.
- Press OK.
- If you want to run on a Mac, you'll have to compile the library
source yourself. I don't have access to a Mac, so I can't provide a
binary version. The Linux instructions (below) may work, though it may
be necessary to modify the source code.
If you want or need to compile the source yourself,
- The source
distribution should build easily on Linux. Simply unpack it
and type make. By default, the installer places the library in
/usr/local/lib, which can be a problem on Fedora, which doesn't
enable the local library area by default. You can either install in the
main area by saying make INSTALLBASE=/usr install, or you can
enable the local area, and just say make install. To enable the
local area, simply create a text file named /etc/ld.so.conf.d/local.conf
containing just two lines:
If you have a 32-bit system, you can leave off the first one, though
it probably won't hurt anything. Do this before you make install.
I don't know if other distributions enable this by default; you'll have to
check. There are several ways to do this, and the file layout need not
be the same.
- I compiled the Windows binary distribution using
CodeBlocks, versions mentioned above.
I created a static library project, added the six files
cleanbuf.cpp, then built the project. CodeBlocks created a
.a file with no problems.
- The source
distribution should also build on Windows using the MinGW package,
with MSys. I have not tried with this version, but earlier ones worked.
Use the make INSTALLBASE=/usr form. If you
don't know what MinGW is and want to, ask me about it.