Thanks for your response. I looked at the example file but I couldn't
understand how to use that directive in my Makefile.am. In the example that
you said, the directive is used liked this:

libnoxcore_la_LIBADD = -lpthread $(PCAP_LDFLAGS) $(SSL_LIBS)  -lcrypto
-lxerces-c

I didn't understand how to put the library I have into this directive. The
library have bunch header and source files.

The Makefile.am was initially like this:
include ../../../Make.vars

EXTRA_DIST =\
    meta.xml \
    __init__.py \
    pylearningswitch.py

if PY_ENABLED
AM_CPPFLAGS += $(PYTHON_CPPFLAGS)
endif # PY_ENABLED

pkglib_LTLIBRARIES =        \
    learningswitch.la

learningswitch_la_CPPFLAGS = $(AM_CPPFLAGS) -I $(top_srcdir)/src/nox -I
$(top_srcdir)/src/nox/coreapps/
learningswitch_la_SOURCES = learningswitch.cc
learningswitch_la_LDFLAGS = -module -export-dynamic

NOX_RUNTIMEFILES = meta.xml \
    __init__.py \
    pylearningswitch.py

all-local: nox-all-local
clean-local: nox-clean-local
install-exec-hook: nox-install-local

I changed it to:

include ../../../Make.vars

EXTRA_DIST =\
    meta.xml \
    __init__.py \
    pylearningswitch.py

if PY_ENABLED
AM_CPPFLAGS += $(PYTHON_CPPFLAGS)
endif # PY_ENABLED

pkglib_LTLIBRARIES =        \
    learningswitch.la


learningswitch_la_CPPFLAGS = -I $(top_srcdir)/src/nox/netapps -I
dsp-1.0/ll/include -I dsp-1.0/include $(AM_CPPFLAGS) -I
$(top_srcdir)/src/nox -I $(top_srcdir)/src/nox/coreapps/

learningswitch_la_SOURCES = dsp-1.0/src/CAPSP_C.c dsp-1.0/src/CDAPSP.c
dsp-1.0/src/CDAPSP_D.c dsp-1.0/src/CDAPSP_DE.c dsp-1.0/src/CDSSSP.c
dsp-1.0/src/CDSSSP_D.c dsp-1.0/src/CSSSP.c
dsp-1.0/ll/src/core/common/LArchiveFile.c
dsp-1.0/ll/src/core/common/LArray.c dsp-1.0/ll/src/core/common/LDataStore.c
dsp-1.0/ll/src/core/common/LDebug.c dsp-1.0/ll/src/core/common/LDiskStack.c
dsp-1.0/ll/src/core/common/LDSP.c dsp-1.0/ll/src/core/common/LDStar.c
dsp-1.0/ll/src/core/common/LEdgeInfo.c dsp-1.0/ll/src/core/common/LEdgeMap.c
dsp-1.0/ll/src/core/common/LException.c dsp-1.0/ll/src/core/common/LFile.c
dsp-1.0/ll/src/core/common/LGraph.c dsp-1.0/ll/src/core/common/LGraphGen.c
dsp-1.0/ll/src/core/common/LHash.c dsp-1.0/ll/src/core/common/LHeap.c
dsp-1.0/ll/src/core/common/LMemory.c dsp-1.0/ll/src/core/common/LNodeInfo.c
dsp-1.0/ll/src/core/common/LQueue.c dsp-1.0/ll/src/core/common/LRandSource.c
dsp-1.0/ll/src/core/common/LSP.c dsp-1.0/ll/src/core/common/LString.c
dsp-1.0/ll/src/core/common/LType.c dsp-1.0/ll/src/core/common/LXPBlock.c
learningswitch.cc

learningswitch_la_LDFLAGS = -module -export-dynamic

NOX_RUNTIMEFILES = meta.xml \
    __init__.py \
    pylearningswitch.py

all-local: nox-all-local
clean-local: nox-clean-local
install-exec-hook: nox-install-local


where I include everything in the library one by one. I would be happy if
you can describe me what to do here?

Thanks in advance,
berk


On Sat, Mar 7, 2009 at 6:22 AM, Teemu Koponen <[email protected]> wrote:

>
> On Mar 7, 2009, at 14:01 , Berk Atikoglu wrote:
>
>  I'm trying to link an external library to my application for the CS244
>> project. I tried to include the source files of the library in the
>> Makefile.am of the application. Even though it compiles, I get the following
>> run time error:
>>
>> Can't open a dynamic library:
>> 'nox/coreapps/learningswitch/learningswitch.so: cannot open shared object
>> file: No such file or directory' or
>> 'nox/coreapps/learningswitch/.libs/learningswitch.so: undefined symbol:
>> LFile_Close'
>>
>> How can I link an external library?
>>
>
> Using LIBADD directive you can define external libraries for the linker:
> libfoo_la_LIBADD = -lbar
>
> For a complete example, see src/lib/Makefile.am.
>
> Teemu
>
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to