On Wednesday 30 April 2008 17:05:03 Uğur Güney wrote:
> # I compiled with: g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE
> `fltk-config --cxxflags`
> # and made the .so file with: ld -E --shared ugur4.o -o ugur4.so
> # but get the same error: WARNING: could not open library
Note that you need -fPIC to build shared libraries.
I did this and succeeded:
% g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE `fltk-config --cxxflags` -fPIC
ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’
ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’
ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’
% g++ -shared -o ugur4.so ugur4.o `fltk-config --ldflags`
%
--
Felipe Sateler