[rune@localhost source]$ g++ main.cpp ../../../add_on/scriptstring/scriptstring.cpp -langelscript
[rune@localhost source]$ ./a.out
a.out: ../../../add_on/scriptstring/scriptstring.cpp:591: void RegisterScriptString(asIScriptEngine*): Assertion `r >= 0' failed.
Avbrutt (SIGABRT)
Error when running script on AMD64
Hm. Now got angelscript compiled and installed, but have a problem registering methods and functions. The same problem shows up when trying to run the console app.
The same thing works on my laptop (which is 32 bit).
This is due to the fact that AngelScript doesn't support native calling conventions on AMD64, yet. Registered functions must thus use the generic calling convention.
The only sample (besides the feature tests) that works right out of the box on AMD64 is the tutorial sample (or at least it should work). I need to fix the other samples as well to work with both native calling conventions and the generic calling convention.
Regards,
Andreas
The only sample (besides the feature tests) that works right out of the box on AMD64 is the tutorial sample (or at least it should work). I need to fix the other samples as well to work with both native calling conventions and the generic calling convention.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Thanks for pointing me in the right direction. With some tweaks I was able to make the tutorial app compile. Not well enough for a patch, but a few porting notes here:
You are using some windows specific headers:
I used clock in place of timeGetTime(). This was less than ideal because on my computer the clock value seems to have an actual resolution of 1/100 of a second, and it only counts cpu time actually used by the program. Time waiting for the console to do its output is not part of this. times() in <sys/time.h> may (or may not) be better.
When compiling one must link with the curses library.
I had some problems with the script file itself. For some reason double slash comments seem not to be working on linux.
Also I had some problems with the division inside this line:
You are using some windows specific headers:
#ifdef WIN32#include <conio.h> // kbhit(), getch()#include <windows.h>#else#include <curses.h> // kbhit(), getch()#include <time.h> // clock()#endif
I used clock in place of timeGetTime(). This was less than ideal because on my computer the clock value seems to have an actual resolution of 1/100 of a second, and it only counts cpu time actually used by the program. Time waiting for the console to do its output is not part of this. times() in <sys/time.h> may (or may not) be better.
#ifndef WIN32typedef int DWORD;DWORD timeGetTime() { return (DWORD)((clock() * 1000) / CLOCKS_PER_SEC);}#endif
When compiling one must link with the curses library.
g++ main.cpp ../../../add_on/scriptstring/scriptstring.cpp -langelscript -lcurses
I had some problems with the script file itself. For some reason double slash comments seem not to be working on linux.
script (3, 14) : ERR : Expected ';'script (6, 14) : ERR : Expected ';'script (9, 11) : ERR : Expected ';'Build() failed
Also I had some problems with the division inside this line:
Print("System has been running for " + GetSystemTime()/1000.0 + " seconds\n");
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement