public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: C++ Link Errors
@ 2002-01-04 10:31 Parker, Ron
  0 siblings, 0 replies; 5+ messages in thread
From: Parker, Ron @ 2002-01-04 10:31 UTC (permalink / raw)
  To: Gerrit P. Haase @ cygwin

Solution found.  

I had built and installed various alternate versions of gcc into /usr/local.
Despite the fact that I placed /usr/local/bin after /usr/bin in my path so
that I would get the default cygwin gcc for this project, /usr/bin/gcc was
still passing -L/usr/local/lib before -L/usr/lib when it called collect2.

My first solution was to mv away /usr/local/lib/libstdc++.a.  I realize this
is not a longterm solution, but it's a start.

I will try rebuilding my gcc 3.0.3 into /usr and then attempt to use the "-V
2.95.3-5" argument to gcc when I need standard cygwin gcc.

I hope this helps anyone with a similar problem in the future.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: C++ Link Errors
@ 2002-01-04  9:51 Parker, Ron
  0 siblings, 0 replies; 5+ messages in thread
From: Parker, Ron @ 2002-01-04  9:51 UTC (permalink / raw)
  To: Gerrit P. Haase @ cygwin

> > g++ -Wl,--enable-auto-import -ftemplate-depth-99 -O2 -o uml.exe
> [...]
> > After a number of auto-import warnings, which I expect, like:
> > Warning: resolving QString::shared_null   by linking to
> > __imp___7QString$shared_null (auto-import)
> 
> > I receive a series of messages, which I don't expect, like:
> > umlview.o(.text+0x34f5):umlview.cpp: undefined reference to `cerr'
> > umlview.o(.text+0x34fa):umlview.cpp: undefined reference to
> > `ostream::_ls(char const *)'
> > umlview.o(.text+0x3506):umlview.cpp: undefined reference to 
> `endl(ostream &)
> > '
> 
> > Any ideas?
> 
> cerr et al. are in libstdc++.a
> 
> Add libstdc++.a to the link line.  Libtool uses gcc to link not g++,
> i guess it is a bug in libtool, though if you use g++ like shown above
> libstdc++ should be linked in automatically.

The libtool I have does use g++ and it is being linked with libstdc++.a. I
even added a spare -lstdc++ to the end of the g++ command, but the error
remains. It may be worth mentioning that the error is seen during the
collect2 phase.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: C++ Link Errors
  2002-01-03  9:51 Parker, Ron
@ 2002-01-04  9:22 ` Gerrit P. Haase
  0 siblings, 0 replies; 5+ messages in thread
From: Gerrit P. Haase @ 2002-01-04  9:22 UTC (permalink / raw)
  To: Parker, Ron; +Cc: cygwin

Hallo Ron,

Am 2002-01-03 um 18:51 schriebst du:

> I am trying to build the Linux UML modeler with cygwin. Everything works
> until I link. Libtool tries adding -ldl to the g++ linking call.  If I enter
> g++ command by hand without the -ldl everything is fine, except I get a
> number of C++ related linking errors.

> My command line is:

> g++ -Wl,--enable-auto-import -ftemplate-depth-99 -O2 -o uml.exe
[...]
> After a number of auto-import warnings, which I expect, like:
> Warning: resolving QString::shared_null   by linking to
> __imp___7QString$shared_null (auto-import)

> I receive a series of messages, which I don't expect, like:
> umlview.o(.text+0x34f5):umlview.cpp: undefined reference to `cerr'
> umlview.o(.text+0x34fa):umlview.cpp: undefined reference to
> `ostream::_ls(char const *)'
> umlview.o(.text+0x3506):umlview.cpp: undefined reference to `endl(ostream &)
> '

> Any ideas?

cerr et al. are in libstdc++.a

Add libstdc++.a to the link line.  Libtool uses gcc to link not g++,
i guess it is a bug in libtool, though if you use g++ like shown above
libstdc++ should be linked in automatically.

Gerrit
-- 
=^..^=                                        mailto:gp@familiehaase.de


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: C++ Link Errors
       [not found] <E94FF01DFF6CD31186F4080009DC361503F83DF3@nttwr2.tower.bldg s.butlermfg.org>
@ 2002-01-03 18:52 ` Mike Fahlbusch
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Fahlbusch @ 2002-01-03 18:52 UTC (permalink / raw)
  To: cygwin

At 11:51 AM 1/3/02 -0600, you wrote:

>I am trying to build the Linux UML modeler with cygwin. Everything works
>until I link. Libtool tries adding -ldl to the g++ linking call.  If I enter
>g++ command by hand without the -ldl everything is fine, except I get a
>number of C++ related linking errors.
>
>My command line is:
>
>g++ -Wl,--enable-auto-import -ftemplate-depth-99 -O2 -o uml.exe
>messagecopy.o widgetassoccontainer.o assoccopy.o cutcopypaste.o
>diagramprintpage.o classoptionspage.o worktoolbar.o usecasewidget.o
>usecase.o umlwidget.o umlview.o umlobject.o umldoc.o uml_meta_unload.o uml.o
>selectopdlg.o parmpropdlg.o operation.o objectwidget.o notewidget.o
>notemultilineedit.o mylistviewitem.o mylistview.o messagewidget.o main.o
>listpopupmenu.o infowidget.o floatingtext.o conceptwidget.o concept.o
>classpropdlg.o classopspage.o classgenpage.o classattpage.o attribute.o
>assocpropdlg.o assocpage.o association.o actorwidget.o actor.o
>assocpage.moc.o classgenpage.moc.o umlview.moc.o umlobject.moc.o
>worktoolbar.moc.o mylistview.moc.o uml.moc.o classpropdlg.moc.o
>operation.moc.o umldoc.moc.o umlwidget.moc.o classattpage.moc.o
>classoptionspage.moc.o diagramprintpage.moc.o association.moc.o
>classopspage.moc.o messagewidget.moc.o selectopdlg.moc.o uml_meta_unload.o
>-L/usr/X11R6/lib -L/usr/local/lib/qt2/lib -L/opt/kde2/lib
>/opt/kde2/lib/libkhtml.dll.a /opt/kde2/lib/libkjava.dll.a
>/opt/kde2/lib/libkdeprint.dll.a /opt/kde2/lib/libkparts.dll.a
>/opt/kde2/lib/libkfile.dll.a /opt/kde2/lib/libksycoca.dll.a
>/opt/kde2/lib/libkio.dll.a /opt/kde2/lib/libkdesu.dll.a -lutil
>/opt/kde2/lib/libkssl.dll.a /opt/kde2/lib/libkdeui.dll.a
>/opt/kde2/lib/libkdecore.dll.a /opt/kde2/lib/libltdl.dll.a
>/opt/kde2/lib/libDCOP.dll.a /opt/kde2/lib/libkICE.dll.a -lipc -lSM -lICE
>/usr/local/lib/libstdc++.a /usr/lib/libpcre.dll.a
>/usr/lib/libpcreposix.dll.a -lqt -lpng -lz -ljpeg -lXext -lX11 -Wl,--rpath
>-Wl,/opt/kde2/lib -Wl,--rpath -Wl,/opt/kde2/lib -Wl,--rpath
>-Wl,/usr/local/lib/qt2/lib -Wl,--rpath -Wl,/usr/X11R6/lib
>
>After a number of auto-import warnings, which I expect, like:
>Warning: resolving QString::shared_null   by linking to
>__imp___7QString$shared_null (auto-import)
>
>I receive a series of messages, which I don't expect, like:
>umlview.o(.text+0x34f5):umlview.cpp: undefined reference to `cerr'
>umlview.o(.text+0x34fa):umlview.cpp: undefined reference to
>`ostream::_ls(char const *)'
>umlview.o(.text+0x3506):umlview.cpp: undefined reference to `endl(ostream &)
>'

Some general things I have found helpful:
- have you deleted all of your .o and .a files and done a full build?
- are the library files -l in order of highest level lib first?  Then the 
first lib uses calls from the next lib on the command line etc.  Have you 
tried putting the -l parameters twice in the command line and see if that 
makes a difference.
If you don't have any other ideas:
- completely uninstall cygwin, delete the cygwin folder and any cygwin1.dll 
files on the system, update your cygwin setup files, reboot and re-install.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* C++ Link Errors
@ 2002-01-03  9:51 Parker, Ron
  2002-01-04  9:22 ` Gerrit P. Haase
  0 siblings, 1 reply; 5+ messages in thread
From: Parker, Ron @ 2002-01-03  9:51 UTC (permalink / raw)
  To: cygwin

I am trying to build the Linux UML modeler with cygwin. Everything works
until I link. Libtool tries adding -ldl to the g++ linking call.  If I enter
g++ command by hand without the -ldl everything is fine, except I get a
number of C++ related linking errors.

My command line is:

g++ -Wl,--enable-auto-import -ftemplate-depth-99 -O2 -o uml.exe
messagecopy.o widgetassoccontainer.o assoccopy.o cutcopypaste.o
diagramprintpage.o classoptionspage.o worktoolbar.o usecasewidget.o
usecase.o umlwidget.o umlview.o umlobject.o umldoc.o uml_meta_unload.o uml.o
selectopdlg.o parmpropdlg.o operation.o objectwidget.o notewidget.o
notemultilineedit.o mylistviewitem.o mylistview.o messagewidget.o main.o
listpopupmenu.o infowidget.o floatingtext.o conceptwidget.o concept.o
classpropdlg.o classopspage.o classgenpage.o classattpage.o attribute.o
assocpropdlg.o assocpage.o association.o actorwidget.o actor.o
assocpage.moc.o classgenpage.moc.o umlview.moc.o umlobject.moc.o
worktoolbar.moc.o mylistview.moc.o uml.moc.o classpropdlg.moc.o
operation.moc.o umldoc.moc.o umlwidget.moc.o classattpage.moc.o
classoptionspage.moc.o diagramprintpage.moc.o association.moc.o
classopspage.moc.o messagewidget.moc.o selectopdlg.moc.o uml_meta_unload.o
-L/usr/X11R6/lib -L/usr/local/lib/qt2/lib -L/opt/kde2/lib
/opt/kde2/lib/libkhtml.dll.a /opt/kde2/lib/libkjava.dll.a
/opt/kde2/lib/libkdeprint.dll.a /opt/kde2/lib/libkparts.dll.a
/opt/kde2/lib/libkfile.dll.a /opt/kde2/lib/libksycoca.dll.a
/opt/kde2/lib/libkio.dll.a /opt/kde2/lib/libkdesu.dll.a -lutil
/opt/kde2/lib/libkssl.dll.a /opt/kde2/lib/libkdeui.dll.a
/opt/kde2/lib/libkdecore.dll.a /opt/kde2/lib/libltdl.dll.a
/opt/kde2/lib/libDCOP.dll.a /opt/kde2/lib/libkICE.dll.a -lipc -lSM -lICE
/usr/local/lib/libstdc++.a /usr/lib/libpcre.dll.a
/usr/lib/libpcreposix.dll.a -lqt -lpng -lz -ljpeg -lXext -lX11 -Wl,--rpath
-Wl,/opt/kde2/lib -Wl,--rpath -Wl,/opt/kde2/lib -Wl,--rpath
-Wl,/usr/local/lib/qt2/lib -Wl,--rpath -Wl,/usr/X11R6/lib

After a number of auto-import warnings, which I expect, like:
Warning: resolving QString::shared_null   by linking to
__imp___7QString$shared_null (auto-import)

I receive a series of messages, which I don't expect, like:
umlview.o(.text+0x34f5):umlview.cpp: undefined reference to `cerr'
umlview.o(.text+0x34fa):umlview.cpp: undefined reference to
`ostream::_ls(char const *)'
umlview.o(.text+0x3506):umlview.cpp: undefined reference to `endl(ostream &)
'

Any ideas?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-01-04 18:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-04 10:31 C++ Link Errors Parker, Ron
  -- strict thread matches above, loose matches on Subject: below --
2002-01-04  9:51 Parker, Ron
     [not found] <E94FF01DFF6CD31186F4080009DC361503F83DF3@nttwr2.tower.bldg s.butlermfg.org>
2002-01-03 18:52 ` Mike Fahlbusch
2002-01-03  9:51 Parker, Ron
2002-01-04  9:22 ` Gerrit P. Haase

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).