embedded directory paths

D

David

I have an #include file (A) that calls another #include file (B) -
including the directory path that it is to be found on.

The files live in a unix system - people compile using a samba share,
so that the files appear to be on a locally attached PC drive.
However, when we have problems with samba (as we do from time to time)
they need to access these include files via a network link.

So, the path to #include B is coded something like #include
"S:/test/includeb" and this no longer works when accessed via a
network link as the S: drive is no longer available. Via the network
link the path would be something like \\fstest1\test\includeb

How can I change the call to include B so that it works in both cases?
 
V

Victor Bazarov

David said:
I have an #include file (A) that calls another #include file (B) -
including the directory path that it is to be found on.

The files live in a unix system - people compile using a samba share,
so that the files appear to be on a locally attached PC drive.
However, when we have problems with samba (as we do from time to time)
they need to access these include files via a network link.

So, the path to #include B is coded something like #include
"S:/test/includeb" and this no longer works when accessed via a
network link as the S: drive is no longer available. Via the network
link the path would be something like \\fstest1\test\includeb

How can I change the call to include B so that it works in both cases?

This is off-topic. Please in the future consider asking in the newsgroup
dedicated to your compiler.

<offtopic>
You need to figure out the common part (seems like "includeb" is it)
and keep it:

#include <includeb>

And you need to give the compiler a hint where to find that file
(-I compiler switch, e.g.). So, when Samba works, you need to say

cl -I"S:\test" ...

and when it doesn't you say

cl -I"\\fstest1\test"

Of course, it's better done using a make file or a project file that sets
some kind of environment variable...
</offtopic>

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top