I am trying to compile but get errors like:
Open Watcom Linker Version 1.2
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
searching libraries
Error! E2028: __STK is an undefined reference
Error! E2028: calloc_ is an undefined reference
Error! E2028: _assert_ is an undefined reference
Error! E2028: strcpy_ is an undefined reference
Error! E2028: strcat_ is an undefined reference
Error! E2028: malloc_ is an undefined reference
Error! E2028: fopen_ is an undefined reference
and many more.
--
Roberto Quiroga
> Where may I find the meaning of error E2028?
Why --- in the very same line of messate text you found "E2028" in,
of course:
> I am trying to compile but get errors like:
Not quite. What you're trying to do is to *link*, not to compile.
[...]
> Error! E2028: malloc_ is an undefined reference
> Error! E2028: fopen_ is an undefined reference
You forgot to show *how* you called the linker, which makes it
a bit hard to be specific. But it's quite obvious that however
you did it, was wrong: you didn't link in the C standard library.
Check your linker command line.
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Hans-Bernhard Broeker <bro...@physik.rwth-aachen.de> escribió:
> Roberto Quiroga <rqui...@fastmail.us> wrote:
>
>> Where may I find the meaning of error E2028?
>
> Why --- in the very same line of messate text you found "E2028" in,
> of course:
I can not find a reference for the compiler and linker errors.
>> I am trying to compile but get errors like:
>
> Not quite. What you're trying to do is to *link*, not to compile.
Yes, I am trying to compile and link using wcl, sorry, my problem is in
the linking phase, the compilation does not produce errors.
>
> [...]
>> Error! E2028: malloc_ is an undefined reference
>> Error! E2028: fopen_ is an undefined reference
>
> You forgot to show *how* you called the linker, which makes it
> a bit hard to be specific. But it's quite obvious that however
> you did it, was wrong: you didn't link in the C standard library.
compile line:
wcl *.c -ml -bt=dos
relevant variables:
WATCOM=d:\ow
INCLUDE=d:\ow\h
LIB=d:\ow\lib286\dos;d:\ow\lib286
d:\ow\binw is in PATH
I have the same problem compiling under DOS 6.22 and dosemu + freedos.
The program has 14 source files, the command works if I compile and link
a test program with one source file.
> Hasta pronto
Gracias y hasta pronto.
--
Roberto Quiroga
>Thanks for your answer.
>
>Hans-Bernhard Broeker <bro...@physik.rwth-aachen.de> escribió:
>
>> Roberto Quiroga <rqui...@fastmail.us> wrote:
>>
>>> Where may I find the meaning of error E2028?
>>
>> Why --- in the very same line of messate text you found "E2028" in,
>> of course:
>
>I can not find a reference for the compiler and linker errors.
Searching the master C index for 2028 will take you to the linker guide.
>>> Error! E2028: malloc_ is an undefined reference
>>> Error! E2028: fopen_ is an undefined reference
The linker cannot find malloc_ . This is a library reference of malloc for
32-bit code with the register calling convention. This is the default of
the 32-bit compilers. If you want 32-bit code you must link with the proper
386 libs (for register or stack calling convention, 'stack' is the
traditional 'C' calling convention), you also need a DOS extender. If you
want 16 bit code you must use the 16 bit compiler which is always 'stack' .
For 'stack' malloc would be _malloc for the linker (the underscore is in
front).
Mat Nieuwenhoven
> Open Watcom Linker Version 1.2
> Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
> Source code is available under the Sybase Open Watcom Public License.
> See http://www.openwatcom.org/ for details.
> loading object files
> searching libraries
> Error! E2028: __STK is an undefined reference
> Error! E2028: calloc_ is an undefined reference
> Error! E2028: _assert_ is an undefined reference
> Error! E2028: strcpy_ is an undefined reference
> Error! E2028: strcat_ is an undefined reference
> Error! E2028: malloc_ is an undefined reference
> Error! E2028: fopen_ is an undefined reference
>
My guess is that your code doesn't have main(), and therefore
default library search records won't be inserted in any object
file.
That is assuming that E2028 is the only kind of error you get.
Michal
YES!!!, do not have main(), it has Main().
Microsoft C 6.0a compiles whithout problems, but it is incorrect.
(Looking for a rock to hide under)
Many thanks!
Now I have another problem:
Open Watcom Linker Version 1.2
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
searching libraries
Error! E2020: size of group DGROUP exceeds 64k by 17520 bytes
Error: Linker returned a bad status
wcl *.c -ml -fe=prodol -k64000 -lr -zt32 -zm
But that belongs to another (future?) thread.
Muchas Gracias.
--
Roberto Quiroga
You could also try -zc (put strings in code) for a start. Examine the
mapfile and see where the data is going.
Carl
> "Roberto Quiroga" <nos...@example.net> wrote in message
> news:873c64t...@cube.internal.net...
> <snip>
>> Error! E2020: size of group DGROUP exceeds 64k by 17520 bytes
>> Error: Linker returned a bad status
>>
>> wcl *.c -ml -fe=prodol -k64000 -lr -zt32 -zm
>>
>
> You could also try -zc (put strings in code) for a start. Examine the
> mapfile and see where the data is going.
Thanks I will try, this is legacy code and I do not understand it fully
yet.
It already bites me with Main().
--
Roberto Quiroga
Jiri