Jump to content
Sign in to follow this  
Roger Cigol

11.2 now doesn't link my Windows VCL C++ Clang64 project

Recommended Posts

I have a 350+ file project that built just fine with 11.0, 11.1 and 11.1.5. Its a windows 64 bit VCL project. It has a set of unit tests (googletest) that builds under 11.2 ok. It has a small "test utlititly" that is also Win64 VCL and that too builds ok under 11.2 But when I try to compile the main project all the files compile ok but the linker fails. I get the following output which I am having trouble interpreting. Any ideas about what might cause this ?

 

[MSBuild Error] CodeGear.Cpp.Targets(3984, 5): MSB4018 The "ILINK32" task failed unexpectedly.
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
   at Borland.Build.Tasks.Common.Metadata.Option.ParseInt64(String value)
   at Borland.Build.Tasks.Common.Metadata.Option.IsDefaultValue(BaseTask task)
   at Borland.Build.Tasks.Common.Metadata.Option.AppendCommandLineSwitch(BaseTask task, CommandLineBuilder b)
   at Borland.Build.Tasks.Common.BaseTask.AddOptionString(CommandLineBuilder b)
   at Borland.Build.Tasks.Cpp.ILINK32.AddOptionString(CommandLineBuilder b)
   at Borland.Build.Tasks.Common.BaseTask.GetCommandLine()
   at Borland.Build.Tasks.Cpp.ILINK32.GetCommandLine()
   at Borland.Build.Tasks.Common.BaseTask.GenerateCommandLineCommands()
   at Microsoft.Build.Utilities.ToolTask.Execute()
   at Borland.Build.Tasks.Common.BaseTask.Execute()
   at Borland.Build.Tasks.Cpp.ILINK32.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
 

Share this post


Link to post

I don't know if this helps (it looks like more of the same...). The TwineCompile "console output" shows all 354 file compile ok and the resource compilation goes ok. It then reports the following for the linker error....

 

 


            
Done building target "MakeObjs" in project "MyProjectNameHere.cbproj".
Linking...
Target _PerformLink:
    Target _PerformBCCILink:
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018: The "ILINK32" task failed unexpectedly.
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018: System.FormatException: Input string was not in a correct format.
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.ParseInt64(String value)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.IsDefaultValue(BaseTask task)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.AppendCommandLineSwitch(BaseTask task, CommandLineBuilder b)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.AddOptionString(CommandLineBuilder b)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.AddOptionString(CommandLineBuilder b)
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.GetCommandLine()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.GetCommandLine()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.GenerateCommandLineCommands()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.Execute()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.Execute()
        d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
    Done building target "_PerformBCCILink" in project "MyProjectNameHere.cbproj" -- FAILED.
Done building target "_PerformLink" in project "MyProjectNameHere.cbproj" -- FAILED.

Done building project "MyProjectNameHere.cbproj" -- FAILED.

Build FAILED.

D:\MyProjectNameHere\C code\Utility classes\Computer.cpp(348,7): C++ warning : 'GetVersionExW' is deprecated [-Wdeprecated-declarations]
d:\program files (x86)\embarcadero\studio\22.0\include\windows\sdk\sysinfoapi.h(383): C++ warning : > 'GetVersionExW' has been explicitly marked deprecated here
D:\MyProjectNameHere\C code\LabelPrinterPcb Thread\LabelPrinterPcbControl.cpp(967,6): C++ warning : '/*' within block comment [-Wcomment]
D:\MyProjectNameHere\C code\LabelPrinterPcb Thread\LabelPrinterPcbControl.cpp(1018,18): C++ warning : '/*' within block comment [-Wcomment]
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018: The "ILINK32" task failed unexpectedly.
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018: System.FormatException: Input string was not in a correct format.
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.ParseInt64(String value)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.IsDefaultValue(BaseTask task)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.Metadata.Option.AppendCommandLineSwitch(BaseTask task, CommandLineBuilder b)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.AddOptionString(CommandLineBuilder b)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.AddOptionString(CommandLineBuilder b)
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.GetCommandLine()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.GetCommandLine()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.GenerateCommandLineCommands()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Common.BaseTask.Execute()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Borland.Build.Tasks.Cpp.ILINK32.Execute()
d:\program files (x86)\embarcadero\studio\22.0\Bin\CodeGear.Cpp.Targets(3984,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
    4 Warning(s)
    1 Error(s)

Time Elapsed 00:10:07.58
Finished Build.

          

Share this post


Link to post

Interesting - I seem when I successfully compile  and link my GoogleTests unit tests for this project I get this line in the console output

 

Linking...
Target _PerformLink:
    Target _PerformBCCILink:
        d:\program files (x86)\embarcadero\studio\22.0\bin\ilink64.exe -G8 -L.   < all my google test files are listed here>

Build succeeded.
    0 Warning(s)
    0 Error(s)

 

The fact that the error messages for the main project (previosuly reported) are referring to "ILINK32" makes me wonder if the 11.2 has got mixed up and is trying to call the 32 bit linker....

Share this post


Link to post

For any odd build/link issues like that I usually wipe all build and temp files from all associated directories.  I also have each project output to a platform/config specific directory so there should be no cross-contamination:

 

  $(DEV_BUILD_DIR)\ProjName_$(Platform)_$(Config)

Share this post


Link to post

Hi David P, Really appreciate your suggestion. Have tried doing a manual delete of all temporary folders - no different. I already use a different tempororary file for each build option (for this VCL Win64 project I only have a debug build and a release build as the two targets). You don't mention my note about "shouldn't it be using ILINK64".... Do you agree with this statement or am I wrong here?

Share this post


Link to post

I have just created a new trivial Clang64 VCL project (one form, two buttons). This compiles and links ok with 11.2. When I look at the section of the build output text related to the linker it begins as follows:

 

Linking...
Target _PerformLink:
    Target _PerformBCCILink:
        d:\program files (x86)\embarcadero\studio\22.0\bin\ilink64.exe -G8 -L.\Win64\Debug;"d:\program files 

 

ie it is using the ilink64 linker. So I am pretty sure that my problem is that 11.2 is for some reason trying to link my large project using the wrong linker....

 

Anyone know why this might be or how I can force this to use ilink64 ?

 

Share this post


Link to post
On 9/19/2022 at 12:05 PM, Roger Cigol said:

You don't mention my note about "shouldn't it be using ILINK64".... Do you agree with this statement or am I wrong here?

I agree.  In 11.2 I'm able to switch between 32/64 bit builds with no issue.   Have you tried without using TwineCompile?  I've used that for many years and just recently have reverted to using Clang directly with 16 threads.  It's almost as fast and there appear to be fewer build/link issues.

Share this post


Link to post

I get the same problem with and without TwineCompile. I use TwineCompile for all C++ projects - for the clang compilers any reasonable project without TwineCompile becomes unmanageable because of the compile times.....

Share this post


Link to post

This problem is solved! I found that if I cleared the linker heap settings (in project | options | linker) and then tried a build the correct linker did run (so the can't create task ILINK32 error message is a bit of a red herring - the task called ILINK32 creates a call of ilink64) but it gave an "out of memory error". Entering heap sizes back in again (as per the embarcadero documentation on "linker out of memory" issues) gave me a project that links ok.

OK : so not actually sure why I had to do this - but it has solved the problem. 

Share this post


Link to post

I had that issue for a debug build, I had to increase the linker sizes.

 

Clang can be made to use multiple threads and be almost as fast as TC.

Share this post


Link to post

An update: it seems the real problem with my linker options was that one of the heap size settings had been entered (by me) with a leading space. It seems the MSBuild process doesn't like this. By deleting and then re-entering the numbers I removed the leading space and hence it all "sprung into life".

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×