Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

asWRONG_CALLING_CONV when compiling on Ubuntu (written on Windows)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 B_old   Members   -  Reputation: 668

Like
0Likes
Like

Posted 12 March 2013 - 12:49 PM

Code that was written on Win 7 x64 produces the asWRONG_CALLING_CONV error when compiled under Ubuntu 12.10 x64. I have checked the asGetLibraryOptions() string and it does not contain AS_MAX_PORTABILITY.

 

Any idea what could be wrong with this code?

	struct floaty2
	{
		float x;
		float y;

		floaty2(float x, float y) : x(x), y(y)
		{}
	};

	void floaty2_init_constructor(float x, float y, floaty2* self)
	{
		new(self) floaty2(x, y);
	}

		engine.register_object_type("floaty2", sizeof(floaty2), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA);

		engine.register_object_property("floaty2", "float x", offsetof(floaty2, x));
		engine.register_object_property("floaty2", "float y", offsetof(floaty2, y));

		engine.register_object_behavior("floaty2", asBEHAVE_CONSTRUCT, "void f(float, float)", asFUNCTION(floaty2_init_constructor), Script_engine::Calling_convention::C_decl_obj_last);

The angelscript relevant parts are wrapped in a very thin layer, I hope you can still read the actual calls beneath it.

 

 



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3442

Like
1Likes
Like

Posted 12 March 2013 - 01:32 PM

Does your Script_engine::Calling_conventions::C_decl_obj_last actually match the value of asCALL_CDECL_OBJLAST?

 

Observe, the value of asCALL_CDECL_OBJLAST has changed in release 2.26.0 with the introduction of the new enum asCALL_THISCALL_ASGLOBAL.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 B_old   Members   -  Reputation: 668

Like
0Likes
Like

Posted 12 March 2013 - 02:56 PM

Damn, that was exactly the problem. Quite stupidly done on my side...

 

But now I have different problem.

engine.register_object_type("float3", sizeof(float3), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA);

engine.register_function("float3 normalize(const float3 &in)", asFUNCTIONPR(normalize, (const float3&), float3));

 

This gives me the following message:

Don't support returning type 'float3' by value from application in native calling convention on this platform

 

Maybe I need different object flags?

 

EDIT

OK, I found the part in the documentation where it tells me to use asOBJ_APP_CLASS_ALLFLOATS


Edited by B_old, 12 March 2013 - 03:00 PM.


#4 Andreas Jonsson   Moderators   -  Reputation: 3442

Like
0Likes
Like

Posted 12 March 2013 - 04:11 PM

:)


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS