www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linker errors and how to catch them

reply Lubos Pintes <lubos.pintes gmail.com> writes:
Hi,
I just updated to DMD 2.062. I then tried to recompile somewhat bigger 
project. After fixing some errors, I received dozens of errors like this:
Error 42: Symbol Undefined _D3std6string6formatFYAya (immutable(char)[] 
std.string.format(, ...))
I didn't see them when compiled with DMD 2.060. I am using VisualD and I 
tried the "Rebuild solution" command to be sure everything is recompiled.
Feb 18 2013
parent reply "jerro" <a a.com> writes:
On Monday, 18 February 2013 at 12:55:13 UTC, Lubos Pintes wrote:
 Hi,
 I just updated to DMD 2.062. I then tried to recompile somewhat 
 bigger project. After fixing some errors, I received dozens of 
 errors like this:
 Error 42: Symbol Undefined _D3std6string6formatFYAya 
 (immutable(char)[] std.string.format(, ...))
 I didn't see them when compiled with DMD 2.060. I am using 
 VisualD and I tried the "Rebuild solution" command to be sure 
 everything is recompiled.
You have some object file or a library that was built using dmd 2.060 or earlier and uses std.format. Maybe you are using some D library that was built separately (not as a part of your project)? If so, you need to rebuild that library with dmd 2.062. If that is not the case, this sounds like a bug in VisualD to me.
Feb 18 2013
parent reply Lubos Pintes <lubos.pintes gmail.com> writes:
I am playing with library dgui.
In 2.060, everything built fine.
One of library samples imports std.string. Perhaps the VisualD doesn't 
include necessary library?
I updated the DMD as follows: I deleted the dmd2 from C:\D folder and 
replaced it with one I downloaded from dlang.org. Is this nonstandard in 
some way? I randomly tested/wrote short programs and they worked.
I also issued the clean solution, but that didn't help.

Dňa 18. 2. 2013 17:12 jerro  wrote / napísal(a):
 On Monday, 18 February 2013 at 12:55:13 UTC, Lubos Pintes wrote:
 Hi,
 I just updated to DMD 2.062. I then tried to recompile somewhat bigger
 project. After fixing some errors, I received dozens of errors like this:
 Error 42: Symbol Undefined _D3std6string6formatFYAya
 (immutable(char)[] std.string.format(, ...))
 I didn't see them when compiled with DMD 2.060. I am using VisualD and
 I tried the "Rebuild solution" command to be sure everything is
 recompiled.
You have some object file or a library that was built using dmd 2.060 or earlier and uses std.format. Maybe you are using some D library that was built separately (not as a part of your project)? If so, you need to rebuild that library with dmd 2.062. If that is not the case, this sounds like a bug in VisualD to me.
Feb 18 2013
parent reply "jerro" <a a.com> writes:
On Monday, 18 February 2013 at 16:47:00 UTC, Lubos Pintes wrote:
 I am playing with library dgui.
 In 2.060, everything built fine.
 One of library samples imports std.string. Perhaps the VisualD 
 doesn't include necessary library?
 I updated the DMD as follows: I deleted the dmd2 from C:\D 
 folder and replaced it with one I downloaded from dlang.org. Is 
 this nonstandard in some way? I randomly tested/wrote short 
 programs and they worked.
 I also issued the clean solution, but that didn't help.
I am assuming you are using the prebuilt libraries from one of the rar files at http://code.google.com/p/dgui/downloads/list (the .lib files in the lib folder in the rar file). The newest of those files was uploaded in December 2011, so the most recent version of DMD that could have been used to build the .lib files is 2.057. The signature of std.string.format has changed in 2.061, so Phobos doesn't contain a function with mangled name _D3std6string6formatFYAya any more, and because dgui.lib and dgui_debug.lib use that function, you get a linker error. To solve this problem you need to rebuild the files dgui.lib and dgui_lib.lib with DMD 2.062 (using dgui_build_dbg.bat and dgui_build_rel.bat). But because DGui hasn't been updated since 2011 AFAICS, it probably won't compile with dmd 2.062. You'll probably need to fix a bunch of compiler errors inside DGui to be able to use it with DMD 2.062.
Feb 18 2013
parent reply Lubos Pintes <lubos.pintes gmail.com> writes:
Hi,
I already did this. I am playing with that library.
I converted it so that it uses win32 windows api bindings and fixed a 
bunch of compile errors. I also converted enum names 
"So_THEY_ARE_NOT_SO_UGLY". :-).
Everything worked fine with 2.060. At least it compiled and sample were 
running nicely. Now this annoyance appeared, after some other semantic 
errors which I understood.
I am playing with all this in VisualD, so I don't use those .bat files 
from original library.
Still don't understand why std.string.format causes problems...
Dňa 18. 2. 2013 18:17 jerro  wrote / napísal(a):
 On Monday, 18 February 2013 at 16:47:00 UTC, Lubos Pintes wrote:
 I am playing with library dgui.
 In 2.060, everything built fine.
 One of library samples imports std.string. Perhaps the VisualD doesn't
 include necessary library?
 I updated the DMD as follows: I deleted the dmd2 from C:\D folder and
 replaced it with one I downloaded from dlang.org. Is this nonstandard
 in some way? I randomly tested/wrote short programs and they worked.
 I also issued the clean solution, but that didn't help.
I am assuming you are using the prebuilt libraries from one of the rar files at http://code.google.com/p/dgui/downloads/list (the .lib files in the lib folder in the rar file). The newest of those files was uploaded in December 2011, so the most recent version of DMD that could have been used to build the .lib files is 2.057. The signature of std.string.format has changed in 2.061, so Phobos doesn't contain a function with mangled name _D3std6string6formatFYAya any more, and because dgui.lib and dgui_debug.lib use that function, you get a linker error. To solve this problem you need to rebuild the files dgui.lib and dgui_lib.lib with DMD 2.062 (using dgui_build_dbg.bat and dgui_build_rel.bat). But because DGui hasn't been updated since 2011 AFAICS, it probably won't compile with dmd 2.062. You'll probably need to fix a bunch of compiler errors inside DGui to be able to use it with DMD 2.062.
Feb 18 2013
parent reply dennis luehring <dl.soluz gmx.net> writes:
Am 18.02.2013 18:37, schrieb Lubos Pintes:
 Hi,
 I already did this. I am playing with that library.
 I converted it so that it uses win32 windows api bindings and fixed a
 bunch of compile errors. I also converted enum names
 "So_THEY_ARE_NOT_SO_UGLY". :-).
 Everything worked fine with 2.060.
you compiled(bild) the dgui lib yourself with 2.062? i will not work if you use the prebuild ones
Feb 18 2013
parent reply Lubos Pintes <lubos.pintes gmail.com> writes:
 you compiled(bild) the dgui lib yourself with 2.062?
 i will not work if you use the prebuild ones
Yes. And as I said in some previous post, everything worked with 2.060. Quite confused.
Feb 18 2013
parent Lubos Pintes <lubos.pintes gmail.com> writes:
Ahh. I fixed the project dependencies and this probably fixed linker 
errors...
Dňa 18. 2. 2013 18:51 Lubos Pintes  wrote / napísal(a):
 you compiled(bild) the dgui lib yourself with 2.062?
 i will not work if you use the prebuild ones
Yes. And as I said in some previous post, everything worked with 2.060. Quite confused.
Feb 18 2013