The sdk builds correctly on Debug mode but on Release mode it shows following errors.
LINK : error LNK2001: unresolved external symbol _asBStrAlloc@4
LINK : error LNK2001: unresolved external symbol _asBStrFree@4
LINK : error LNK2001: unresolved external symbol _asBStrLength@4
Maybe bstr calls are left in the current version of AS(after seperating the default string type "bstr" from AS).
I have copied the static library and linked to my project.
When I try to pass bstr string from script to my application(both by reference and by value) it works fine, but on release mode it doesn't. On release mode my application recevies bad pointer.
Help me i have spent much time doing this..
(May be i am doing a basic mistake, so let me know)
You're getting the missing symbol errors when you compile the DLL in release mode. You can fix this by removing the symbols from the dll project settings -> link -> category: input -> force symbol references. Remove the references to the bstr functions from that field and the dll should compile correctly.
But you don't actually have to build the dll. Just set the lib as the active project and compile only that one.
Assuming the lib compiled correctly you shouldn't have any trouble using the bstr in release mode. Let me know if what I told you fixed the problem.
Thanks very much for your reply. Actually the application in which I am using angel script uses fast call by default, and even after registering correctly it changes the calling convention to its default type. And this was all. I was actually very much frustrated that what is wrong and therefore checking every possible thing that came to my mind.
(Fast call places the arguments in to the registers and this calling convention obviously doesn’t expect arguments to be in registers)
Well, as you discovered AngelScript doesn't support fastcall yet. But if you feel up to it you could add the support as a contribution to the library. Or, write wrapper functions that uses either the cdecl or the stdcall calling conventions.