I am trying to embed mozilla in an application. I am starting by writing a simple example. Everything compiles fine, however I get the following link error. The source and makefile are below. Any help would be appreciated.

Error:

Main.o(.gnu.linkonce.d._ZTI14nsAFlatCString+0x8): undefined reference to `typeinfo for nsASingleFragmentCString'
collect2: ld returned 1 exit status
make: *** [htmlcontrol] Error 1
Main.cpp

#include <stdlib.h>

#include <nsEmbedAPI.h>
#include <nsDependentString.h>
#include <nsASingleFragmentString.h>
#include <nsAFlatString.h>

int main(int argc, char *argv[])
{
char *mozBinPath = nsnull; nsCOMPtr<nsILocalFile> binDir;
nsresult result = NS_NewNativeLocalFile(nsDependentCString(mozBinPath), PR_TRUE, getter_AddRefs(binDir));

return EXIT_SUCCESS;
}
Makefile

# Compiler Settings
CC = /usr/bin/c++
CFLAGS = -g  -Wno-deprecated
LDFLAGS =

# Include Paths
INCLUDES1 = -I/home/ihutchinson/workspace/xvt/mozilla/dist/sdk/idl \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/nspr \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/string \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/xpcom \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/embed_base \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/embedcomponents \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/widget \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/webbrwsr \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/docshell \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/uriloader \
			-I.

INCLUDES2 = -I/home/ihutchinson/workspace/xvt/mozilla/dist/include/necko \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/dom \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/profile \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/gfx \
			-I/home/ihutchinson/workspace/xvt/mozilla/dist/include/shistory
	
INCLUDES = $(INCLUDES1) $(INCLUDES2)
			
# Library paths
LIBS = -L/home/ihutchinson/workspace/xvt/dsc_xm-0500-Linux/samples/ptk/htmlcontrol -L/home/ihutchinson/workspace/xvt/mozilla/dist/lib \
			-L/home/ihutchinson/workspace/xvt/mozilla/dist/lib/components -lm -lxpcom
			
# Objects
OBJS = Main.o

# Targets

TARGETS = htmlcontrol

all:	$(TARGETS)
			
Main.o:	Main.cpp
		$(CC) -c $(INCLUDES) Main.cpp
			
htmlcontrol: $(OBJS)
		$(CC) $(CFLAGS) -o htmlcontrol $(OBJS) $(LIBS)
	
clean:
		-rm $(OBJS)
		-rm $(TARGETS)

Reply via email to