Undefined reference to `NvBufSurfaceMap'

Hi,guys,I am trying to compile the deepstream_app sample codes,it occurs the errors:

  • /usr/bin/ld: deepstream_app.o: in function `gie_processing_done_buf_prob’:
  • deepstream_app.c:(.text+0x172c): undefined reference to `NvBufSurfaceMap’
  • /usr/bin/ld: deepstream_app.c:(.text+0x173c): undefined reference to `NvBufSurfaceSyncForCpu’
  • collect2: error: ld returned 1 exit status
  • make: *** [Makefile:77:deepstream-apptest] error 1
  • 
    

I am sure I have declare the #include "nvbufsurface.h" in the healder file :deepstream_app.h
Besides,the folder is:
image
And the code snippet:

static GstPadProbeReturn
gie_processing_done_buf_prob (GstPad * pad, GstPadProbeInfo * info,
    gpointer u_data)
{
  GstBuffer *buf = (GstBuffer *) info->data;
  NvDsInstanceBin *bin = (NvDsInstanceBin *) u_data;
  guint index = bin->index;
  AppCtx *appCtx = bin->appCtx;
  //extra  
  NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);
  // Get original raw data
  GstMapInfo in_map_info;
  if (!gst_buffer_map (buf, &in_map_info, GST_MAP_READ)) {
      g_print ("Error: Failed to map gst buffer\n");
      gst_buffer_unmap (buf, &in_map_info);
      return GST_PAD_PROBE_OK;
      }
  NvBufSurface *surface = (NvBufSurface *)in_map_info.data;
  for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
      l_frame = l_frame->next) {
      NvDsFrameMeta *frame_meta = l_frame->data;
      //TODO for cuda device memory we need to use cudamemcpy
      NvBufSurfaceMap (surface, -1, -1, NVBUF_MAP_READ);
      /* Cache the mapped data for CPU access */
      NvBufSurfaceSyncForCpu (surface, 0, 0); //will do nothing for unified memory type on dGPU
      guint height = surface->surfaceList[frame_meta->batch_id].height;
      guint width = surface->surfaceList[frame_meta->batch_id].width;
...

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Thanks,it has been solved by this link:
https://forums.developer.nvidia.com/t/save-picture-on-jetson-got-error-undefined-reference-to-nvbufsurfacemap-nvbufsurfacesyncfordevice-nvbufsurfaceunmap/276793

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.