Import different DLL's depending on Debug/Release?

BlitzMax Forums/BlitzMax Programming/Import different DLL's depending on Debug/Release?

Gabriel(Posted 2009) [#1]
Is there any way to import a different library in the debug and release build of a module? The library I'm wrapping has two dll's, a debug one and a release one. It would be really nice to be able to incorporate the debug one, but BlitzMax doesn't seem to have a compiler directive to support it.

For example, I can do this :

?Debug
   Import "-lSomeDLL-d"
?


And it doesn't even complain that Import needs to be at the top of the file, so that's ok. But there's no else to a compiler directive, as far as I can see and for some bizarre reason there's no matching ?Release directive, so all I can achieve is importing the debug dll in debug and nothing at all in release. I can't import both without having different names for all the functions, which would defeat the purpose of having them both. It's supposed to be seamless.

It would have to be something which doesn't involve rebuilding modules. I can't tell everyone to customize BRL's modules to make it work. Or install a custom BMK, for that matter.


plash(Posted 2009) [#2]
Strange.. This feature works when using ?Win32 for resource files.


Yan(Posted 2009) [#3]
Unless I've misunderstood what you mean...
?Debug
  Print "Debug"
?Not Debug
  Print "Release"
?

??


Brucey(Posted 2009) [#4]
Don't you need to use LoadLibrary() for a DLL?


SpaceAce(Posted 2009) [#5]
Brucey,
The -l at in the import filename string specifies library.

SpaceAce


Brucey(Posted 2009) [#6]
Well, Gabriel didn't mention he had .a files for the DLLs... so I just assumed he wanted to load the DLLs at runtime.


Gabriel(Posted 2009) [#7]
Ahhh, ?Not Debug is the one. I tried a search but since the ? in ?Debug was being ignored, I didn't come up with anything useful. Thanks Yan.