Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Shared code project can't see files of the main project (Read 674 times)
Evgeny Zhekaus
Junior Member
**
Offline


Posts: 37
Joined: Sep 19th, 2018
Shared code project can't see files of the main project
Dec 15th, 2019 at 8:59pm
Print Post  
I’ve got a pretty weird problem. I have a project (let’s call it Main) and a Shared code project.

If I put this shared code project into the Main project directory (to subfolders \libs for instance), then Shared code project doesn’t see headers of the Main project.

However, if I put Shared code project anywhere outside the Main project tree, there is no problem and all he Main project’s files are accessible from the Shared code project.

Current workaround is creating a dummy shared code project where I put files from Main project which will be used in shared code projects.

Cry
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: Shared code project can't see files of the main project
Reply #1 - Dec 16th, 2019 at 10:34am
Print Post  
Would you be able to send a screenshot of solution explorer in solution view and in file/folder view when it doesn't work correctly? (just so we are clear on the structure and references that are failing)

When you have the project in the sub-folder, and wish to reference the main projects files, you may need to reference them as below:

Our main code header for example: MainProject\Main.h
Referenced in: "MainProject\Libraries\MySharedCode\Shared.h
By using #include "..\..\Main.h" in the Shared.h file

But if it is a Shared project you don't know the "Main.h" to reference next time as outside of the Shared Project.

From the last line it sounds like there is code in the main project which needs to be part of the Shared Code project, as you have in the dummy project you create to work around the issue.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint