Beginning AngelScript

Started by
5 comments, last by WitchLord 18 years, 7 months ago
hi guys... im interested in starting to use angel script. one thing i know for sure is that i want to use angelscript through a dynamic dll that i load myself. ive been experimenting with vc++6.0 to compile this dll, but all i get is errors when i try to import from them. i just need help to build the dynamic dll from the sources. thanks in advance
Advertisement
To build the DLL you must define the preprocessor flag ANGELSCRIPT_EXPORT so that the functions are properly exported.

You'll also have to add the DllMain() function as defined by Microsoft.

You can probably use the already created dll project for MSVC6, though I haven't tested this in a very long time so it might need a few minor adjustments. You'll find this project in the /sdk/angelscript/projects/msvc6/dll/ folder. You'll have to compile the static library first (or alternatively add all the library source files to the dll project).

When linking with the dll, you'll have to define the flag ANGELSCRIPT_DLL_LIBRARY_IMPORT in the project settings, in case you're linking with the automatic dll import lib. If you manually load the dll and find the function pointers, you should define the flag ANGELSCRIPT_DLL_MANUAL_IMPORT so that the declarations in AngelScript doesn't interfere with your function pointers.

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

thx for the quick reply.
i did everything u said, but its still not working!!:(
im nicely stuck now...any more sugestions?
Show us the error messages that you're getting, and I'm sure someone will be able to help you.

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

there is no error message - the dll gets made.
when i run the program to test the dll, the dll loads fine.
when i get a function out of the dll, it is null.
so, the dll gets made, but the functions are not in it...
a step by step guide from start to end is what i need i think...

thanks
I think you might need to do a little research on how to use static or dynamic linking with DLL libraries.
It would seem that your dll doesn't export the functions you want, or perhaps it exports them with a different name than you expect. You can verify the exported function names with the tool Depends, that you should find on the start menu under Microsoft Visual C++ Tools.

I also agree with Rain Dog. You really ought to read up on the subject of compiling dlls as well as using them. MSDN is a good place to start: MSDN library online. You should also be able to find good articles by searching on Google.

I just compiled the dll using the MSVC6 project that I distribute with the AngelScript SDK, and everything seems to be fine. I verified the exported functions with Depends, just to make sure. Why aren't you using this project?




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

This topic is closed to new replies.

Advertisement