Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug build configuration does not compile #19

Open
BinToss opened this issue Dec 15, 2021 · 1 comment
Open

Debug build configuration does not compile #19

BinToss opened this issue Dec 15, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@BinToss
Copy link
Member

BinToss commented Dec 15, 2021

TODO

  • Research how to link a Debug build against a static Release-type library

The Linker is failing a a few operations involving discord-rpc.lib.
These issues are due to the precompiled library having been compiled with incompatible arguments and parameters.

discord-rpc ours
_ITERATOR_DEBUG_LEVEL 0 2
RuntimeLibrary MT_StaticRelease MDd_DynamicDebug
Build Log
Build started...
1>------ Build started: Project: DRP, Configuration: Debug Win32 ------
1>Build started 12/14/2021 5:56:41 PM.
1>Target Link:
1>    discord-rpc.lib(discord_rpc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>    discord-rpc.lib(discord_rpc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>    discord-rpc.lib(discord_register_win.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>    discord-rpc.lib(discord_register_win.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>    discord-rpc.lib(serialization.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>    discord-rpc.lib(serialization.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>    discord-rpc.lib(rpc_connection.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>    discord-rpc.lib(rpc_connection.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>    LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>    ..\bin\Debug\HCE.DRP.dll : fatal error LNK1319: 8 mismatches detected
1>Done building target "Link" in project "DRP.vcxproj" -- FAILED.
1>
1>Done building project "DRP.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>discord-rpc.lib(discord_rpc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>discord-rpc.lib(discord_rpc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>discord-rpc.lib(discord_register_win.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>discord-rpc.lib(discord_register_win.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>discord-rpc.lib(serialization.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>discord-rpc.lib(serialization.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>discord-rpc.lib(rpc_connection.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>discord-rpc.lib(rpc_connection.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in main.obj
1>..\bin\Debug\HCE.DRP.dll : fatal error LNK1319: 8 mismatches detected
1>    1 Warning(s)
1>    9 Error(s)
1>
1>Time Elapsed 00:00:01.41
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

> Build started at 5:56 PM and took 2.334 seconds

Workarounds

No known workarounds.
Perhaps there are Linker options for allowing mixed link types.

Solutions

A. Only build Release builds.
B. Acquire the the source code of Discord RPC and compile for Multi-threaded Debug DLLs.
C. Acquire a debug build of the Discord RPC library.

@BinToss BinToss added the bug Something isn't working label Dec 15, 2021
@BinToss BinToss self-assigned this Dec 15, 2021
@BinToss
Copy link
Member Author

BinToss commented Dec 15, 2021

try <UseDebugLibraries>false</UseDebugLibraries>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant