BZ2 library

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 11 23:56:03 PST 2016


On Saturday, 12 March 2016 at 06:50:59 UTC, stunaep wrote:
> On Saturday, 12 March 2016 at 06:07:25 UTC, Mike Parker wrote:
>> [...]
>
> I used visual studio 2013 to build the libraries
>
> With dflag -m64 and dub flag --arch=x86_64, this happens

You shouldn't specify -m64 in your configuration. DUB will do 
that for you when you feed it --arch=x86_64.


>     LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with 
> use of other libs; use /NODEFAULTLIB:library
>     
> .dub\build\application-debug-windows-x86_64-dmd_2070-F2AB32EEAA78A29A3AA6010749D38D4A\rsdlib.exe : fatal error LNK1169: one or more multiply defined symbols found
>     --- errorlevel 1169
>     dmd failed with exit code 1169.
>

Make sure that DMD's sc.ini is configured to point to the same 
developer binaries you used to compile the bzip binary. If, for 
example, it is pointing to, say, an older version of the Windows 
SDK, but you used VS 2013 Community to compile bzip, conflicts 
like this are possible. I've had this sort of issue before.

>
>
> and with dflag -m32mscoff, this happens
>
>     Performing "debug" build using dmd for x86.
>     rsdlib ~master: building configuration "application"...
>     Linking...
>     rsdlib.obj : error LNK2019: unresolved external symbol 
> _BZ2_bzDecompressInit referenced in function     
> _D6rsdlib6cache39Container6decodeFC6rsdlib2io10ByteBufferAiZC6rsdlib6cache39Container
>     rsdlib.obj : error LNK2019: unresolved external symbol 
> _BZ2_bzDecompress referenced in function     
> _D6rsdlib6cache39Container6decodeFC6rsdlib2io10ByteBufferAiZC6rsdlib6cache39Container
>     rsdlib.obj : error LNK2019: unresolved external symbol 
> _BZ2_bzDecompressEnd referenced in function     
> _D6rsdlib6cache39Container6decodeFC6rsdlib2io10ByteBufferAiZC6rsdlib6cache39Container
>     
> .dub\build\application-debug-windows-x86-dmd_2070-E301E842F2B5FA1A3A9D79D8EE34C4E8\rsdlib.exe : fatal error LNK1120: 3 unresolved externals
>     --- errorlevel 1120
>     dmd failed with exit code 1120.

DUB does not yet have built-in support for -m32mscoff. Passing it 
in 'dflags' will cause it to be used to compile your executable, 
but it will not apply to any dependencies you have. I don't know 
if this is the cause of these errors or not, but there is an 
enhancement request in DUB's issue tracker for it [1].

[1] https://github.com/D-Programming-Language/dub/issues/628


More information about the Digitalmars-d-learn mailing list