Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

E2028 while linking

653 views
Skip to first unread message

Roberto Quiroga

unread,
May 13, 2004, 11:50:33 AM5/13/04
to

Where may I find the meaning of error E2028?

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

Hans-Bernhard Broeker

unread,
May 13, 2004, 1:11:47 PM5/13/04
to
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 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.

Roberto Quiroga

unread,
May 13, 2004, 3:19:08 PM5/13/04
to
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.

>> 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

Mat Nieuwenhoven

unread,
May 13, 2004, 3:55:57 PM5/13/04
to
On Thu, 13 May 2004 16:19:08 -0300, Roberto Quiroga wrote:

>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


Michal Necasek

unread,
May 13, 2004, 4:24:16 PM5/13/04
to
Roberto Quiroga wrote:

> 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

Roberto Quiroga

unread,
May 13, 2004, 5:24:24 PM5/13/04
to
Michal Necasek <mic...@scitechsoft.com> escribió:

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

Carl Young

unread,
May 14, 2004, 4:18:51 AM5/14/04
to

"Roberto Quiroga" <nos...@example.net> wrote in message
news:873c64t...@cube.internal.net...
<snip>

> 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
>

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

unread,
May 14, 2004, 6:57:33 AM5/14/04
to
"Carl Young" <carl....@keycomm.co.uk> escribió:

> "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 Malak

unread,
May 14, 2004, 11:58:34 AM5/14/04
to

"Roberto Quiroga" <nos...@example.net> wrote in message
news:87ad0bi...@cube.internal.net...
Option -k64000 is wrong. Why you need this big stack?
Fo your program can not excced 46000. Try -k32000.
Stack is in DGROUP for large model.
May be huge model use STACK segment outside DGROUP.

Jiri


0 new messages