help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interpreting Link errors


From: Thomas Matthews
Subject: Interpreting Link errors
Date: Wed, 26 Jan 2005 00:30:29 GMT
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Hi,

I need help in translating these error messages:
c:/menuplan/src/testing/libmp_test.a(test_ref_book.o)(.ctors+0x0): In function `_ZeqRK8wxStringS1_': c:/menuplan/src/common/mp_name_object.hpp: undefined reference to `__GLOBAL__I__Z13Test_Ref_BookR10wxTextFile' c:/menuplan/src/testing/libmp_test.a(test_ref_book.o)(.dtors+0x0):c:/menuplan/src/common/mp_name_object.hpp: undefined reference to `__GLOBAL__D__Z13Test_Ref_BookR10wxTextFile'
collect2: ld returned 1 exit status
make[1]: *** [c:/menuplan/bin/Menu_Planner.exe] Error 1
make: *** [all] Error 2

I have a global function:
bool
Test_Ref_Book(wxTextFile&   init_text_file)
{
/* ... */
}

This function is in a library, libmp_test.a:
$ nm libmp_test.a | grep Test_Ref_Book
00000640 b _ZZ13Test_Ref_BookR10wxTextFileE11book_author
00000600 b _ZZ13Test_Ref_BookR10wxTextFileE13book_category
00000650 b _ZZ13Test_Ref_BookR10wxTextFileE14book_publisher
00000620 b _ZZ13Test_Ref_BookR10wxTextFileE7book_id
00000610 b _ZZ13Test_Ref_BookR10wxTextFileE9bbq_title
00000660 b _ZZ13Test_Ref_BookR10wxTextFileE9book_isbn

***** What are the next two lines???? *******
         U __GLOBAL__D__Z13Test_Ref_BookR10wxTextFile
         U __GLOBAL__I__Z13Test_Ref_BookR10wxTextFile

0000031e T __Z13Test_Ref_BookR10wxTextFile
000005d0 b __ZGVZ13Test_Ref_BookR10wxTextFileE11book_author
000005a0 b __ZGVZ13Test_Ref_BookR10wxTextFileE13book_category
000005e0 b __ZGVZ13Test_Ref_BookR10wxTextFileE14book_publisher
000005c0 b __ZGVZ13Test_Ref_BookR10wxTextFileE7book_id
000005b0 b __ZGVZ13Test_Ref_BookR10wxTextFileE9bbq_title
000005f0 b __ZGVZ13Test_Ref_BookR10wxTextFileE9book_isbn

Using "nm --demangle":
$ nm --demangle libmp_test.a | grep Test_Ref_Book
00000640 b ZZ13Test_Ref_BookR10wxTextFileE11book_author
00000600 b ZZ13Test_Ref_BookR10wxTextFileE13book_category
00000650 b ZZ13Test_Ref_BookR10wxTextFileE14book_publisher
00000620 b ZZ13Test_Ref_BookR10wxTextFileE7book_id
00000610 b ZZ13Test_Ref_BookR10wxTextFileE9bbq_title
00000660 b ZZ13Test_Ref_BookR10wxTextFileE9book_isbn

***** Why do functions have global contstructors
***** and destructors?
         U global destructors keyed to _Z13Test_Ref_BookR10wxTextFile
         U global constructors keyed to _Z13Test_Ref_BookR10wxTextFile

0000031e T Test_Ref_Book(wxTextFile&)
000005d0 b guard variable for Test_Ref_Book(wxTextFile&)::book_author
000005a0 b guard variable for Test_Ref_Book(wxTextFile&)::book_category
000005e0 b guard variable for Test_Ref_Book(wxTextFile&)::book_publisher
000005c0 b guard variable for Test_Ref_Book(wxTextFile&)::book_id
000005b0 b guard variable for Test_Ref_Book(wxTextFile&)::bbq_title
000005f0 b guard variable for Test_Ref_Book(wxTextFile&)::book_isbn

I am using G++ on Cygwin:
$ g++ --version
g++ (GCC) 3.3.1 (cygming special)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I have included the library 3 times on the linker command line:
$ make 2> results.txt
g++ `wx-config --ldflags` \
-L c:/menuplan/src/common \
-L c:/menuplan/src/reference \
-L c:/menuplan/src/testing \
-L c:/menuplan/src/ui \
-o c:/menuplan/bin/Menu_Planner.exe \
c:/menuplan/src/ui/application.o   \
c:/menuplan/src/ui/ui_book_grid.o  \
c:/menuplan/src/ui/ui_book_table.o \
c:/menuplan/bin/Menu_Planner_resources.o         \
`wx-config --libs` \
C:/wxwindows/src/common/db.o \
C:/wxwindows/src/common/dbtable.o \
C:/wxwindows/src/common/variant.o \
-lodbc32 \
-lmp_common -lmp_ref -lmp_test -lmp_ui \
-lmp_common -lmp_ref -lmp_test -lmp_ui \
-lmp_common -lmp_ref -lmp_test -lmp_ui \
`wx-config --libs` -lstdc++

Any help is greatly appreciated.

--
Thomas Matthews

C++ newsgroup welcome message:
         http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq:   http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
         http://www.comeaucomputing.com/learn/faq/
Other sites:
    http://www.josuttis.com  -- C++ STL Library book
    http://www.sgi.com/tech/stl -- Standard Template Library


reply via email to

[Prev in Thread] Current Thread [Next in Thread]