[neutron-mc] making shared object from mcstas-r.c, under WinXP

Kristian Nielsen kn at sifira.dk
Wed Mar 17 10:38:13 CET 2004

Timur Elzhov <Timur.Elzhov at jinr.ru> writes:

> Well, if I understand you, I could not build shared obbject from the
> following code (under Win32):
>   exiern int i;
>   void f(void)
>   {
>       i;
>   }
> right? But MinGW does build DLL successfully from this test!
> Or, you mean something else?

Well, it could be that the compiler is optimizing away the reference to
i. That could be settled by trying this code as a DLL instead:

    #include <stdio.h>
    extern int i;
    void f(void) {
        printf("%d\n", i);

If that compiles, then my guess about Windows DLL restrictions is plain
wrong (I am no expert in Windows anyway).

 - Kristian.

More information about the mcstas-users mailing list