Sign in to follow this  
Rizwan Khalid

Debug and Release Modes

Recommended Posts

Rizwan Khalid    122
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) Rizwan Khalid

Share this post


Link to post
Share on other sites
WitchLord    4677
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.

Share this post


Link to post
Share on other sites
Rizwan Khalid    122
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)

Regards,
Rizwan Khalid

Share this post


Link to post
Share on other sites
WitchLord    4677
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this