Error in $(COBIA_INCLUDE) environment variable

Discusses CAPE-OPEN specific middleware and corresponding development kit

Moderator: jasper

Error in $(COBIA_INCLUDE) environment variable

Postby ahmedsabriz » 14 June 2021, 07:19

Hello,

This is a minor issue but I noticed the $(COBIA_INCLUDE) environment variable in Visual Studio is wrongly defined. When I try to peek into COBIA headers from within my class I get an error "We were unable to open file capeinterfaces_1_2.h. It may have been moved, renamed or deleted.
C:\Users\{username}\AppData\Local\Programs\Common\CAPE-OPEN Laboratories Network\Include\tories Network\Include\capeinterfaces_1_2.h"

Notice how the path seems to be pasted wrongly causing an overlap in it. In any case, I simply removed the variable from additional include library and put the path manually. However, when I uninstalled the COBIA SDK and installed the 1.2.0.6 version, the variable was once again added with the wrong path.

I would like to know if I can correct the variable somehow for the sake of convenience.
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Error in $(COBIA_INCLUDE) environment variable

Postby jasper » 14 June 2021, 07:30

I am not clear on this - the value you show is the value of $(COBIA_INCLUDE), including the header file name?

What does

echo %COBIA_INCLUDE%

from a command prompt say?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Error in $(COBIA_INCLUDE) environment variable

Postby ahmedsabriz » 14 June 2021, 10:32

Thank you Dr. Van Baten for your reply. I get C:\Users\{username}\AppData\Local\Programs\Common\CAPE-O~1\Include\. Visual Studio for some reason defines the full path as C:\Users\{username}\AppData\Local\Programs\Common\CAPE-OPEN Laboratories Network\Include\tories Network\Include\. So, the header files do compile, yet peeking at a specific header requires replacing the environment variable with the correct path.
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Error in $(COBIA_INCLUDE) environment variable

Postby jasper » 14 June 2021, 12:43

C:\Users\{username}\AppData\Local\Programs\Common\CAPE-O~1\Include\


This bit looks correct, provided that you substituted yourself the {username} part from the actual user name. I suspect this is the case, or otherwise the installer would not have translated to the short name.

Can you elaborate what you mean with

Visual Studio for some reason defines the full path as C:\Users\{username}\AppData\Local\Programs\Common\CAPE-OPEN Laboratories Network\Include\tories Network\Include\.


Is this from a compile error message? Can you send the full compile output?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Error in $(COBIA_INCLUDE) environment variable

Postby ahmedsabriz » 16 June 2021, 17:11

Compilation is not affected. All builds are successful. The path is defined correctly until extra characters (last 23 characters to be precise) are repeated which results in error when browsing the dependencies or peeking into the libraries.

Image

I add the path instead of the variable to all additional include directories. I was curious to know if I can edit this environment variable and if this error was caused by something I did.

[Update] I managed to edit and correct the variable.
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Error in $(COBIA_INCLUDE) environment variable

Postby jasper » 17 June 2021, 06:38

So this error shows when you select "go to definition" but not during compile? That is strange. This would imply Intellisense it wrong (and not from the environment variable, which is apparently correct).

May I ask how you managed to fix it?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Error in $(COBIA_INCLUDE) environment variable

Postby ahmedsabriz » 17 June 2021, 13:36

I don't believe it only affected intellisense because opening the cobia dependencies from the solution manager resulted in the error same error. I found out I can change the variable by running "rundll32.exe sysdm.cpl,EditEnvironmentVariables" in CMD and substituted
C:\Users\ahmed\AppData\Local\Programs\Common\CAPE-O~1\Include\
to
C:\Users\ahmed\AppData\Local\Programs\Common\CAPE-OPEN Laboratories Network\Include
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Error in $(COBIA_INCLUDE) environment variable

Postby jasper » 18 June 2021, 08:59

But the COBIA installer purposely puts the short path name (without spaces) in the environment variable, as to not complicate compiler command lines.

Just to make sure that the short path name is correct, if you open a cmd prompt and do

dir C:\Users\ahmed\AppData\Local\Programs\Common\CAPE-O~1\Include\


you are seeing the include files?

Which version of Visual Studio are you using?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: Error in $(COBIA_INCLUDE) environment variable

Postby ahmedsabriz » 19 June 2021, 05:42

I do see all the include files in command line. I can see how you are suspecting that Visual Studios is parsing the short path incorrectly and it makes sense to me. I am using the latest Visual Studios Community 16.10.2
ahmedsabriz
 
Posts: 20
Joined: 07 June 2021, 13:54

Re: Error in $(COBIA_INCLUDE) environment variable

Postby jasper » 20 June 2021, 08:21

I cannot reproduce the issue.

I have logged a related item here

https://colan.repositoryhosting.com/trac/colan_cobia/ticket/76
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Next

Return to CAPE-OPEN Binary Interop Architecture

Who is online

Users browsing this forum: No registered users and 1 guest

cron