C++ API under Linux wont compile

After some serious slog trying to get Domino to work in Linux, I am facing the final (maybe) hurdle in setting the system for some productive development work.

Before I get to a very practical issue I would just like to comment that without this site it would be impossible to get certain things done/fixed etc. So thanks to all the contributors (will do more of this myself).

Now… to my problem:

RedHat Fedora Core 1

Domino 6.5

C++ API 2.3

g++ 286 (or 3.x)

When attempting to compile any program using…

make -f linux.mak

I get this:

g++296 -L/opt/lotus/notescpp/lib/linux -o acllog acllog.o -L/opt/lotus/notes/latest/linux \

/opt/lotus/notescpp/lib/linux/libcpplin.so.23 -lnotes -lm -lnsl -lpthread -lc -ldl -lresolv

/usr/bin/ld: warning: libndgts.so, needed by /opt/lotus/notes/latest/linux/libnotes.so, not found (try using -rpath or -rpath-link)

acllog.o(.text+0x1b): In function `main’:

: undefined reference to `LNNotesSession::LNNotesSession()’

acllog.o(.text+0x27): In function `main’:

: undefined reference to `LNSetThrowAllErrorsGlobal(int)’

acllog.o(.text+0x51): In function `main’:

: undefined reference to `LNString::LNString()’

acllog.o(.text+0x5f): In function `main’:

: undefined reference to `LNDocument::LNDocument()’

acllog.o(.text+0x6d): In function `main’:

: undefined reference to `LNString::LNString()’

acllog.o(.text+0x7b): In function `main’:

Any ideas?

I have seen this document, but do not know how I can try it out as I have no access to such old version of Domino on UNIX…

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/120f1a542ab619dd85256e1d0040a0ec?OpenDocument

Thanks

Avi

Subject: C++ API under Linux wont compile

Avi,

Well Fedora isn’t a supported Domino platform, so you will have to put up with some pain to make it work.

Your program is compiling fine, but it is not linking. As the warning says, libndgts.so was not found so either that library is not on your system and you need to add it, or it is on your system but the settings in the make file do not specify correctly where it is and you will have to change them. So you will have to make changes to resolve whichever problem exists.

To state the obvious, it would be easier to start with a Lotus-supported Linux distribution.

Cheers, Ian

Subject: RE: C++ API under Linux wont compile

Ian,

Thanks for a quick response.

Yes, you are right, it is the linker. And you are right again, Fedora Core is not in the supported list but… that is not really an issue now. Just having a stuborn linking issue.

OK, location, location…

Here is my make file

========================

#===========================================================================

makefile for Notes C++ API sample linux version

TARGET = name of src, obj, and exe files

TARGET = acllog

#===========================================================================

set SOURCES to the list of C source files in this program

SOURCES = $(TARGET).cpp

allow the rules to work with .cpp files

.SUFFIXES: .c .cpp .s .o

set OBJECTS to the list of object files that must be linked

OBJECTS = $(SOURCES:.cpp=.o)

CPP defines the compiler. Set to “g++”

CPP = g++

LINK defines the linker. This is also set to “g++”

LINK = $(CPP)

Set CPPOPTS - the compiler options.

#CPPOPTS = -c -march=i486 -w -Os

You may use -g flag for debugging. (Optimization is off too)

CPPOPTS = -c -m486 -w -g

set NOTESDIR to specify where to search for the Notes library file

NOTESDIR = $(Notes_ExecDirectory)

set NOTESCPP to specify where to find the toolkit

set LNINCDIR to specify where to search for include files

set LNLIBDIR to specify where to search for library files

NOTESCPP = $(LOTUS)/notescpp

LNINCDIR = $(NOTESCPP)/include

LNLIBDIR = $(NOTESCPP)/lib/linux

Set LINKOPTS - the linker options passed when linking.

-o $(TARGET) causes compiler to create target rather than a.out

LINKOPTS = -L$(LNLIBDIR) -o $(TARGET)

Notes API header files require UNIX to be defined.

DEFINES = -DUNIX -DLINUX -DLINUX20 -DPTHREAD_KERNEL -D_REENTRANT \

      -DUSE_THREADSAFE_INTERFACES -D_POSIX_THREAD_SAFE_FUNCTIONS \

      -DHANDLE_IS_32BITS -DHAS_BOOL -DHAS_DLOPEN -DFUTUREUNIX1 \

      -DUSE_PTHREAD_INTERFACES -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE

Set name of the current release of the C++ API library

CPPAPI_ID = 23

LNLIBCPP = $(LNLIBDIR)/libcpplin.so.$(CPPAPI_ID)

set LIBS to list all the libraries we should link with.

LIBS = -lnotes -lm -lnsl -lpthread -lc -ldl -lresolv

#-lposix

#… Build the executable, which depends on the objects.

$(TARGET): $(OBJECTS)

$(LINK) $(LINKOPTS) $(OBJECTS) -L$(NOTESDIR) \

$(LNLIBCPP) $(LIBS)

#… Compile the objects, which depend on the source.

.cpp.o:

$(CPP) $(CPPOPTS) $(DEFINES) -I$(LNINCDIR) $(SOURCES)

===========================

And the paths set up on this machine in the .bash_profile:


Notes/Domino env vars, path was augmented above

LOTUS=/opt/lotus

NOTES_DATA_DIR=/local/notesdata

CPPAPI_ID=23

Notes_ExecDirectory=/opt/lotus/notes/latest/linux

LD_LIBRARY_PATH=/opt/lotus/notescpp/lib/linux

export LOTUS NOTES_DATA_DIR CPPAPI_ID Notes_ExecDirectory LD_LIBRARY_PATH


Domino install directories - not moved

notescpp has all expected dirs as standard

Any guesses what goes wrong here?

Thanks

Avi

Subject: RE: C++ API under Linux wont compile

Hi Avi,

According to this thread on OpenNTF the library you are missing came with Domino 651. I’m not sure if that is really the case, but you should check this discussion out:

http://www.openntf.org/Projects/pmt.nsf/66d9103768cc2fed85256c59006b5433/e14e97af2b8e116586256e5a005152a3!OpenDocument

cheers, Ian