[neutron-mc] making shared object from mcstas-r.c, under WinXP
Emmanuel Farhi
farhi at ill.fr
Tue Mar 16 18:06:51 CET 2004
Hello Timur,
you have to compile mcstas-r.c with its mcstas-r.h header file, where the undefined symbols are defined as
'extern'. Indeed thier value is to be set in the instrument itself, not in the run-time library.
If the problem persists, send us the full error output so that we see what undefined symbols should be added
as 'extern'.
Emmanuel.
Timur Elzhov wrote:
> Dear McStas experts,
>
> I successfully compiled shared object libmcstas-r.so from mcstas-r.c
> file, so now I'm able to compile instruments with --no-runtime option,
> and link it with that library. That is all under _Linux_. But, when
> I try to do the same under WindowsXP, I get linking error (MinGW compiler
> was used):
> mcstas> gcc -Wno-unused -fPIC -O2 -c mcstas-r.c
> mcstas> gcc --shared -o libmcstas-r.dll mcstas-r.o
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x498d):mcstas-r.c: undefined reference to `mcinstrument_source'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4992):mcstas-r.c: undefined reference to `mcinstrument_name'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49a1):mcstas-r.c: undefined reference to `mcinputtable'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ba):mcstas-r.c: undefined reference to `mcinputtable'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d0):mcstas-r.c: undefined reference to `mcinputtable'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d9):mcstas-r.c: undefined reference to `mcinputtable'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ea):mcstas-r.c: undefined reference to `mcinputtable'
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4a91):mcstas-r.c: more undefined references to `mcinputtable' follow
> C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4bea):mcstas-r.c: undefined reference to `mcnx'
> ...
>
> and so on, about 90 lines. Why?
>
> Tnanks a lot,
> Timur.
>
> _______________________________________________
> neutron-mc mailing list
> neutron-mc at risoe.dk
> http://neutron.risoe.dk/mailman/listinfo/neutron-mc
--
What's up Doc ?
--------------------------------------------
Emmanuel FARHI, http://www.ill.fr/Computing/people/Farhi \|/ ____ \|/
CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~
6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\
Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 20 76 48 \__U_/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20040316/195ca94c/attachment.html>
More information about the mcstas-users
mailing list