Thread overview
need help with linker error
Apr 11, 2005
glen
Apr 11, 2005
Joey Peters
Apr 11, 2005
Glen
Apr 11, 2005
J C Calvarese
April 11, 2005
Hi All,
Just starting with D.  I am getting the following link error on the follow 2
simple file program.  Any help is appreciated :-)

regards,
-Glen






D:\dev\D\dmd\bin\..\..\dm\bin\link.exe hello,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

hello.obj(hello)
Error 42: Symbol Undefined __Class_4file4File
hello.obj(hello)
Error 42: Symbol Undefined _D4file4File5_ctorFAaZC4file4File
--- errorlevel 2




------------------  hello.d ------------------------

import file;

int main(char[][] args)
{
File file = new File( "." );

return 0;
}



------------------  file.d ------------------------


module file;


public class File  {

public {
this(char[] path) {
}
}

}




April 11, 2005
Are you sure you're compiling both files? (dmd hello.d file.d)


"glen" <glen_member@pathlink.com> schreef in bericht news:d3ec6a$313u$1@digitaldaemon.com...
> Hi All,
> Just starting with D.  I am getting the following link error on the follow
> 2
> simple file program.  Any help is appreciated :-)
>
> regards,
> -Glen
>
>
>
>
>
>
> D:\dev\D\dmd\bin\..\..\dm\bin\link.exe hello,,,user32+kernel32/noi;
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>
> hello.obj(hello)
> Error 42: Symbol Undefined __Class_4file4File
> hello.obj(hello)
> Error 42: Symbol Undefined _D4file4File5_ctorFAaZC4file4File
> --- errorlevel 2
>
>
>
>
> ------------------  hello.d ------------------------
>
> import file;
>
> int main(char[][] args)
> {
> File file = new File( "." );
>
> return 0;
> }
>
>
>
> ------------------  file.d ------------------------
>
>
> module file;
>
>
> public class File  {
>
> public {
> this(char[] path) {
> }
> }
>
> }
>
>
>
> 


April 11, 2005
In article <d3ec6a$313u$1@digitaldaemon.com>, glen says...
>
>Hi All,
>Just starting with D.  I am getting the following link error on the follow 2
>simple file program.  Any help is appreciated :-)
>
>regards,
>-Glen


Add both source files to the command line:
dmd hello.d file.d

More info: http://www.prowiki.org/wiki4d/wiki.cgi?ErrorMessages#LinkerErrors

>D:\dev\D\dmd\bin\..\..\dm\bin\link.exe hello,,,user32+kernel32/noi;
>OPTLINK (R) for Win32  Release 7.50B1
>Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>
>hello.obj(hello)
>Error 42: Symbol Undefined __Class_4file4File
>hello.obj(hello)
>Error 42: Symbol Undefined _D4file4File5_ctorFAaZC4file4File
>--- errorlevel 2
>
>
>
>
>------------------  hello.d ------------------------
>
>import file;


..
>
>------------------  file.d ------------------------
>
>
>module file;
>

..

jcc7
April 11, 2005
Thanks that was it (duh)...  One of those errors I will never make again (I will
chalk that up to being a java developer for 6 years)!!!


and thanks to J C Calvares too...



In article <d3edsr$1kl$1@digitaldaemon.com>, Joey Peters says...
>
>Are you sure you're compiling both files? (dmd hello.d file.d)
>
>
>"glen" <glen_member@pathlink.com> schreef in bericht news:d3ec6a$313u$1@digitaldaemon.com...
>> Hi All,
>> Just starting with D.  I am getting the following link error on the follow
>> 2
>> simple file program.  Any help is appreciated :-)
>>
>> regards,
>> -Glen
>>
>>
>>
>>
>>
>>
>> D:\dev\D\dmd\bin\..\..\dm\bin\link.exe hello,,,user32+kernel32/noi;
>> OPTLINK (R) for Win32  Release 7.50B1
>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>>
>> hello.obj(hello)
>> Error 42: Symbol Undefined __Class_4file4File
>> hello.obj(hello)
>> Error 42: Symbol Undefined _D4file4File5_ctorFAaZC4file4File
>> --- errorlevel 2
>>
>>
>>
>>
>> ------------------  hello.d ------------------------
>>
>> import file;
>>
>> int main(char[][] args)
>> {
>> File file = new File( "." );
>>
>> return 0;
>> }
>>
>>
>>
>> ------------------  file.d ------------------------
>>
>>
>> module file;
>>
>>
>> public class File  {
>>
>> public {
>> this(char[] path) {
>> }
>> }
>>
>> }
>>
>>
>>
>> 
>
>