www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Link Error, Can't determine problem.

reply Joshua Cearley <jtech ezoob.com> writes:
First, a little background:
The project is called Crystal Widgets Library, it aims to be a very 
powerful and modular toolkit for D programmers. The project uses Rake 
(rake.rubyforge.org) for the build file. On Linux, the project compiles 
and links without a hitch (using GDC for linux version). On Windows, I'm 
using cygwin for ruby/rake as I prefer a linux type console to window's 
weak console (you can't pipe with windows' or at least i haven't figured 
out how to). Cygwin isn't using GDC, its using DMD. Everything compiles 
fine but it won't link the test application.

Now for the technical stuff:
dmd is version 0.113, linker is the dmc linker 7.50B1 (System is Windows 
XP Service Pack 1) Oh and my main drive is E: instead of C: due to some 
snafu in installation.

Backtrace:
<Open Cygwin>
$ cd /cygdrive/e/projects/cwl (equivalent to cd E:\projects\cwl)
$ rake examples
(in /cygdrive/e/projects/cwl)
/cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
-ofbuild/cwl/core/serializable.obj source/cwl/core/serializable.d
/cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
-ofbuild/cwl/core/widget.obj source/cwl/core/widget.d
/cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
-ofbuild/cwl/core/app.obj source/cwl/core/app.d
lib -c build/lib/CWL_core.lib build/cwl/core/serializable.obj 
build/cwl/core/widget.obj build/cwl/core/app.obj
/cygdrive/e/dmd/dmd/bin/dmd.exe -c -Isource/ -debug -unittest 
-ofbuild/cwl/examples/testonly.obj source/cwl/examples/testonly.d
/cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest 
build/bin/testonly.exe build/cwl/examples/testonly.obj
Digital Mars Librarian Version 8.00n
Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com
Digital Mars Librarian complete.
e:\dmd\dmd\bin\..\..\dm\bin\link.exe 
build\cwl\examples\testonly,build\bin\testonly.exe,,user32+kernel32/noi;

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

build\cwl\examples\testonly.obj(testonly)
  Error 42: Symbol Undefined 
_D3cwl4core6widget6Widget14loadFromStreamFC3std6stream11InputStreamZv
build\cwl\examples\testonly.obj(testonly)
  Error 42: Symbol Undefined 
_D3cwl4core6widget6Widget12saveToStreamFC3std6stream12OutputStreamZv
build\cwl\examples\testonly.obj(testonly)
  Error 42: Symbol Undefined __Class_3cwl4core6widget6Widget
build\cwl\examples\testonly.obj(testonly)
  Error 42: Symbol Undefined 
_D3cwl4core6widget6Widget5_ctorFZC3cwl4core6widget6Widget
--- errorlevel 4
rake aborted!
Command failed with status (4): [/cygdrive/e/dmd/dmd/bin/dmd.exe 
-Isource/ -debug -unittest build/bin/testonly.exe 
build/cwl/examples/testonly.obj]
./rakefile.rb:44

I haven't been able to figure out the source of the problem, it looks 
like it isn't noticing the widget.d file thats in CWL_core.lib. Any help 
  is greatly appreciated. Let me know if more information is needed and 
I will gladly suplly it.

--
Joshua Cearley
BlackCrystal Software
"Making dreams reality"
Apr 18 2005
parent reply Derek Parnell <derek psych.ward> writes:
On Mon, 18 Apr 2005 21:04:13 -0500, Joshua Cearley wrote:

 First, a little background:
 The project is called Crystal Widgets Library, it aims to be a very 
 powerful and modular toolkit for D programmers. The project uses Rake 
 (rake.rubyforge.org) for the build file. On Linux, the project compiles 
 and links without a hitch (using GDC for linux version). On Windows, I'm 
 using cygwin for ruby/rake as I prefer a linux type console to window's 
 weak console (you can't pipe with windows' or at least i haven't figured 
 out how to). Cygwin isn't using GDC, its using DMD. Everything compiles 
 fine but it won't link the test application.
 
 Now for the technical stuff:
 dmd is version 0.113, linker is the dmc linker 7.50B1 (System is Windows 
 XP Service Pack 1) Oh and my main drive is E: instead of C: due to some 
 snafu in installation.
 
 Backtrace:
 <Open Cygwin>
 $ cd /cygdrive/e/projects/cwl (equivalent to cd E:\projects\cwl)
 $ rake examples
 (in /cygdrive/e/projects/cwl)
 /cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
 -ofbuild/cwl/core/serializable.obj source/cwl/core/serializable.d
 /cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
 -ofbuild/cwl/core/widget.obj source/cwl/core/widget.d
 /cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest -c 
 -ofbuild/cwl/core/app.obj source/cwl/core/app.d
 lib -c build/lib/CWL_core.lib build/cwl/core/serializable.obj 
 build/cwl/core/widget.obj build/cwl/core/app.obj
 /cygdrive/e/dmd/dmd/bin/dmd.exe -c -Isource/ -debug -unittest 
 -ofbuild/cwl/examples/testonly.obj source/cwl/examples/testonly.d
 /cygdrive/e/dmd/dmd/bin/dmd.exe -Isource/ -debug -unittest 
 build/bin/testonly.exe build/cwl/examples/testonly.obj
 Digital Mars Librarian Version 8.00n
 Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com
 Digital Mars Librarian complete.
 e:\dmd\dmd\bin\..\..\dm\bin\link.exe 
 build\cwl\examples\testonly,build\bin\testonly.exe,,user32+kernel32/noi;
 
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 build\cwl\examples\testonly.obj(testonly)
   Error 42: Symbol Undefined 
 _D3cwl4core6widget6Widget14loadFromStreamFC3std6stream11InputStreamZv
 build\cwl\examples\testonly.obj(testonly)
   Error 42: Symbol Undefined 
 _D3cwl4core6widget6Widget12saveToStreamFC3std6stream12OutputStreamZv
 build\cwl\examples\testonly.obj(testonly)
   Error 42: Symbol Undefined __Class_3cwl4core6widget6Widget
 build\cwl\examples\testonly.obj(testonly)
   Error 42: Symbol Undefined 
 _D3cwl4core6widget6Widget5_ctorFZC3cwl4core6widget6Widget
 --- errorlevel 4
 rake aborted!
 Command failed with status (4): [/cygdrive/e/dmd/dmd/bin/dmd.exe 
 -Isource/ -debug -unittest build/bin/testonly.exe 
 build/cwl/examples/testonly.obj]
 ./rakefile.rb:44
 
 I haven't been able to figure out the source of the problem, it looks 
 like it isn't noticing the widget.d file thats in CWL_core.lib. Any help 
   is greatly appreciated. Let me know if more information is needed and 
 I will gladly suplly it.
I suspect that the name of the library needs to be given to the link command, otherwise how would it know to look in that library? -- Derek Parnell Melbourne, Australia http://www.dsource.org/projects/build/ v2.01 released 18/Apr/2005 http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage 19/04/2005 12:22:35 PM
Apr 18 2005
parent Joshua Cearley <jtech ezoob.com> writes:
Hmm... lol
That was the problem that was keeping me stumped. Apparently I forgot to 
put it in when i rewrite the build command. Before it was 
build/bin/CWL_core.lib which explains why it couldn't find it. LOL. LOL. 
  ROFL.

--
Joshua Cearley
BlackCrystal Software
"Making dreams reality"
Apr 18 2005