On Mar 8, 2009, at 08:39 , Berk Atikoglu wrote:
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:
Sorry, I didn't realize you were trying to compile an external library
as a part of your application. Without seeing the source code, it
sounds like the problem could be in mixing C and C++ code into same
application (library).
It seems to me the easiest approach for you to solve this issue would
be to install this specific external library to somewhere into the
system, preferably to /usr or /usr/local, using its own installation
system ("make install"?). Once you have the library installed, you
can define in your NOX application makefile the application to link
against the library with the following line:
learningswitch_la_LIBADD = -llibraryname
However, if you didn't install the external library to a standard
location, you have to add some additional flags to help the compiler,
linker and the NOX runtime to find the headers and library files from
their non-standard locations:
1) learningswitch_la_CPPFLAGS needs an include flag for the directory
you have installed the library headers to. For example, add a flag: "-
I /foo/bar/include" if you installed the library header files to "/foo/
bar/include". If this is missing, your application won't compile
since it's not able to find the header files of the external library.
2) learningswitch_la_LDFLAGS needs a linker flag for the directory you
have installed the library (.so) files to. Appending "-L/foo/bar/lib"
to the flags tells the linker to look at the "/foo/bar/lib" while
linking.
3) Finally, before running your application, you may have to add the
library (.so) file location to the LD_LIBRARY_PATH environment
variable. Without this information NOX is unable to locate the
library while booting your application. For example, appending ":/
foo/bar/lib" to LD_LIBRARY_PATH would be enough to locate a library
file in /foo/bar/lib.
HTH,
Teemu
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org