Card game and simulation library and tools. Part of the OneJoker project.

Project maintained by Lee Daniel Crocker
Lee's blog is etceterology.

onejoker
CC-0: To the extent possible under law, I, Lee Daniel Crocker waive all copyright and related or neighboring rights to all creative works original to me.

Using the library in your code

Installing

You have two choices for installing the library for use in your programs. Either download a pre-compiled binary for your system, or build the library yourself. The first is simpler, the latter more flexible. See the development documentation for how to build the library on your system. I make pre-compiled binaries available for Windows and Linux on Intel platforms.

Linux

Download this zip file and unpack it. This will give you the shared library file libojcard.so.0.0, the C header file ojcardlib.h, the Python package directory ojcardlib and its contained modules, and the Java archive ojcardlib.jar. Which of these you will need and where you will install them will depend on your development environment.

A common place to put the shared library is /usr/local/lib, after which you will have to run sudo ldconfig to rebuild the system’s shared library cache. You may instead want to place it somewhere in your private development tree, in which case you will have to update /etc/ld.so.conf to look for it. You may also want to create a link to it with a simpler name, like this:

sudo ln -s /usr/local/lib/libojcard.so.0.0 /usr/local/lib/libojcard.so

The C header file ojcardlib.h can be installed in /usr/local/include, or somewhere in your development tree if you add a -I option pointing to it in your C compiler invocations.

CardLib expects Python 3. If you are using Python 2.X, you can install the Python 3 package available in all major distributions and the two will get along fine. The Python package directory ojcardlib and its contents will have to be placed where your particular version of Python expects it (on my system, that’s /usr/local/lib/python3.2/site-packages), or else its location can be added to sys.path explicitly.

I recommend openjdk as a good Java for Linux. The java archive ojcardlib.jar must be placed in the “extensions” directory of your JDK (for example, /usr/lib/jvm/java-1.7.0-openjdk-i386/jre/lib/ext), which will vary by version, or else be added to the -cp option when invoking Java programs that use it (you may also want to use -Djava.library.path= to specify a non-standard location for the shared library).

Windows

Download this zip file and unpack it. This will give you the library file ojcard.dll, the C header file ojcardlib.h, the Python package directory ojcardlib and its contents, and the Java archive ojcardlib.jar. Which of these you will need and where you will install them will depend on your development environment.

Windows may not let you copy the DLL to the System32 directory where other DLLs are found, so you’ll have to have this file present in the directory with your executable to use with C and C++ programs. You probably will be allowed to install it in your Java JDK or your Python directory tree for access from those languages. The exact location where the library is expected will depend on your version of Java or Python.

If you are using MinGW as I recommend, the C header file ojcardlib.h can be installed in C:/MinGW/include, or somewhere in your development tree if you add a -I option pointing to it in your C compiler invocations. If you’re using a different development environment you’ll have to put the header file where it expects.

To use CardLib with Python, you will have to install Python 3. The Python package directory ojcardlib and its contents will have to be placed where your particular version of Python expects it (for example, C:/Python33/Lib), or else its location can be added to sys.path explicitly.

Likewise, you must have a Java JDK, and ojcardlib.jar must be placed in the “extensions” directory of your JDK (for example, C:/Program Files/Java/jdk1.7.0_21/jre/lib/ext), which will vary by version, or else be added to the -cp option when invoking Java programs that use it (you may also want to use -Djava.library.path= to specify a non-standard location for the shared library).

Language bindings