DM linker vs GCC linker?

Jacob Carlborg doob at me.com
Wed Jan 18 06:46:40 PST 2012


On 2012-01-18 15:37, Andrea Fontana wrote:
>
> Ok, here a test:
>
> test.d :
>
> import std.xml;
> import std.stdio;
> import std.conv;
>
> int main(string[] args)
> {
> if (args.length != 2)
> {
> writeln("Usage: ", args[0], " file.xml");
> return 0;
> }
>
> string content = to!string(std.file.read(args[1]));
>
> try{
> check(content);
> } catch (CheckException ex) { writeln("Exception: ", ex); }
> return 0;
> }
>
>
> dmd -c test.d && gcc test.o -lphobos2 -lrt -lpthread -o testgcc
> vs
> dmd -c test.d && dmd test.o -oftestd
>
> try this code using a long xml file (tested here with a 2.0 mb list of
> italian cities) ...

Have you tried compiling and linking in one step with dmd? Just like this:

dmd test.d

BTW, you can pass "-v2 to dmd to see which flags it uses when invoking gcc.


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list