Results 1 to 5 of 5

Thread: How do i set up the system to simply use <include.h>?

  1. #1

    Default How do i set up the system to simply use <include.h>?

    I have asked this before but got no answer. I have a freebsd installation of clanlib in /usr/local/lib.
    None of the tutorials i have looked at answer this clearly. I want to set up so that whenever i want to use clanlib - all i need to do is put the <include> header in my source file. I dont want to have to use makefile or any kind of script.
    Can anyone tell me please what changes exactly I need to make to the system?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006


    The 'make install' in ClanLib installs the headers into /usr/local/include/ClanLib-0.8 and the library files into /usr/local/lib. You can change those paths using the parameters available for ./configure (run it to see the command line parameters available).

    If you do not change the folders it installs to, the only way to make the includes working would be to specify the paths when compiling your application:

    g++ -I /usr/local/include/ClanLib-0.8 -lclanSignals -lclanCore -lclanDisplay -lclanGL -o myapplication sourcefile1.cpp sourcefile2.cpp
    If you are using some IDE to compile your application, then there are some places where you can enter 'Additional Include Paths' and 'Library Include Paths' and so on. But those places depend on what IDE you are using.

  3. #3


    I installed clanlib as a freebsd package cause i could not build it myself (kept getting errors). This means that i could not change where the libraries installed to. but i will test compile using your commands and see what happens

  4. #4

    Default troubles

    ok - i will start from scratch. This is the program i am trying to compile (i have not been able to compile a single simple clanlib program yet and i dont understand why). can you compile this at your command line?
    it has 2 files: TicTacToe.cpp and TicTacToeApp.h. This is the code for them NOTE it is not my code it is from the examples/tutorials.

    -----------------------START of code----------------------------------------
    1. .cpp
    // Implementation (for the .cpp file)
    #include "TicTacToeApp.h"

    // This application instance is required or the app will not run
    TicTacToeApp applicationInstance;

    // Constructor
    TicTacToeApp::TicTacToeApp() {}

    // Destructor
    TicTacToeApp::~TicTacToeApp() {}

    int TicTacToeApp::main(int, char **) {

    // Create a console window for text-output if not available
    CL_ConsoleWindow console("TicTacToeApp Console");

    try {
    // CL initialization functions
    // These must be called or CL functions will not work
    // Also, SetupCore must be init()'ed first and denit()'ed last

    // Set display mode
    CL_DisplayWindow window("TicTacToeApp", 500, 450);

    // CL deinitialization functions
    } catch (CL_Error err) {
    std::cout << "Exception caught: " << err.message.c_str() << std::endl;

    // Display console close message and wait for a key

    return 0;
    2. TicTacToeApp.h
    // Interface (for the .h file)
    // Include necessary CL header files
    #include <ClanLib/core.h>
    #include <ClanLib/display.h>
    #include <ClanLib/gl.h>
    #include <ClanLib/application.h>

    class TicTacToeApp : public CL_ClanApplication {


    virtual int main(int, char **);
    -------------------------------------END of code--------------------------

    so i try to compile this..
    ---------------------------start output-----------------------
    $ g++ -I /usr/local/include/ClanLib-0.8 -lclanCore -lclanDisplay -lclanGL -o tictt TicTacToe.cpp
    In file included from /usr/local/include/ClanLib-0.8/ClanLib/display.h:61,
    from TicTacToeApp.h:4,
    from TicTacToe.cpp:2:
    /usr/local/include/ClanLib-0.8/ClanLib/Display/keys.h:352:24: error: X11/keysym.h: No such file or directory
    In file included from TicTacToeApp.h:5,
    from TicTacToe.cpp:2:
    /usr/local/include/ClanLib-0.8/ClanLib/gl.h:53:19: error: GL/gl.h: No such file or directory
    /usr/local/include/ClanLib-0.8/ClanLib/gl.h:54:20: error: GL/glu.h: No such file or directory
    In file included from /usr/local/include/ClanLib-0.8/ClanLib/gl.h:59,
    from TicTacToeApp.h:5,
    from TicTacToe.cpp:2:
    /usr/local/include/ClanLib-0.8/ClanLib/GL/opengl_window.h:56:22: error: X11/Xlib.h: No such file or directory
    In file included from /usr/local/include/ClanLib-0.8/ClanLib/gl.h:59,
    from TicTacToeApp.h:5,
    from TicTacToe.cpp:2:
    /usr/local/include/ClanLib-0.8/ClanLib/GL/opengl_window.h:101: error: ISO C++ forbids declaration of 'Display' with no type
    /usr/local/include/ClanLib-0.8/ClanLib/GL/opengl_window.h:101: error: expected ';' before '*' token

    at least it is linking now but still why is this happening please ? i need to at least compile this example before i can start learning about this library.

  5. #5
    ClanLib Developer
    Join Date
    May 2007


    You will need something like

    -I /usr/include/X11 and -I /usr/include/GL depending on where the xlib library and OpenGL libraries are installed

Similar Threads

  1. Build System ?
    By zyklo in forum Official ClanLib SDK Forums
    Replies: 10
    Last Post: 09-22-2008, 02:00 PM
  2. New to Novashell: Is there a Battle System?
    By Joe Rossi in forum Novashell Game Creation System
    Replies: 2
    Last Post: 06-14-2007, 07:41 AM
  3. Browse system missing
    By Razor in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 01-24-2007, 09:32 AM
  4. Documentation bug: please include OSX equivalents to hotkeys
    By whisperstorm in forum Novashell Game Creation System
    Replies: 2
    Last Post: 01-13-2007, 03:55 AM
  5. Payment system
    By in forum Funeral Quest
    Replies: 0
    Last Post: 12-15-2002, 07:46 AM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts