On Friday, June 21, 2013 9:44:04 PM UTC-7, c b wrote:
>
>
> I got a libpyledger.so, but upon doing an import libpyledger in python, I 
> get the following error
>
> ImportError: ./libpyledger.so: undefined symbol: __gmpq_add
>
> Any ideas about this? I have absolutely no idea about this since I'm not a 
> C++ programmer.
>
> Thanks,
> cb
>
> That's a promising development.  I'm surprised that simply changing the 
name in the BOOST_PYTHON_MODULE macro had this effect.

__gmpq_add is  one of the functions from the GMP library (one of ledger's 
dependencies), so it looks like this library did not get linked into 
libpyledger.so.  Unfortunately, that's actually a CMake issue, not a C++ 
issue, and CMake is almost a complete mystery to me.  Nevertheless, I'll 
risk saying something ignorant in the hopes it might help you along.

In the top-level CMakeLists.txt, it defines a macro named 
add_ledger_library_dependencies, and you can see it adding MPFR_LIB and 
GMP_LIB dependencies to the passed-in target.  This macro is used in 
src/CMakeLists.txt to set "ledger" as the target that these dependencies 
are added to.

So, I think you need to use similar directives to add the same dependencies 
to your python module library.  In src/CMakeLists.txt, after you use 
add_library to create a pyledger library, I think you should try 

   target_link_libraries(pyledger, ${MPFR_LIB}
   target_link_libraries(pyledger, ${GMP_LIB}

Tim Crews

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to