|
|
.text: undefined reference to
Hi,
first of all thanks a bunch for a cool compiler!
I have a problem when linking with lcclnk. I receive a bunch of
messages that tell me that references could not be resolved
(... .text: undefined reference to ...).
I found a number of posts on this topic at various newsgroups but no
real good ideas what the problems might be and how to resolve them. In
my case I have a running installation of lcc on my old machine (XP)
with the same project and it compiles and links fine. On my new
machine (Windows 7) I am getting this problem, using the same make
file and sources. Eventually I found a post on this newsgroup from
2004 that describes that the libraries are not built properly when lcc
is installed and that a number of references are simply not in the
libraries. I found the exact same thing is happening here. I installed
lcc three time and I have the same problem each time.
After copying the lcc libraries from my old machine to the new
installation the linker is happy!
I am not sure what is going on or how someone with this problem but no
other set of libraries to fall back on would deal with the situation.
In any case there must be some problem with the library builder that
has been around for a long time as there seems to be a fair number of
people experienceing the probem.
BTW, I am using version 3.8 with a build date of Jan 29 2011.
|
|
0
|
|
|
|
Reply
|
techie_59
|
2/25/2011 1:49:07 AM |
|
Le 25/02/11 02:49, techie_59@yahoo.com a �crit :
> Hi,
>
> first of all thanks a bunch for a cool compiler!
>
> I have a problem when linking with lcclnk. I receive a bunch of
> messages that tell me that references could not be resolved
> (... .text: undefined reference to ...).
>
> I found a number of posts on this topic at various newsgroups but no
> real good ideas what the problems might be and how to resolve them. In
> my case I have a running installation of lcc on my old machine (XP)
> with the same project and it compiles and links fine. On my new
> machine (Windows 7) I am getting this problem, using the same make
> file and sources. Eventually I found a post on this newsgroup from
> 2004 that describes that the libraries are not built properly when lcc
> is installed and that a number of references are simply not in the
> libraries. I found the exact same thing is happening here. I installed
> lcc three time and I have the same problem each time.
>
> After copying the lcc libraries from my old machine to the new
> installation the linker is happy!
>
> I am not sure what is going on or how someone with this problem but no
> other set of libraries to fall back on would deal with the situation.
> In any case there must be some problem with the library builder that
> has been around for a long time as there seems to be a fair number of
> people experienceing the probem.
>
> BTW, I am using version 3.8 with a build date of Jan 29 2011.
(1) It would be interesting if you told us
"undefined reference to" well, to WHAT?
|
|
0
|
|
|
|
Reply
|
jacob
|
2/25/2011 10:55:48 AM
|
|
> (1) It would be interesting if you told us
>
> "undefined reference to" well, to WHAT?- Hide quoted text -
>
> - Show quoted text -
Well, that would be pretty random. Whatever functions happen to be
missing in the library files that are used in the compiled code. In my
case it was _LoadLibraryA and _FreeLibraryA. In addition a couple of
functions in lcccrt0.obj were missing. One of them was
'_RtlUnwind@16', the other one I don't remember. The other post says
that the situation tends to change every time the library files are
generated (the topic of that post is: linker error: undefined
reference to '_RtlUnwind@16').
I did a text search for those functions both in the *.exp files and in
the *.lib files. Just as the other post says they where all present in
the *.exp files but missing in the libraries. I guess the implication
is, that if an application links it is no guarantee that the libraries
are actually ok. One might simply not be using functions that are
missing in the libraries.
Of course this is all wiped out on my machine now, but I presume it
would be no difficulty to install lcc and have it happen again. If you
would like the library files for examination, let me know. I'll do
another installation and put the files on an FTP server for download.
|
|
0
|
|
|
|
Reply
|
techie_59
|
2/25/2011 3:42:41 PM
|
|
Sure enough. I did another install and now I get a completely
different set of references missing:
....\lcc\lib\libcrt0.obj .text: undefined reference to '_raise'
....\lcc\lib\libcrt0.obj .text: undefined reference to
'_open_osfhandle'
....\lcc\lib\libcrt0.obj .text: undefined reference to '_setbuf'
....\lcc\lib\libcrt0.obj .text: undefined reference to '_malloc'
asctoq.obj .text: undefined reference to '_strnicmp'
powlasm.obj .text: undefined reference to '_pow'
qfloat.obj .text: undefined reference to '_memset'
qfloat.obj .text: undefined reference to '_strchr'
qfloat.obj .text: undefined reference to '_memmove'
qfloat.obj .text: undefined reference to '_strcat'
qfloat.obj .text: undefined reference to '_itoa'
strlcpy.obj .text: undefined reference to '_memcpy'
xprintf.obj .text: undefined reference to '_localeconv'
xprintf.obj .text: undefined reference to '_strtol'
xprintf.obj .text: undefined reference to '_wcslen'
xprintf.obj .text: undefined reference to '_wctomb'
xprintf.obj .text: undefined reference to '_fputc'
xprintf.obj .text: undefined reference to '__imp___iob'
|
|
0
|
|
|
|
Reply
|
techie_59
|
2/25/2011 4:09:34 PM
|
|
Le 25/02/11 17:09, techie_59@yahoo.com a �crit :
> Sure enough. I did another install and now I get a completely
> different set of references missing:
>
> ...\lcc\lib\libcrt0.obj .text: undefined reference to '_raise'
> ...\lcc\lib\libcrt0.obj .text: undefined reference to
> '_open_osfhandle'
> ...\lcc\lib\libcrt0.obj .text: undefined reference to '_setbuf'
> ...\lcc\lib\libcrt0.obj .text: undefined reference to '_malloc'
> asctoq.obj .text: undefined reference to '_strnicmp'
> powlasm.obj .text: undefined reference to '_pow'
> qfloat.obj .text: undefined reference to '_memset'
> qfloat.obj .text: undefined reference to '_strchr'
> qfloat.obj .text: undefined reference to '_memmove'
> qfloat.obj .text: undefined reference to '_strcat'
> qfloat.obj .text: undefined reference to '_itoa'
> strlcpy.obj .text: undefined reference to '_memcpy'
> xprintf.obj .text: undefined reference to '_localeconv'
> xprintf.obj .text: undefined reference to '_strtol'
> xprintf.obj .text: undefined reference to '_wcslen'
> xprintf.obj .text: undefined reference to '_wctomb'
> xprintf.obj .text: undefined reference to '_fputc'
> xprintf.obj .text: undefined reference to '__imp___iob'
The libraries are wrong. Look in lcc\lib:
Do you have kernel32.lib in there? What is its size?
What is the size of libc.lib?
Did the installation of the libraries go OK?
Or there was an error?
jacob
|
|
0
|
|
|
|
Reply
|
jacob
|
2/25/2011 10:37:42 PM
|
|
Le 25/02/11 02:49, techie_59@yahoo.com a �crit :
> Hi,
>
> first of all thanks a bunch for a cool compiler!
>
> I have a problem when linking with lcclnk. I receive a bunch of
> messages that tell me that references could not be resolved
> (... .text: undefined reference to ...).
>
> I found a number of posts on this topic at various newsgroups but no
> real good ideas what the problems might be and how to resolve them. In
> my case I have a running installation of lcc on my old machine (XP)
> with the same project and it compiles and links fine. On my new
> machine (Windows 7) I am getting this problem, using the same make
> file and sources. Eventually I found a post on this newsgroup from
> 2004 that describes that the libraries are not built properly when lcc
> is installed and that a number of references are simply not in the
> libraries. I found the exact same thing is happening here. I installed
> lcc three time and I have the same problem each time.
>
> After copying the lcc libraries from my old machine to the new
> installation the linker is happy!
>
> I am not sure what is going on or how someone with this problem but no
> other set of libraries to fall back on would deal with the situation.
> In any case there must be some problem with the library builder that
> has been around for a long time as there seems to be a fair number of
> people experienceing the probem.
>
> BTW, I am using version 3.8 with a build date of Jan 29 2011.
What happened?
Did you correct that problem?
|
|
0
|
|
|
|
Reply
|
jacob
|
2/28/2011 11:06:32 AM
|
|
Jacob,
I guess we are in different time zones. I am at the US west coast.
Yes, kernel32.lib is present. The size is 523892. If you contact me
directly with your personal e-mail address, I can give you an FTP site
to download my generated library files for closer examination.
|
|
0
|
|
|
|
Reply
|
techie_59
|
2/28/2011 9:48:37 PM
|
|
On Feb 28, 10:48=A0pm, techie...@yahoo.com wrote:
> Jacob,
>
> I guess we are in different time zones. I am at the US west coast.
> Yes, kernel32.lib is present. The size is 523892. If you contact me
> directly with your personal e-mail address, I can give you an FTP site
> to download my generated library files for closer examination.
I had the same issue and also found the old post from 2004. I had the
same symptoms ( similar errors when building the libs from the cmd
line ).
It was due to "Microsoft Security Essentials" on my computer. I went
to settings and excluded C:\lcc and reinstalled lcc. Libs are then
build correctly.
|
|
0
|
|
|
|
Reply
|
mewn
|
3/4/2011 12:59:35 PM
|
|
Thanks a bunch mewn, that was it!
|
|
0
|
|
|
|
Reply
|
techie_59
|
3/9/2011 6:18:23 PM
|
|
|
8 Replies
845 Views
(page loaded in 0.274 seconds)
|
|
|
|
|
|
|
|
|