How to include a file in my c++ program that is located in other folders?

  c++, gstreamer

I’m trying to do the Gstreamer tutorials, but my c++ file is not recognizing the header file I’m trying to include on the first line.

#include "/Users/justinjohnson/Documents/TrafficStop/gstreamer-1.16.2/gst/gst.h"

int main (int argc, char *argv[])
{
  GstElement *pipeline;
  GstBus *bus;
  GstMessage *msg;

  /* Initialize GStreamer */
  gst_init (&argc, &argv);

  /* Build the pipeline */
  pipeline =
      gst_parse_launch
      ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",
      NULL);

  /* Start playing */
  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  /* Wait until error or EOS */
  bus = gst_element_get_bus (pipeline);
  msg =
      gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
      GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

  /* Free resources */
  if (msg != NULL)
    gst_message_unref (msg);
  gst_object_unref (bus);
  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (pipeline);
  return 0;
}

On the first line I am flagged,

#include errors detected. Please update your includePath. 

Squiggles are disabled for this translation unit (/Users/justinjohnson/Documents/TrafficStop/basic-tutorial-1.c).

How do I get the gst file to link with my code?

Source: Windows Questions C++

LEAVE A COMMENT