nvsample_cudaprocess_src with opencv compile error

Hi all ,
I have noticed that for us we can use

gst-launch-1.0 nvcamerasrc fpsRange="30 30" ! \
 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, \
 format=(string)I420, framerate=(fraction)30/1' ! nvtee ! \
 nvivafilter cuda-process=true \
 customer-lib-name="libnvsample_cudaprocess.so" ! \
'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e

to perform pre/post/cuda image process .
Then I want to associate with opencv to do the image process . So I compile my own app to dynamic library . libmyapp.so which use opencv to do a taget tracking .
The in the makefile I add -lmyapp to

# Common includes and paths for CUDA
INCLUDES  := -I./
LIBRARIES := -L$(LIB_DIR) -lEGL -lGLESv2 -lmyapp
LIBRARIES += -L$(TEGRA_LIB_DIR) -lcuda -lrt

And In nvsample_cudaprocess.cu I inlcude my app header

#include "customer_functions.h"
#include "cudaEGL.h"
#include "iva_metadata.h"
#include "kcftracker.hpp"

When I compile It show me that opencv include header error

In file included from /usr/local/include/opencv2/opencv.hpp:86:0,
                 from tracker.h:21,
                 from kcftracker.hpp:85,
                 from nvsample_cudaprocess.cu:37:
/usr/local/include/opencv2/stitching.hpp:58:4: warning: #warning Detected X11 'Status' macro definition, it can cause build conflicts. Please, include this header before any X11 headers. [-Wcpp]
 #  warning Detected X11 'Status' macro definition, it can cause build conflicts
    ^
/usr/local/include/opencv2/stitching.hpp(128): error: expected either a definition or a tag name

/usr/local/include/opencv2/stitching.hpp(129): error: expected an identifier

/usr/local/include/opencv2/stitching.hpp(129): error: expected a ";"

3 errors detected in the compilation of "/tmp/tmpxft_00000e43_00000000-11_nvsample_cudaprocess.compute_62.cpp1.ii".
Makefile:133: recipe for target 'nvsample_cudaprocess.o' failed
make: *** [nvsample_cudaprocess.o] Error 1

So my question is Am I the right way to use nvsample_cudaprocess_src ?

Hi,

From topic 1031870, it looks like this issue is fixed already.
https://devtalk.nvidia.com/default/topic/1031870/jetson-tx2/cugraphicseglregisterimage-failed-3-/

Please feel free to let us know if there is still an issue in compiling.
Thanks.

Hi ,
Thank you for your kind help .
for this compile problem , I just comment in the opencv_modules.hpp with //#define HAVE_OPENCV_STITCHING
Then it work fine .

Good to know it works now.
Thanks for the feedback.