I have a common_module.h
file which should store structures and functions used by most of .cpp files.
I want it to have an RColor
struct.
RColor uses a lot of functions and variables from namespace cv. The project is made in a way that .cpp files generally do not use cv namespace (All work with it is mostly done by structures like RColor
)
I don't want to always write cv::something
in definition of RColor
. So i tried to create an RColor
prototype in common_module.h
and put it definition to Rcolor.cpp
:
//common_module.h
//...
struct RColor;
#include "stdafx.h"
#include<opencv2/opencv.hpp>
using namespace cv;
struct RColor
{
...
};
//Project0.cpp (main file)
#include "stdafx.h"
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<windows.h>
RColor col;
I get error:
1>error C2079: 'col' uses undefined struct 'RColor'