HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

how to use system_logical_name with #include declare?

 
wang_17
Occasional Advisor

how to use system_logical_name with #include declare?

system openvms 7.3-1,cc 6.5 and mms

now i have defined a logical_name is APPDIR
$define/system APPDIR "sys$sysdevice:[project]"
and declared in my c source file below:

#include "APPDIR:time.h"

but thrown "can't open APPDIR:time.h or file no found" message when i make
why the compiler can't translate logical name to real path? how i can use logical name with include declare?

help!!
6 REPLIES
Kris Clippeleyr
Honored Contributor

Re: how to use system_logical_name with #include declare?

Hi,

You should use the U**x syntax:

#include

Regards,

Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...

Re: how to use system_logical_name with #include declare?

I have no problem at all using that format.

However, when the file is not found I do not get an error message like that. It would be useful to see exactly what error you are getting.

Also, "time.h" is one of the standard header files. It might be interesting to see if you get the same problem with a file with a unique name.
Bojan Nemec
Honored Contributor

Re: how to use system_logical_name with #include declare?

Wang,

As a variant, you can use also the /INCLUDE_DIRECTORY qualifier of the CC command. You can specify many directories which will be searched for the include file. The second variant is to define DECC$USER_INCLUDE (for #include "") or the DECC$SYSTEM_INCLUDE (for #include <>) logical name with one or more directories to search for include files.

Examples:

$ CC /INCLUDE_DIRECTORY=sys$sysdevice:[project] my.c

for the second
$ DEFINE DECC$USER_INCLUDE sys$sysdevice:[project]
$ CC my.c

In both variants you then use the:

#include "time.h"

(without APPDIR) for including files. This is similar to the UNIX -I qualifier.

Bojan
wang_17
Occasional Advisor

Re: how to use system_logical_name with #include declare?

thx a lots, Kris Martin and Bojan, i think i got it.aha.
Ian Miller.
Honored Contributor

Re: how to use system_logical_name with #include declare?

wang, can you show your thanks to the people that have helped you by assigning ports as described here
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
____________________
Purely Personal Opinion
Jan van den Ende
Honored Contributor

Re: how to use system_logical_name with #include declare?

Hi Wang,

Welcome to VMS, also from me.

Reading Ian's post, I lookup up your Forum Profile.

"I have assigned points to 0 of 22 responses to my questions. "

So, I thought maybe I should explain some more.

on giving points:
try to give points to EVERY answer to your questions!

It is fully up to you HOW MANY, and you can just give 0 (zero) if you think you don't want to give more.
Any assignment, including zero, removes the "unassigned" header.

It is reflected in your Forum Profile.
If you do not know that yet, then click your own name (in the questions summary, in your question header, in the header of any of your replies).

In your profile you will notice how many answers you have assigned to, from how many total.

If you somehow want more info on any other Forum user, it is basically the same.


( and hey, we have all begun as newbies, most of us stumbled over this! )

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.