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

Sankepally Rohith Reddy rohith.reddy at research.iiit.ac.in
Sun Oct 25 00:29:24 PDT 2015


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.

 


More information about the pgrouting-dev mailing list