On 03/28/2011 04:49 PM, Ishan Thilina wrote:

now I get a whole lot more errors :s.

"
ishan@ishan-Ubu-I1464:~/Geany Projects$ dmd untitle.d
/usr/include/d/dmd/phobos/object.d(51): C-style function pointer and pointer to
array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/format.d(672): no identifier for declarator
inout(fakevalue)
/usr/include/d/dmd/phobos/std/c/stdlib.d(43): C-style function pointer and 
pointer
to array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/c/stdlib.d(59): C-style function pointer and 
pointer
to array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/c/linux/linux.d(558): C-style function pointer and
pointer to array syntax is deprecated. Use 'function' to declare function 
pointers
/usr/include/d/dmd/phobos/std/c/linux/linux.d(574): C-style function pointer and
pointer to array syntax is deprecated. Use 'function' to declare function 
pointers
"

I'm trying to compile the following simple code. As you can see it should work
without any problem.

"
import std.stdio;



int main()

{

        writefln("Hello world");



        return 0;

}

I have no idea why and where your issues in using D with dmd come from. AFAIK, it just works out of the box if you use release versions.

Just 2 notes about the piece of code:
First, you often do not need in D a program result code (int).
Second, writefln, as opposed to writeln, expects a format string as first 
argument.

void main () {
    writeln("Hello, world!");
    auto userName = "Otto";
    writefln("Hello, %s!", userName);
}

Denis
--
_________________
vita es estrany
spir.wikidot.com

Reply via email to