[pgrouting-dev] Regarding the generation of .so file for a postgresql function

dave.potts at pinan.co.uk dave.potts at pinan.co.uk
Mon Oct 26 06:45:28 PDT 2015


Since this is a matter to do with the operating system, it might help if you stated what machine you where using, what operating systems , which version the compile your using etc.

D..


October 25 2015 7:37 AM, "Sankepally Rohith Reddy" <rohith.reddy at research.iiit.ac.in> wrote:
> Hello there,
> 
> I am working on one of my projects which requires the implementation of a function/query which uses
> data from a postgresql database. To do so I need to generate a "my_function.so" from
> "my_function.c",which uses cpp functions.I am facing a problem in linking "my_function.c" with the
> cpp files(where the cpp functions are defined) and generate a "my_function.so" which is used to
> create a postgresql function.
> 
> "my_cpp_header.h":-
> 
> #ifndef DIJKSTRA_FUNCTION_H_
> #define DIJKSTRA_FUNCTION_H_
> 
> #ifdef __cplusplus
> extern "C" {
> #endif
> 
> int compute_dijkstra(int source,int target,Edge *edges,int num_vertices,int num_edges,Edge **path);
> 
> #ifdef __cplusplus
> }
> #endif
> 
> #endif
> 
> "my_cpp_function.cpp":-
> 
> #include "my_cpp_header.h"
> 
> int compute_dijkstra(int source,int target,Edge *edges,int num_vertices,int num_edges,Edge **path)
> {
> definition of the function(in cpp)
> }
> 
> I need to generate "my_function.so" from "my_function.c" which uses the above function.
> 
> Please help me solving this.
> 
> Thanks in advance.
> 
> _______________________________________________
> pgrouting-dev mailing list
> pgrouting-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


More information about the pgrouting-dev mailing list