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

Help with "Test : error PRJ0019: A tool returned an error code"

Ashley_Weinstein
Beginner
1,220 Views
Attached is the expanded build log. I still can't figure out why or where this error is occurring. Any help would be appreciated.

The executable is being created during link-time but when I attempt to run it I get a "C:\\...\\Test.exe is not a valid Win32 application." So something that is supposed to make this executable appropriate for Win32 is not working properly.
0 Kudos
13 Replies
Steven_L_Intel1
Employee
1,220 Views
I can tell you WHERE the error is occuring - it is the Microsoft Manifest Tool (mt.exe) that is trying to embed the manifest in the executable. The manifest is what tells Windows which DLLs are linked to (those that use shared assemblies, such as the MSVC DLLs) when you run the EXE.

What I can't tell you is WHY you get the error. There have been several previous reports of this with Fortran, and a Google search shows many others with Visual C++. None of the reports I can find indicate a resolution. Sometimes just retrying the build lets the process succeed. The only thing I can think of is that a virus scanner, seeing a new .EXE, opens it to check it out and this prevents the tool from rewriting it.

Since you are already linking to the static libraries, you don't need a manifest, so you could turn off that option under Linker > Manifest File.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,220 Views
This may or may not be aplicable

On my system using VS 2010 and building a console appI see:

Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP94.bs" with contents

[

/nologo /out:"x64\Debug\Serial.exe.embed.manifest" /notify_update /manifest "x64\Debug\Serial.exe.intermediate.manifest"

]

Creating command line "mt.exe "@C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP94.bs""

Note the argument to option /out: ends in ".manifest"

In your log file we find

mt.exe /nologo /outputresource:&quotC:\Software\Test\Debug\Test.exe;#1" /manifest &quotC:\Software\Test\Debug\Test.exe.intermediate.manifest"


we find your /outputresource ending with ".exe;#1"

The problem may be the ";#1" in your log file is incorrect.

On occasions in the past, when listing program dependencies in VS projects there is an inconsistancy as to if the tokens (dependencies) are to be seperated using " " or ";". This inconsistancy invariably results in you (the programmer) using the wrong delimiter. Unfortunatly, VS does not point out this common error, and relies on the tool to inform you of the errors of your way.

I suggest you verify the delimiters in your dependencies, libraries, (additional command line args), etc... to assure the correct delimiter is used.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
1,220 Views
Jim, we've discussed this before. It's just the strange way that the lines appear in the log. The command is correct. The #1 indicates an executable resource.
0 Kudos
SergeyKostrov
Valued Contributor II
1,220 Views
...when I attempt to run it I get a "C:\...\Test.exe is not a valid Win32 application."...

What if you're trying to execute a 64-bit version of 'Test.exe'on a 32-bit platform?

Best regards,
Sergey
0 Kudos
Steven_L_Intel1
Employee
1,220 Views
It's a 32-bit build, as shown in the log. When the Manifest Tool fails in this way, it corrupts the executable.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,220 Views
Jim, we've discussed this before. It's just the strange way that the lines appear in the log. The command is correct. The #1 indicates an executable resource.

Ok, (but I've had issues with ";" before).

Occasionally I will get a manifest tool error message (not this one). When it occures, the only way I found to fix (on my system) is to do a clean all, then build. As to how this fixes it, I haven't a clue.

Jim

0 Kudos
SergeyKostrov
Valued Contributor II
1,220 Views
It's a 32-bit build, as shown in the log.When the Manifest Tool fails in this way, it corrupts the executable.


I would try to verify dependencies of RSIDecoke.exe application with MS Depends utility but I'm not sure
that it will help to "pin-point" a problem. Another option to consideris tore-install compilers ( unfortunately,
it could take a couple of hours... ).

Best regards,
Sergey

0 Kudos
Steven_L_Intel1
Employee
1,220 Views
This is not a compiler problem - reinstalling compilers will just be a waste of time.
0 Kudos
SergeyKostrov
Valued Contributor II
1,220 Views
Hi Ashley, This is my follow up and I have two questions:

1. Do you have that error forthe Release configuration?

2. Did you try to build your project(s)as Administrator?

Please take a look at MSDN and this is what it says for 'PRJ0019' error:

...
This error can also occur when you are running as a member of the Users group and Administrative access is needed.
...

Best regards,
Sergey
0 Kudos
Ashley_Weinstein
Beginner
1,220 Views
Hi all, thanks for your help on this topic. I managed to fix the issue (which is why I haven't been on in a while) and now I am trying to remember how I fixed this! I definitely wound up cleaning the build and rebuilding the solution, but I'm not sure if this specifically resolved the problem.
0 Kudos
SergeyKostrov
Valued Contributor II
1,220 Views
Hi all, thanks for your help on this topic. I managed to fix the issue (which is why I haven't been on in a while) and now I am trying to remember how I fixed this! I definitely wound up cleaning the build and rebuilding the solution, but I'm not sure if this specifically resolved the problem.


This is a short follow up and I'd like to provide some technical details on a source of that error message:

Error PRJ0019: A tool returned an error code from "..."

When a Visual Studio starts a building process it creates a couple of temporary bat-files in some folders.
It is possible to "intercept" these bat-files and this is what I've managed to do. A bat-file I've "intercepted" when
building some TBB basedproject looks like:

@echo off
ml.exe /c /nologo /Fo"C:\WorkLib\TBB40\Build\VsProject\Ia32\Release\lock_byte.obj" /W3 /Zi /errorReport:prompt /Ta"..\..\Src\Tbb\ia32-masm\lock_byte.asm"
if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code from "Assembling..."
exit 1
:VCEnd

In my case, that error would bedisplayed if 'ml.exe' fails to compile a 'lock_byte.asm' file due to some reason ( for example, an incorrect path, or a wrong command line argument, etc ).

Best regards,
Sergey

0 Kudos
Steven_L_Intel1
Employee
1,220 Views
I usually find that I can get the actual error message by executing the command from a command prompt. Capturing the .bat file doesn't really help you much, as the build log tells you what the command is.
0 Kudos
Bernard
Valued Contributor I
1,220 Views
Check for the integrity of PE file (your .exe).There is some probability that some field is corrupted and wrongly interpreted by the NT Loader as a uncompatible application.
0 Kudos
Reply