Thread overview
how to link with gdc
May 14, 2004
Kevin Bealer
2 simple Q.
May 14, 2004
Bent Rasmussen
May 17, 2004
David Friedman
May 19, 2004
Kevin Bealer
May 19, 2004
Patrick Horn
May 14, 2004
Command:
gdc -O2 -o nohii nohello.d

Program (nohello.d):
int main(char[][] args) {return 0;}

Error:

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld: crtbegin.o: No such file: No such file or directory

I can add crtbegin.o, crtend.o, and the -L and -l for libgcc; but each produces more errors.  The blind search ends when I get multiple definitions for a symbol.  I've tried other paths such as gdc then gcc.

What is the proper way to compile with gdc?  Or is it misconfigured?

Kevin


May 14, 2004
Disclaimer: This is newbieish. First question. I'd like to do the following.

float[3] Torus(float[2] P) {
    ...
}

I can't do that, so what's the "next best thing". I don't mind classes but it would be nice to be able to prototype it with just arrays in a safe way.

Second question. Is it possible to use templates to parameterize a function with values. Something like

template Tori(a : float, c : float)
{
    float[3] Torus(float[2] P)
    {
        ...
    }
}

Or should I use a higher-order function with delegates for that?

Bonus question :) - Where can I find a good webresource to read about templates in general and preferably specifically in D.

Regards,
Bent Rasmussen


May 17, 2004
Kevin Bealer wrote:
> Command:
> gdc -O2 -o nohii nohello.d
> 
> Program (nohello.d):
> int main(char[][] args) {return 0;}
> 
> Error:
> 
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld:
> crtbegin.o: No such file: No such file or directory
> 
> I can add crtbegin.o, crtend.o, and the -L and -l for libgcc; but each produces
> more errors.  The blind search ends when I get multiple definitions for a
> symbol.  I've tried other paths such as gdc then gcc.
> 
> What is the proper way to compile with gdc?  Or is it misconfigured?
> 
> Kevin
> 
> 

The original command is all you should need.  Try running 'gdc -v' and 'gcc -v' and see if the version numbers and install directories match up.

David

May 19, 2004
Yes I also had that problem when compiling gcc.

The lazy solution was to copy the crtbegin.o and crtend.o into every directory grom the gcc source tree.

But I later found that running
"DESTDIR=installation_directory make install"
or "sudo make install" if you are fine with it going into /usr/gcc-3.4
fixes this issue.

Kevin Bealer wrote:
> 
> Error:
> 
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld:
> crtbegin.o: No such file: No such file or directory
> 

May 19, 2004
In article <c8agi5$2r9e$1@digitaldaemon.com>, David Friedman says...
>
>Kevin Bealer wrote:
>> Command:
>> gdc -O2 -o nohii nohello.d
>> 
>> Program (nohello.d):
>> int main(char[][] args) {return 0;}
>> 
>> Error:
>> 
>> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld: crtbegin.o: No such file: No such file or directory
>> 
>> I can add crtbegin.o, crtend.o, and the -L and -l for libgcc; but each produces more errors.  The blind search ends when I get multiple definitions for a symbol.  I've tried other paths such as gdc then gcc.
>> 
>> What is the proper way to compile with gdc?  Or is it misconfigured?
>> 
>> Kevin
>> 
>> 
>
>The original command is all you should need.  Try running 'gdc -v' and 'gcc -v' and see if the version numbers and install directories match up.
>
>David

They didn't; so I upgraded.  Thanks.

Kevin