Page 1 of 1

_imp__wassert linker errors with static lib

Posted: Fri Apr 23, 2010 6:54 am
by epidemicz
Hi folks,

I was wondering if I anyone could shed some light this linker error im getting with this library I'm trying to use.

Library: http://www.zezula.net/download/stormlib.zip (the project is StormLib.sln)

Also, I'm using VS2010.

Just trying to use one function out of it for now for testing.. my code:

Code: Select all

Import "StormLibDAD.lib"
  SFileOpenArchive(a.l,b.l,c.l,d.l) As "?SFileOpenArchive@@YGHPBDKKPAPAX@Z"
EndImport

SFileOpenArchive(@"test.mpq", 0, 0, @hMpq)
So far I've gotten a big list of linker errors, but after some research on the forum I've turned off switches here and there to get me down to just this.

Code: Select all

---------------------------
PureBasic - Linker error
---------------------------
POLINK: error: Unresolved external symbol '__imp___wassert'.

POLINK: fatal error: 1 unresolved external(s).
Been wracking my brain on this one guys, any help or ideas would be greatly appreciated.

Re: _imp__wassert linker errors with static lib

Posted: Sat Apr 24, 2010 9:34 am
by Trond
Maybe turn off asserts when compiling the lib?

Re: _imp__wassert linker errors with static lib

Posted: Sat Apr 24, 2010 10:58 am
by Mistrel
Ensure that you're compiling for unicode. Typically anything preceding by a "w" suggests that it's unicode.

Re: _imp__wassert linker errors with static lib

Posted: Sat Apr 24, 2010 5:08 pm
by jack
compile the Stormdll and use that instead, no polink errors.

Re: _imp__wassert linker errors with static lib

Posted: Sat Apr 24, 2010 10:07 pm
by SFSxOI
You trying to hack a Blizzard game? Do as jack suggested, works and is the eaisiet way to use storm.

Re: _imp__wassert linker errors with static lib

Posted: Sat Apr 24, 2010 10:16 pm
by epidemicz
well im in the starcraft 2 beta, trying to parse replay files

Re: _imp__wassert linker errors with static lib

Posted: Sun Apr 25, 2010 5:01 am
by epidemicz
Well after a little more research into what assert is I found that if I #define NDEBUG before assert is included it gets rid of my problem. Hopefully everything still works correctly :D. Also, my reason for not using the stormdll is the lib is not dependant on having the storm.dll on your system. So, I'm sure blizz wouldn't want me redistributing their files, but im sure they dont like me helping people poking into them either.

Thanks for all the help guys, you def got me pointed in the right direction.

Re: _imp__wassert linker errors with static lib

Posted: Sun Apr 25, 2010 8:05 am
by Mistrel
The reason it compiles is because you've enabled "no debugging", hence no asserts are included. ;)