www.digitalmars.com         C & C++   DMDScript  

D - newbie: linking problem

reply "lesni_bleble" <el email.cz> writes:
hello,

i have this two files in same directory:
file test.d:

import bleble;
int main ()
{  bleble.print();
    return 1; }

and file bleble.d :

module bleble;
import std.c.stdio;
public void print () { puts("something.."); }


so simple.
when i use:
 dmd.exe -c bleble.d
 dmd.exe test.d
i get this error: test.obj(test) Error 42: Symbol Undefined _D4moje6blebleFZv --- errorlevel 1 so, please what am i doing wrong? it seems that link.exe don't search actual directory, or something like that... yes. i know it's stupid problem.. thanx for comments
Feb 29 2004
next sibling parent Derek Parnell <Derek.Parnell Psyc.ward> writes:
On Mon, 1 Mar 2004 03:21:01 +0100 (03/01/04 13:21:01)
, lesni_bleble <el email.cz> wrote:

 hello,

 i have this two files in same directory:
 file test.d:

 import bleble;
 int main ()
 {  bleble.print();
     return 1; }

 and file bleble.d :

 module bleble;
 import std.c.stdio;
 public void print () { puts("something.."); }


 so simple.
 when i use:
 dmd.exe -c bleble.d
 dmd.exe test.d
i get this error: test.obj(test) Error 42: Symbol Undefined _D4moje6blebleFZv --- errorlevel 1 so, please what am i doing wrong? it seems that link.exe don't search actual directory, or something like that...
When the 'dmd' command runs, it uses the input as stated on its command line, rather than implied in the source files. Thus the second dmd command would work if you have ... dmd.exe test.d bleble.obj or even dmd.exe test.d *.obj -- Derek
Feb 29 2004
prev sibling next sibling parent Manfred Nowak <svv1999 hotmail.com> writes:
lesni_bleble wrote:

 it seems that link.exe don't search actual directory
Right. You have to tell dmd that it should compile `bleble.d' or link `bleble.obj' the bleble module by the command `dmd test.d bleble.*', replace `*' with the suffix you need. So long.
Feb 29 2004
prev sibling parent reply resistor mac.com writes:
dmd.exe test.d bleble.d

or

dmd.exe bleble.d -c
dmd.exe test.d bleble.obj

or

dmd.exe bleble.d -c
dmd.exe test.d -c
link.exe test.obj bleble.obj

In article <c1u6m9$19e8$1 digitaldaemon.com>, lesni_bleble says...
hello,

i have this two files in same directory:
file test.d:

import bleble;
int main ()
{  bleble.print();
    return 1; }

and file bleble.d :

module bleble;
import std.c.stdio;
public void print () { puts("something.."); }


so simple.
when i use:
 dmd.exe -c bleble.d
 dmd.exe test.d
i get this error: test.obj(test) Error 42: Symbol Undefined _D4moje6blebleFZv --- errorlevel 1 so, please what am i doing wrong? it seems that link.exe don't search actual directory, or something like that... yes. i know it's stupid problem.. thanx for comments
Feb 29 2004
next sibling parent "lesni_bleble" <el email.cz> writes:
yes.
big thanks to all.
Feb 29 2004
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
resistor mac.com wrote:

 dmd.exe test.d bleble.d
<snip top of upside-down reply> This is indeed the best form to use, at least as far as IMX it tends to generate a smaller exe. Presumably because it enables holistic optimisations (e.g. non-virtualising methods) to work. Of course, that's before you've got to the -O, -inline, -release options.... Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Mar 01 2004