Thread overview
newbie: linking problem
Mar 01, 2004
lesni_bleble
Mar 01, 2004
Derek Parnell
Mar 01, 2004
Manfred Nowak
Mar 01, 2004
resistor
Mar 01, 2004
lesni_bleble
Mar 01, 2004
Stewart Gordon
March 01, 2004
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


March 01, 2004
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
March 01, 2004
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.
March 01, 2004
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
>
>


March 01, 2004
yes.
big thanks to all.


March 01, 2004
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.