Home>

We are developing C++ with visual studio.
I want to create multiple projects in the same solution and include .h that exists in another project from one project.
As shown in the attached figure, we are trying to call common.h of Project2 from Project1.
However, I get an error that the source file cannot be opened.

Work such as adding Project2 to the reference of project1HereOrHereIt was done with reference to.

The various versions used are as follows.
visual studio: 2017
windows: 10 home

I don't think it is related, but the contents of each file are as follows.

//common.cpp
#include<stdio.h>
void showCommon(){
printf("---common-----\n");
}
//common.h
#include<stdio.h>
void showCommon();
//main.cpp
#include<stdio.h>
#include "common.h"
void main(){
printf("---mainA-----\n");
showCommon();
}