PDA

View Full Version : ClanLib headers problem



IgorBurmistrov
10-15-2012, 05:12 PM
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\disp lay_window.h(231): error C2146: syntax error : missing ';' before identifier 'get_hwnd'
1>d:\sdk\clanlib\include\clanlib\display\window\disp lay_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\disp lay_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\disp lay_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\targetprovi ders\display_window_provider.h(158): error C2146: syntax error : missing ';' before identifier 'get_hwnd'
1>d:\sdk\clanlib\include\clanlib\display\targetprovi ders\display_window_provider.h(158): error C2433: 'CL_DisplayWindowProvider::HWND' : 'virtual' not permitted on data declarations
1>d:\sdk\clanlib\include\clanlib\display\targetprovi ders\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\targetprovi ders\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\targetprovi ders\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\targetprovi ders\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



#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


#include <ClanLib/display.h>

class Collision {

public:

void run ();

};


Collision.cpp


#include "Collision.hpp"

void Collision::run () {

}

If I comment #include "ClanLib/display.h" in Collision.hpp then the error gone.

rombust
10-16-2012, 07:45 AM
ClanLib/display.h is missing an include for windows:

#include <windows.h>

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

IgorBurmistrov
10-16-2012, 04:45 PM
Thanks, it helped.

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