help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

linking at run time problem


From: g-h-d
Subject: linking at run time problem
Date: Tue, 1 May 2007 15:56:58 -0700 (PDT)

hi,

i'm basically testing the library hal
(http://tharkad.pa.msu.edu/~asteiner/hal/html/index.html) with a small
program under a Managed Make C++ project with the Eclipse IDE:

***main.cpp:
#include <iostream>
#include <hal/ovector_tlate.h>
int main (void)
{
const size_t n=10;
hal::ovector x(n);
if (x.size()==0) std::cout << "Failed." << std::endl;
return 0;
}

***make attemp #1
make -k all Building target: testing_hal
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o"testing_hal"  ./main.o   /main.o: In function
`hal::set_err_fn(char const*, char const*, int, int)':
/usr/local/include/hal/err_hnd.h:257: undefined reference to `hal::err_hnd'
/usr/local/include/hal/err_hnd.h:257: undefined reference to
`hal::err_class::set(char const*, char const*, int, int)'
collect2: ld returned 1 exit status
make: *** [testing_hal] Error 1
make: Target `all' not remade because of errors.
Build complete for project testing_hal

***make attempt #2
make -k all Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/include/hal -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
-MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
../main.cpp:15:2: warning: no newline at end of file
Finished building: ../main.cpp
 Building target: testing_hal
Invoking: GCC C++ Linker
g++ -L/usr/local/lib -o"testing_hal"  ./main.o   -lhal_base
Finished building target: testing_hal
 Build complete for project testing_hal

Runtime error:
/Debug/testing_hal: error while loading shared libraries: libhal_base.so.0:
cannot open shared object file: No such file or directory

Attempt #2 compiles but not #1, so i deduce that adding -lhal_base is
probably a good idea, but i still have a runtime error. The incriminated
file libhal_base.so.0 does reside in the specified library specified by -L
i.e. /usr/local/lib. Any explanation with the subtleties of linking and/or
perhaps suggestion for my particular problem would be appreciated. Thanks!
-- 
View this message in context: 
http://www.nabble.com/linking-at-run-time-problem-tf3677750.html#a10277485
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]