Results 1 to 3 of 3

Thread: ClanLib headers problem

  1. #1

    Default ClanLib headers problem

    VS Express 2010
    ClanLib 2.3.6


    I have the three files, and when I trying to compile it I get the some output:

    1>------ Rebuild All started: Project: Collision, Configuration: Debug Win32 ------
    1> main.cpp
    1> Collision.cpp
    1>d:\sdk\clanlib\include\clanlib\display\window\di splay_window.h(231): error C2146: syntax error : missing ';' before identifier 'get_hwnd'
    1>d:\sdk\clanlib\include\clanlib\display\window\di splay_window.h(231): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\sdk\clanlib\include\clanlib\display\window\di splay_window.h(231): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\sdk\clanlib\include\clanlib\display\window\di splay_window.h(231): warning C4183: 'get_hwnd': missing return type; assumed to be a member function returning 'int'
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): error C2146: syntax error : missing ';' before identifier 'get_hwnd'
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): error C2433: 'CL_DisplayWindowProvider::HWND' : 'virtual' not permitted on data declarations
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): warning C4183: 'get_hwnd': missing return type; assumed to be a member function returning 'int'
    1>d:\sdk\clanlib\include\clanlib\display\targetpro viders\display_window_provider.h(158): error C2253: 'CL_DisplayWindowProvider::get_hwnd' : pure specifier or abstract override specifier only allowed on virtual function
    1> Generating Code...
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    main.cpp

    Code:
    #include <ClanLib/application.h>
    #include <ClanLib/core.h>
    #include <ClanLib/display.h>
    #include <ClanLib/gl.h>
    
    #include "Collision.hpp"
    
    class mainApp {
    
    	public:
    
    	static int main (const std::vector<CL_String> &args) {
    	
    		CL_SetupCore setup_core;
    		CL_SetupDisplay setup_display;
    		CL_SetupGL setup_opengl;
    
    		try {
    			Collision experiment;
    			experiment.run();
    		}
    		catch ( CL_Exception &exception ) {
    			CL_ConsoleWindow console("Error");
    			CL_Console::write_line(exception.what());
    			return -1;
    		}
    
    		return 0;
    	}
    
    };
    
    CL_ClanApplication app (&mainApp::main);
    Collision.hpp

    Code:
    #include <ClanLib/display.h>
    
    class Collision {
    
    	public:
    
    		void run ();
    
    };
    Collision.cpp

    Code:
    #include "Collision.hpp"
    
    void Collision::run () {
    
    }
    If I comment #include "ClanLib/display.h" in Collision.hpp then the error gone.

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

    Default

    ClanLib/display.h is missing an include for windows:

    #include <windows.h>

    (That include is in "ClanLib/core.h")

  3. #3

    Default

    Thanks, it helped.

    For those like me: insert #include <ClanLib/core.h> before #include <ClanLib/display.h>

Similar Threads

  1. VS2008 Complaining about headers (new install)
    By tthomason84 in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 03-28-2012, 12:52 AM
  2. using automake with gcc precompiled headers experiment
    By rombust in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 11-25-2011, 05:48 PM
  3. ClanLib 2.1.1 headers and GCC -pedantic
    By rombust in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 12-26-2009, 08:55 AM
  4. Clanlib (install) problem: mt-uc
    By astrof in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 12-11-2008, 10:32 PM
  5. Errors in ClanLib headers
    By mmiikkee12 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 09-03-2007, 08:17 AM

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
  •