0

I'm trying to build an opensource project that is basically dead and has zero maintainer support (WinCDEmu). I was able to follow the readme and get it pretty close to building with VS 2019 but I keep getting one failure that I don't understand:

11>BazisVirtualCDBus.obj : error LNK2001: unresolved external symbol "private: __thiscall BazisLib::DDK::BusDevice::PDOBase::PDOBase(wchar_t const *,wchar_t const *,wchar_t const *)" (??0PDOBase@BusDevice@DDK@BazisLib@@AAE@PB_W00@Z)
11>C:\wincdemu\WinCDEmu\AllModules\portable\BazisPortableCDBus32.sys : fatal error LNK1120: 1 unresolved externals

The constructor is actually defined in the bus.cpp file and everything compiles fine in the Debug (Kernel-mode) configuration. The error only appears when building in the Release (Kernel-mode) configuration. Some more details about what I've done to fix other compilation issues on the way here are detailed in this issue: https://github.com/sysprogs/WinCDEmu/issues/38

I'd really appreciate any advice from someone with better understanding of Visual Studio about what's going on and how to build the project successfully as the maintainer has not responded for some time and doesn't seem to be interested in providing updated build instructions to others who have inquired.

EDIT

I understand very well "What is an undefined reference/unresolved external symbol error and how do I fix it?" This does not answer my question. The problem here is specifically that the project configuration is correct, the solution builds in the debug configuration but the symbol is undefined in the release configuration while there are no obvious differences between the two configurations that would cause the symbol to be undefined in one but not the other.

It's worth mentioning that bus.cpp, where this symbol is actually defined, defines many other symbols which are not undefined in either build configuration. I'm trying to understand the reason why this specific symbol is problematic. While I was trying to find a solution, I also tried including the bus.cpp file as a source in the BazisVirtualCDBus project, which did resolve the issue above at the cost of producing numerous other errors about duplicate symbol definitions for everything else that is defined in the same file. The symbol in the error message above was not among the duplicates, which only adds to my confusion.

nwod
  • 318
  • 2
  • 12
  • looks like it's defined here https://github.com/sysprogs/BazisLib/blob/fbd656a1490bf82015ce6828ca8fba617ccf9e5e/bzshlp/WinKernel/bus.cpp#L211 – Alan Birtles Oct 02 '21 at 14:43
  • I know this, however the linker somehow does not in the release configuration. – nwod Oct 02 '21 at 18:17
  • How is everything linked together? Please provide a [mre] without relying on external links – Alan Birtles Oct 02 '21 at 19:16
  • If I could, I probably would know why the linker is failing and how to work around the problem. I'm afraid the only way to reproduce it is to clone the linked github repo, open the solution in VS2019, and then apply the migration steps described in [the linked github issue](https://github.com/sysprogs/WinCDEmu/issues/38). Honestly, if the problem was as straight forward as whoever initially closed this question as a duplicate thinks, I wouldn't have bothered to post the question in the first place. – nwod Oct 08 '21 at 11:19

0 Answers0