[clean-list] htoclean sorrows
John van Groningen
johnvg at cs.ru.nl
Tue May 30 17:22:30 MEST 2006
Matthew Bromberg wrote:
>Sigh,
>I attempted this technique with no success. I got the C code to compile (after it introduced some bugs in the cut and paste process!).
>I replaced the StaticLinker.exe file with the new executable. I then created a .bat file that called vcvars32.bat and then the clean IDE.
>
>When I compiled my little toy example I got the following errors:
>LIBC.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in _startup0.o
>matrix.o : error LNK2001: unresolved external symbol _cblas_daxpy
>LIBC.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
The linker is trying to link against the C library. You probably don't
want to do this, try passing /NODEFAULTLIB to the linker to prevent this.
Or if you want to link against the C library, remove _startup0.0 from
the list of object files, and add a main function in c with a call
to clean_main().
>I also tried this using an MS VC static link library that provides a ccall stub into the DLL. Same results. I wonder if the inability to link against
>the library isn't a path issue? As far as the startup*.o symbol issues I have no idea. I'm using the Microsoft Visual C++ 2003 Toolkit., which can be
>a little weird whenever certain libraries such as debug libraries are linked in. I also tried collecting all the relevant .o libraries that you mentioned into a
>single file and tried to link them directly using link.exe. However they don't seem to be in the right format. (Is it supposed to be COFF?) I get this error:
>
>....\Clean System Files>link /out:matrix.exe _startup.o _startup1.o _startup2.o _system.o matrix.o atlas.lib
>Microsoft (R) Incremental Linker Version 7.10.3077
>Copyright (C) Microsoft Corporation. All rights reserved.
>
>_startup.o : fatal error LNK1136: invalid or corrupt file
The _startup.o file is not used on windows, use _startup0.o, _startup1.o
and _startup2.o instead. If there is a _startup.o file in the windows
version of Clean it is probably not a windows COFF object file.
>
>Should I try this with MS VC++ 6.0?
Maybe, with the linker from VC 6.0 I can link a Clean program.
Kind regards,
John van Groningen
More information about the clean-list
mailing list