Skip to content

Codex on Visual Studio

This tutorial covers how to dynamically link Codex in your projects. You can also statically link it, but I recommend the dynamic way.

Codex is maintained on VC++ 2010 Express, but the explained configuration is also valid for other Visual Studio editions.

Setup your application

  • Create a project
    Create a new “Win32 Console application“, preferably checking the Empty project checkbox.
  • Configure the project properties
    • VC++ Directories
      Open the project properties. On the VC++ directories section, edit the include and library directories, adding the Codex include and lib directories respectively. Screenshot of the dialog box for setting up the include directoriesScreenshot of the dialog box for setting up the library directories

    • Link against Codex library
      On the Linker section, select Input and add codex.lib on the additional dependencies. Note: if you want to use the Codex debug version for your debug configuration, use the ā€œ-dā€ sufix: codex-d.lib. Screenshot of the dialog box for including pluma.lib as additional dependency.
  • Build
    All configured, create a dummy code that uses Codex and build it, just to see if everything goes fine. Here’s a dummy code which does nothing:

    #include <Codex/Default.hpp>
    #include <iostream>
    int main(){
        cx::File inputFile("SomeFile.txt");
        std::cout << "Press any key to exit";
        std::cin.ignore(10000, '\n');
        return 0;

    If you got errors, make sure that the project properties are correct for the target that you’re trying to build.

  • Execute
    The binary files (executable) of your application won’t run without codex.dll (unless you have statically linked it) and zlibwapi.dll (for compression). Copy those dlls into the folder where your executable is generated (usually a bin folder on your project). The library codex.dll is at <Codex>\lib and the zlibwapi.dll is at <Codex>\extlibs\lib directory, where <Codex> stands for your Codex installation folder.

Tutorial Index