Results 1 to 3 of 3

Thread: how to compile the hello example in codeblocks?

  1. #1

    Default how to compile the hello example in codeblocks?

    -std=c++0x ?

    it can't work.

    #include <ClanLib/core.h>
    #include <ClanLib/application.h>
    using namespace clan;
    class ConsoleProgram
    {
    public:
    static int main(const std::vector &args);
    };
    // Create global application object:
    // You MUST include this line or the application start-up will fail to
    // locate your console application object.
    Application app(&ConsoleProgram::main);
    int ConsoleProgram::main(const std::vector<std::string> &args) // Setup clanCore:
    {
    SetupCore setup_core;
    // Create a console Window if one does not exist:
    ConsoleWindow console_window("Console");
    // Write a line to the console:
    Console::write_line("Hello World!");
    // Wait for a key so the window won't close immediately.
    Console::wait_for_key();
    return 0;
    }

  2. #2

    Default

    undefined reference to `clan::Application::main'|

    #include <ClanLib/application.h>
    #include <ClanLib/core.h>
    #include <ClanLib/display.h>
    #include <ClanLib/d3d.h>
    #include <ClanLib/gl.h>
    #include <ClanLib/swrender.h>
    #include <ClanLib/gui.h>

    class Program
    {
    public:
    static int main(const std::vector<std::string> &args);
    };


    int Program::main(const std::vector<std::string> &args) {
    return 0;
    }

    clan::Application app(&Program::main);

  3. #3

    Default

    i think i get it.

    1) add all lib to setting->compiler->linker settings->link libs (16 libs)
    2) projects build options ("{Compiler|Linker} settings -> Other [linker ]options"). add -pthread

Similar Threads

  1. Can compile a release version but can't compile a debug version
    By cymcrh55 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 07-16-2013, 01:55 PM
  2. I can not compile the game
    By Argon in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-22-2012, 11:59 AM
  3. Failure to compile on GNU
    By speeder in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 07-29-2010, 10:53 PM
  4. After i compile it and run it on another computer
    By jerry in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 03-30-2010, 07:37 AM
  5. Unable to create Config.exe in CodeBlocks
    By mcamardo in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-21-2009, 08:58 PM

Bookmarks

Bookmarks

Posting Permissions

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