Hi all,
I have an Envirnoment Variable set, eg: SOMESDK_DIR to C:\somesdk ie.
<In COMMAND Window>
c:\SET SOME_DIR
c:\somesdk
<end>
Now I have some files in this SDK a.c and b.c. I want to include them
in the project. When I try adding the file, using the Add Existing
Files option, the absolute path is taken. I tried editing the vcproj
file in an editor and found the following
<CODE>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="c:\somesdk\a.c"
>
</File>
<File
RelativePath="c:\somesdk\b.c"
>
</File>
</Filter>
</CODE>
I replaced the above with
<CODE>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="$(SOMESDK_DIR)\a.c"
>
</File>
<File
RelativePath="$(SOMESDK_DIR)\b.c"
>
</File>
</Filter>
</CODE>
When I try opening the file, I get the following error
"c:\work\testproject\$(somesdk_dir)\a.c Cannot open file"
C:\work\testproject is my project dir.
Can someone please tell me who to add an Envirnoment Variable?
--
Regards
Libin
Rory Becker - 30 Mar 2007 07:45 GMT
> Can someone please tell me who to add an Envirnoment Variable?
I think ...
-------------------------------------------------------------
RelativePath="%SOMESDK_DIR%\b.c"
-------------------------------------------------------------
... will do it
--
Rory
libin_v - 30 Mar 2007 08:12 GMT
> -------------------------------------------------------------
> RelativePath="%SOMESDK_DIR%\b.c"
> -------------------------------------------------------------
> ... will do it
Rory, Still says "c:\work\testproject\%SOMESDK_DIR%\b.c Connnot Open
File"