gavinpugh / vs-android

Integrated development of Android NDK C/C++ software with Microsoft Visual Studio.
Other
119 stars 34 forks source link

does not work when compile static lib #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I tried to compile sdl library and got  error 

TRACKER : error TRK0002: Failed to execute command: 
"C:\android\android-ndk-r9d\toolchains\arm-linux-androideabi-4.6\prebuilt\window
s-x86_64\bin\arm-linux-androideabi-ar.exe 
@C:\Users\ssolozhentsev\AppData\Local\Temp\tmp3b98d6d0a89a4de99c34a97b07c863c9.r
sp". Wrong descriptor.

when I try to execute command from console I get error
C:\android\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows
-x86_64\bin\arm-linux-androideabi-ar.exe
: invalid option -- @

Original issue reported on code.google.com by SergeySo...@gmail.com on 19 Jun 2014 at 7:11

GoogleCodeExporter commented 9 years ago
I turned on EchoMessages and got command line
it works if I execute it from command line. But it does not work from Visual 
Sudio 2012

Original comment by SergeySo...@gmail.com on 19 Jun 2014 at 7:44

GoogleCodeExporter commented 9 years ago
this issue because of TrackFileAccess=true. If I set it to false everything is 
ok. And I fund why. If TrackFileAccess= trueit create temporary text file with 
unicode encoding for all options. And arm-linux-androideabi-ar.exe does not 
recoginze such encoding

Original comment by SergeySo...@gmail.com on 19 Jun 2014 at 8:24

GoogleCodeExporter commented 9 years ago
I've fixed my issue just modifying function in GCCLib

protected override int ExecuteTool(string pathToTool, string 
responseFileCommands, string commandLineCommands)
        {
            if (EchoCommandLines == "true")
            {
                Log.LogMessage(MessageImportance.High, pathToTool + " " + responseFileCommands);
            }
            TrackFileAccess = false;
            string tmpFile = Path.GetTempFileName();
            using (StreamWriter streamWriter = new StreamWriter(tmpFile, false))
            {
                streamWriter.Write(responseFileCommands);
            }

            int result = base.ExecuteTool(pathToTool, "", "@" + tmpFile);

            File.Delete(tmpFile);
            return result;
        }

Original comment by SergeySo...@gmail.com on 19 Jun 2014 at 8:40

GoogleCodeExporter commented 9 years ago
I think disabling TrackFileAccess may break dependency checking?

i.e. if you modify a .h header file, do all .c/cpp files that include it 
rebuild?

This issue is listed on the Troubleshooting page, btw:
https://code.google.com/p/vs-android/wiki/Troubleshooting#64bit_NDK_-_TRACKER_:_
error_TRK0002:_Failed_to_execute_command

It appears to be specific to using the 64-bit NDK.

Original comment by gavin.dj.pugh on 25 Jun 2014 at 6:25