www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What could this OptLink Error mean?

reply Dukc <ajieskola gmail.com> writes:
I was building one example of DLangUi (dub build 
--build-mode=allAtOnce --build=debuglinker) and it did compile 
but the linker started to complain. I did notice it seemed to be 
related to the standard library, so I updated it and DRuntime to 
the lastest master, rebuilt them and replaced phobos.lib with the 
result. I also removed the binary and .dub directory from DLangUI 
to force Dub to rebuild it, which it did. Still the linker 
complains, but about a different symbol:

..\..\lib\dlangui.lib(colors)
  Error 42: Symbol Undefined __d_switch_string

Does anybody have an idea what could be causing this?
Dec 29 2017
parent reply user1234 <user1234 12.nl> writes:
On Friday, 29 December 2017 at 16:11:20 UTC, Dukc wrote:
 I was building one example of DLangUi (dub build 
 --build-mode=allAtOnce --build=debuglinker) and it did compile 
 but the linker started to complain. I did notice it seemed to 
 be related to the standard library, so I updated it and 
 DRuntime to the lastest master, rebuilt them and replaced 
 phobos.lib with the result. I also removed the binary and .dub 
 directory from DLangUI to force Dub to rebuild it, which it 
 did. Still the linker complains, but about a different symbol:

 ..\..\lib\dlangui.lib(colors)
  Error 42: Symbol Undefined __d_switch_string

 Does anybody have an idea what could be causing this?
The deps have to be rebuild too. Assuming paths and everything is okay (should be the case when you build ~master as indicated in the wiki) just add --force.
Dec 29 2017
parent reply Dukc <ajieskola gmail.com> writes:
On Saturday, 30 December 2017 at 00:49:48 UTC, user1234 wrote:
 The deps have to be rebuild too.
After downloading dmd 78, it started to work. It's likely you were right about the issue, DUB rebuilt everything after detecting new compiler version. Sorry for my late reply.
Jan 04
parent user789 <user789 789.fi> writes:
On Thursday, 4 January 2018 at 21:33:58 UTC, Dukc wrote:
 On Saturday, 30 December 2017 at 00:49:48 UTC, user1234 wrote:
 The deps have to be rebuild too.
After downloading dmd 78, it started to work. It's likely you were right about the issue, DUB rebuilt everything after detecting new compiler version. Sorry for my late reply.
From a compiler version to another, the ABI can change (examples are: mangling, new overloads as seen with format a couple of months ago). You compiled the program with a slightly different ABI than the one used to compile the deps as static libraries. I don't know why DUB didn't detect this but as said user1234 always try " --force" on DUB or rebuild deps manually to eliminate this possible cause of problems.
Jan 05