Page 2 of 2 FirstFirst 12
Results 21 to 34 of 34

Thread: Setting up ClanLib

  1. #21
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Could you attach the solution file (and the other files required) here, and I'll try to open it and see what happens on my 2010.

  2. #22

    Default

    Code:
    #ifdef WIN32
    #include <Windows.h>
    #endif
    
    #include <ClanLib/core.h>
    #include <ClanLib/display.h>
    #include <ClanLib/gl.h>
    #include <ClanLib/application.h>
     
    class DisplayProgram
    {
    public:
    	static int main(const std::vector<CL_String> &args)
    	{
    		CL_SetupCore setup_core;
    		CL_SetupDisplay setup_display;
    		CL_SetupGL setup_gl;
     
    		try
    		{
    			CL_DisplayWindow window("Hello World", 640, 480);
     
    			CL_GraphicContext gc = window.get_gc();
    			CL_InputDevice keyboard = window.get_ic().get_keyboard();
    			CL_Font font(gc, "Tahoma", 30);
     
    			while (!keyboard.get_keycode(CL_KEY_ESCAPE))
    			{
    				gc.clear(CL_Colorf::cadetblue);
     
    				CL_Draw::line(gc, 0, 110, 640, 110, CL_Colorf::yellow);
    				font.draw_text(gc, 100, 100, "Hello World!", CL_Colorf::lightseagreen);
     
    				// Make the stuff visible:
    				window.flip();
     
    				// Read messages from the windowing system message queue, if any are available:
    				CL_KeepAlive::process();
     
    				// Avoid using 100% CPU in the loop:
    				CL_System::sleep(10);
    			}
    		}
    		catch(CL_Exception &exception)
    		{
    			// Create a console window for text-output if not available
    			CL_ConsoleWindow console("Console", 80, 160);
    			CL_Console::write_line("Exception caught: " + exception.get_message_and_stack_trace());
    			console.display_close_message();
     
    			return -1;
    		}
     
    		return 0;
    	}
    };
     
    // Create global application object, you MUST include this line or the application start-up will fail to locate your application object.
    CL_ClanApplication app(&DisplayProgram::main);
    That's all.

  3. #23
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Not the code, the project files.

  4. #24

    Default

    Graphics test3.zip
    this should be everything minus the .sdf file.

  5. #25
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Thanks, I'm getting the same errors as you after downloading the latest precompiled binaries and testing on my own project.

    I'll try to look into it tomorrow.

  6. #26

    Default

    Thank you.

  7. #27
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Looks like the binaries compiled with 2008 is not compatible with 2010 compiler. We'll provide separate 2010 binaries, hopefully during the day.

  8. #28
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Yes they are compatible

    If they were not, many people would compain about legacy libraries

    Anyway to fix the problem:

    Change the platform toolset to vc90:

    Name:  option3.png
Views: 69
Size:  77.2 KB

    Note: It still will would be preferable to provide 2010 precompiled libs, because the SSE2 intrinsics appear to be faster.

  9. #29

    Default

    Thank you very much

  10. #30

    Default

    still doesn't work

  11. #31

    Default

    I have a similar problem. My (console) application is just hello world with #include <Clanlib/core.h>, at it fails to build. I have:

    * Windows 7, 64-bit
    * Visual C++ 2010 Express edition
    * Clanlib VC2010 precompiled stuff, 64-bit versions, downloaded today

    I have done as told (*) in http://www.clanlib.org/wiki/MainDocs...%2B_on_Windows, but with following error:

    1>LINK : fatal error LNK1104: cannot open file 'zlib-static-mt-debug.lib'

    In the folder <external-dependencies-precompiled>\lib\x64\ I have zlib-x64-static-mt-debug.lib
    so the lib-file has -x64 part in the name, which is not the one looked after by linker.

    What is the problem here?

    (*) exceptions from the manual: I could not find property manager, so I configured the paths as project specific in "project properties". Also, I did not start as "empty application". Does it matter?

  12. #32
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by Turzt View Post
    1>LINK : fatal error LNK1104: cannot open file 'zlib-static-mt-debug.lib'
    This means are compiling using the 32 bit target, not the 64 bit target.

    ClanLib 2.2.3 now has Visual Studio 2010 Support.

    Also the documentation has been recently updated
    See: http://clanlib.org/wiki/MainDocs:Vis...%2B_on_Windows
    See: http://clanlib.org/wiki/VisualStudio2010GlobalIncludes

    Hope they help

  13. #33
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    And, is there a special reason you need a 64bit build?

  14. #34

    Default

    32-bit is just fine. I downloaded 32-bit versions and now happily clanlibbing. thank you!

Similar Threads

  1. karma setting
    By Escoutaire in forum Funeral Quest
    Replies: 6
    Last Post: 02-10-2008, 09:39 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
  •