Can't compile to GLFW anymore, HTML5 works fine

Monkey Targets Forums/Desktop/Can't compile to GLFW anymore, HTML5 works fine

stefanbeckmann(Posted 2011) [#1]
When compiling my game with the GLFW target i recieve the following errors:



i am on osx 10.6.6, glfw worked fine yesterday on monkey pro2.9, today i changed some code and updated to monkey pro 3.0. not sure what caused the problem.
*EDIT* actually it has to be my code, because it won't compile in 2.9 and 3.0

compiling the game to html5 works without any problems. has anyone a hint what the problem might be?


stefanbeckmann(Posted 2011) [#2]
Found the problem:

after switching to strict mode i supposed that the methods OnCreate OnUpdate and OnRender are returning the type void, so i defined them as OnCreate:Void. After examination of the cpp file i found out that the App Class defines those functions as OnCreate:Int. My Game extending App with the wrong return types in those functions caused the problem. But compiling to HTML5 this goes unnoticed (might be because of loose typing?).

So the correct code would be like this

	  Method OnCreate:Int ()
		ActiveGameState = New GameStateMenu
		SetUpdateRate 60
		Return 0
	  End


I don't know if it is possible to check if the typing of extended classes is correct before compiling?

BTW: is there anyway to change the post title to solved or something, now knowing the problem the post title seems somewhat 'not really' related to its contents


therevills(Posted 2011) [#3]
Hey Stefan, check this post out:

http://www.monkeycoder.co.nz/Community/posts.php?topic=135