Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Custom Build Step problem

djfrederi
Beginner
792 Views
I am having a problem with the Command Line in the Custom Build Step for several of the files in a project because the solution/projects are located in a folder that has a "(" in the path name.

I have created a simple solution/project that will demonstrate the problem

The path to the file(s) is "C:\Projects\Working\VTest_Folder\ENV\ACFTSIM\(3)Code\Libraries\APU\Source\lfis". The file name is d731.l. The Command Line entry in the Custom Build Step is "dir" without the quotation marks. The Outputs field contains "$(InputName).f", also without the quotation marks.

When I do a build on this project, it generates the error "error PRJ0019: A tool returned an error code". The buildlog.htm file contains:

-------------------------------------------------------------------------------------
Deleting intermediate files and output files for project 'APU_Lib1', configuration 'Debug|Win32'.
Performing Custom Build Step...
dir
'C:\Projects\Working\VTest_Folder\ENV\ACFTSIM' is not recognized as an internal or external command,
operable program or batch file.

APU_Lib1 : error PRJ0019: A tool returned an error code

APU_Lib1 - 1 error(s), 0 warning(s)
-------------------------------------------------------------------------------------

If I change the pathname to the files to

" C:\Projects\Working\VTest_Folder\ENV\ACFTSIM\3)Code\Libraries\APU\Source\lfis "

everything works great!

Is there a way to get around this problem without moving all of the source code?

Thanks,
Dan
0 Kudos
2 Replies
DavidWhite
Valued Contributor II
792 Views
Dan,

What happens if you type this command from a command prompt or in a batch file? Does it work then?

A possibiity is to put extra sets of " " around the call to the function. Getting Windows to recognise the correct path can be tricky and not immediately obvious. Testing from command prompt can be a useful test.

David

0 Kudos
djfrederi
Beginner
792 Views
Quoting - David White
Dan,

What happens if you type this command from a command prompt or in a batch file? Does it work then?

A possibiity is to put extra sets of " " around the call to the function. Getting Windows to recognise the correct path can be tricky and not immediately obvious. Testing from command prompt can be a useful test.

David


David,

I tried putting "" around the dir in the Custom Build Step's Command Linebut with the same result (see below).

Performing Custom Build Step...
"dir"
'C:ProjectsWorkingVTest_FolderENVACFTSIM' is not recognized as an internal or external command,
operable program or batch file.

APU_Lib1 : error PRJ0019: A tool returned an error code

APU_Lib1 - 1 error(s), 0 warning(s)

Then I tried using a command window and going down to C:ProjectsworkingVTest_FolderENVACFTSIM(3)CodeLibrariesAPU and typing in dir - that worked.

The next step was to make a .bat file (called test.bat) and putting dir as the first and only line in the file and then saving this file in the above folder as test.bat. When I went back to the command window and typed test.bat, everything worked fine, again.

What should I try next?

Thanks,
Dan

0 Kudos
Reply