Hi,

I'm looking for a little help building a native extension. I'm getting the 
following 'undefined reference' errors when linking on a Linux 64bit platform 
(not tried others yet):

Executing: c++ -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type 
-Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wcast-align 
-fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections 
-fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DDEBUG -D_DEBUG 
-DTRACING -g -fno-omit-frame-pointer -fPIC -shared -Wl,-z,defs 
-Wl,--gc-sections -Wl,-h,libccnx_prot.so -o libccnx_prot.so 
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/tmpMkBkPL.list 
-lpthread -Wl,-z,noexecstack -Wl,--build-id 
-Wl,-rpath-link,/var/tmp/simon-central/obj-x86_64-linux-gnu/dist/bin 
-Wl,-rpath-link,/usr/lib -L/var/tmp/simon-central/obj-x86_64-linux-gnu/dist/bin 
-lxul -lmozalloc -L/var/tmp/simon-central/obj-x86_64-linux-gnu/dist/bin 
-L/var/tmp/simon-central/obj-x86_64-linux-gnu/dist/lib -lnspr4 -lplc4 -lplds4 
-L/var/tmp/simon-central/obj-x86_64-linux-gnu/dist/lib -lnspr4 -lplc4 -lplds4 
-lccn -Wl,-Bsymbolic -ldl
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/tmpMkBkPL.list:
    INPUT("CcnHandler.o")

CcnHandler.o: In function `nsCString_external::get() const':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/nsStringAPI.h:879:
 undefined reference to `nsACString::BeginReading() const'
CcnHandler.o: In function `ReentrantMonitor':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/mozilla/ReentrantMonitor.h:43:
 undefined reference to 
`mozilla::BlockingResourceBase::BlockingResourceBase(char const*, 
mozilla::BlockingResourceBase::BlockingResourceType)'
CcnHandler.o: In function `~ReentrantMonitor':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/mozilla/ReentrantMonitor.h:56:
 undefined reference to `mozilla::BlockingResourceBase::~BlockingResourceBase()'
CcnHandler.o: In function `ReentrantMonitorAutoEnter':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/mozilla/ReentrantMonitor.h:182:
 undefined reference to `mozilla::ReentrantMonitor::Enter()'
CcnHandler.o: In function `~ReentrantMonitorAutoEnter':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/mozilla/ReentrantMonitor.h:187:
 undefined reference to `mozilla::ReentrantMonitor::Exit()'
CcnHandler.o: In function `nsCreateInstanceByContractID':
/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn/../../dist/include/nsComponentManagerUtils.h:64:
 undefined reference to `vtable for nsCreateInstanceByContractID'
/usr/bin/ld.bfd.real: CcnHandler.o: relocation R_X86_64_PC32 against undefined 
hidden symbol `vtable for nsCreateInstanceByContractID' can not be used when 
making a shared object
/usr/bin/ld.bfd.real: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libccnx_prot.so] Error 1
make[1]: Leaving directory 
`/var/tmp/simon-central/obj-x86_64-linux-gnu/extensions/ccn'
make: *** [default] Error 2


My Makefile.in is:

DEPTH     = @DEPTH@
topsrcdir = @top_srcdir@
srcdir    = @srcdir@
VPATH     = @srcdir@

include $(DEPTH)/config/autoconf.mk

XPI_NAME = ccnx

INSTALL_EXTENSION_ID = c...@ccnx.org
DIST_FILES = install.rdf

XPI_PKGNAME            = ccnx-$(MOZ_APP_VERSION)

LIBRARY_NAME    = ccnx_prot
USE_STATIC_LIBS = 1
IS_COMPONENT = 1

EXTRA_DSO_LDOPTS = \
        $(MOZ_COMPONENT_LIBS) \
        $(NSPR_LIBS) \
        $(XPCOM_LIBS) \
        -lccn

include $(topsrcdir)/config/rules.mk

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to