#c #linux #visual-studio #msbuild
Вопрос:
У меня есть базовый проект MSBuild на c для Linux. Я смог скомпилировать и отладить его без каких-либо проблем, пока не переустановил Debian на сервере. С тех пор я установил g
, GCC
, gdb
, gdbserver
, make
, rsync
, и zip
.
Visual-Studio компилирует проект удаленно без каких-либо проблем, но когда он пытается запустить его, я получаю следующее приглашение.
Я пробовал использовать разные версии Visual-Studio, такие как prev2022 и 2019, и устанавливать Linux на совершенно другой машине в моей сети.
Вот содержимое .vcxproj
файла:
lt;?xml version="1.0" encoding="utf-8"?gt; lt;Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"gt; lt;ItemGroup Label="ProjectConfigurations"gt; lt;ProjectConfiguration Include="Debug|ARM"gt; lt;Configurationgt;Debuglt;/Configurationgt; lt;Platformgt;ARMlt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Release|ARM"gt; lt;Configurationgt;Releaselt;/Configurationgt; lt;Platformgt;ARMlt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Debug|ARM64"gt; lt;Configurationgt;Debuglt;/Configurationgt; lt;Platformgt;ARM64lt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Release|ARM64"gt; lt;Configurationgt;Releaselt;/Configurationgt; lt;Platformgt;ARM64lt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Debug|x86"gt; lt;Configurationgt;Debuglt;/Configurationgt; lt;Platformgt;x86lt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Release|x86"gt; lt;Configurationgt;Releaselt;/Configurationgt; lt;Platformgt;x86lt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Debug|x64"gt; lt;Configurationgt;Debuglt;/Configurationgt; lt;Platformgt;x64lt;/Platformgt; lt;/ProjectConfigurationgt; lt;ProjectConfiguration Include="Release|x64"gt; lt;Configurationgt;Releaselt;/Configurationgt; lt;Platformgt;x64lt;/Platformgt; lt;/ProjectConfigurationgt; lt;/ItemGroupgt; lt;PropertyGroup Label="Globals"gt; lt;ProjectGuidgt;{63047eae-971e-48d1-b78a-91ea7faeda86}lt;/ProjectGuidgt; lt;Keywordgt;Linuxlt;/Keywordgt; lt;RootNamespacegt;xylt;/RootNamespacegt; lt;MinimumVisualStudioVersiongt;15.0lt;/MinimumVisualStudioVersiongt; lt;ApplicationTypegt;Linuxlt;/ApplicationTypegt; lt;ApplicationTypeRevisiongt;1.0lt;/ApplicationTypeRevisiongt; lt;TargetLinuxPlatformgt;Genericlt;/TargetLinuxPlatformgt; lt;LinuxProjectTypegt;{D51BCBC9-82E9-4017-911E-C93873C4EA2B}lt;/LinuxProjectTypegt; lt;/PropertyGroupgt; lt;Import Project="$(VCTargetsPath)Microsoft.Cpp.Default.props" /gt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"gt; lt;UseDebugLibrariesgt;truelt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"gt; lt;UseDebugLibrariesgt;falselt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration"gt; lt;UseDebugLibrariesgt;truelt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration"gt; lt;UseDebugLibrariesgt;falselt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"gt; lt;UseDebugLibrariesgt;truelt;/UseDebugLibrariesgt; lt;UseOfStlgt;libstdc _sharedlt;/UseOfStlgt; lt;RemoteRootDirgt;~/debuglt;/RemoteRootDirgt; lt;PlatformToolsetgt;Remote_GCC_1_0lt;/PlatformToolsetgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"gt; lt;UseDebugLibrariesgt;falselt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"gt; lt;UseDebugLibrariesgt;falselt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"gt; lt;UseDebugLibrariesgt;truelt;/UseDebugLibrariesgt; lt;/PropertyGroupgt; lt;Import Project="$(VCTargetsPath)Microsoft.Cpp.props" /gt; lt;ImportGroup Label="ExtensionSettings" /gt; lt;ImportGroup Label="Shared" /gt; lt;ImportGroup Label="PropertySheets" /gt; lt;PropertyGroup Label="UserMacros" /gt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"gt; lt;RemoteCopySourceMethodgt;rsynclt;/RemoteCopySourceMethodgt; lt;RemoteCCompileToolExegt;g lt;/RemoteCCompileToolExegt; lt;RemoteCppCompileToolExegt;g lt;/RemoteCppCompileToolExegt; lt;ValidateArchitecturegt;truelt;/ValidateArchitecturegt; lt;MultiProcNumbergt;4lt;/MultiProcNumbergt; lt;/PropertyGroupgt; lt;ItemGroupgt; lt;ClCompile Include="AuthorizationManager.cpp" /gt; lt;ClCompile Include="Cookie.cpp" /gt; lt;ClCompile Include="CreateDirectoryModule.cpp" /gt; lt;ClCompile Include="DeleteDirectoryModule.cpp" /gt; lt;ClCompile Include="Directory.cpp" /gt; lt;ClCompile Include="FileHelper.cpp" /gt; lt;ClCompile Include="FileSystemManager.cpp" /gt; lt;ClCompile Include="FileUploadManager.cpp" /gt; lt;ClCompile Include="FinishModule.cpp" /gt; lt;ClCompile Include="HttpRequest.cpp" /gt; lt;ClCompile Include="HttpRequestCreator.cpp" /gt; lt;ClCompile Include="HttpResponse.cpp" /gt; lt;ClCompile Include="HttpServer.cpp" /gt; lt;ClCompile Include="LoginModule.cpp" /gt; lt;ClCompile Include="LogoffModule.cpp" /gt; lt;ClCompile Include="main.cpp" /gt; lt;ClCompile Include="MoveDirectoryModule.cpp" /gt; lt;ClCompile Include="NavModule.cpp" /gt; lt;ClCompile Include="ParentModule.cpp" /gt; lt;ClCompile Include="PathHelper.cpp" /gt; lt;ClCompile Include="PauseModule.cpp" /gt; lt;ClCompile Include="RefreshModule.cpp" /gt; lt;ClCompile Include="RenameDirectoryModule.cpp" /gt; lt;ClCompile Include="ResumeModule.cpp" /gt; lt;ClCompile Include="SocketListener.cpp" /gt; lt;ClCompile Include="StartModule.cpp" /gt; lt;ClCompile Include="StopModule.cpp" /gt; lt;ClCompile Include="StringCompairer.cpp" /gt; lt;ClCompile Include="StringConverter.cpp" /gt; lt;ClCompile Include="Timer.cpp" /gt; lt;ClCompile Include="UserManager.cpp" /gt; lt;/ItemGroupgt; lt;ItemGroupgt; lt;ClInclude Include="AuthorizationManager.h" /gt; lt;ClInclude Include="byte.h" /gt; lt;ClInclude Include="byteSection.h" /gt; lt;ClInclude Include="Cookie.h" /gt; lt;ClInclude Include="CreateDirectoryModule.h" /gt; lt;ClInclude Include="DeleteDirectoryModule.h" /gt; lt;ClInclude Include="Directory.h" /gt; lt;ClInclude Include="FileHelper.h" /gt; lt;ClInclude Include="FileInfo.h" /gt; lt;ClInclude Include="FileSystemManager.h" /gt; lt;ClInclude Include="FileUploadManager.h" /gt; lt;ClInclude Include="FinishModule.h" /gt; lt;ClInclude Include="HttpMethod.h" /gt; lt;ClInclude Include="HttpModule.h" /gt; lt;ClInclude Include="HttpRequest.h" /gt; lt;ClInclude Include="HttpRequestCreator.h" /gt; lt;ClInclude Include="HttpRequestHandler.h" /gt; lt;ClInclude Include="HttpResponse.h" /gt; lt;ClInclude Include="HttpServer.h" /gt; lt;ClInclude Include="LoginModule.h" /gt; lt;ClInclude Include="loginResult.h" /gt; lt;ClInclude Include="LogoffModule.h" /gt; lt;ClInclude Include="MoveDirectoryModule.h" /gt; lt;ClInclude Include="NavModule.h" /gt; lt;ClInclude Include="ParentModule.h" /gt; lt;ClInclude Include="PathHelper.h" /gt; lt;ClInclude Include="PauseModule.h" /gt; lt;ClInclude Include="RefreshModule.h" /gt; lt;ClInclude Include="RenameDirectoryModule.h" /gt; lt;ClInclude Include="RequestHandler.h" /gt; lt;ClInclude Include="ResumeModule.h" /gt; lt;ClInclude Include="serverSettings.h" /gt; lt;ClInclude Include="SocketListener.h" /gt; lt;ClInclude Include="SortedVectorHelper.h" /gt; lt;ClInclude Include="StartModule.h" /gt; lt;ClInclude Include="StopModule.h" /gt; lt;ClInclude Include="StringCompairer.h" /gt; lt;ClInclude Include="StringConverter.h" /gt; lt;ClInclude Include="Timer.h" /gt; lt;ClInclude Include="uid.h" /gt; lt;ClInclude Include="UploadFile.h" /gt; lt;ClInclude Include="User.h" /gt; lt;ClInclude Include="UserCredentials.h" /gt; lt;ClInclude Include="UserManager.h" /gt; lt;/ItemGroupgt; lt;ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"gt; lt;Linkgt; lt;OptimizeforMemorygt;falselt;/OptimizeforMemorygt; lt;AdditionalOptionsgt;-pthread %(AdditionalOptions)lt;/AdditionalOptionsgt; lt;/Linkgt; lt;ClCompilegt; lt;CppLanguageStandardgt;c 17lt;/CppLanguageStandardgt; lt;CLanguageStandardgt;c11lt;/CLanguageStandardgt; lt;AdditionalOptionsgt; lt;/AdditionalOptionsgt; lt;PreprocessorDefinitionsgt; lt;/PreprocessorDefinitionsgt; lt;/ClCompilegt; lt;PostBuildEventgt; lt;Messagegt;xylt;/Messagegt; lt;/PostBuildEventgt; lt;/ItemDefinitionGroupgt; lt;ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"gt; lt;Linkgt; lt;AdditionalOptionsgt;-pthread %(AdditionalOptions)lt;/AdditionalOptionsgt; lt;/Linkgt; lt;ClCompilegt; lt;UnrollLoopsgt;truelt;/UnrollLoopsgt; lt;/ClCompilegt; lt;/ItemDefinitionGroupgt; lt;Import Project="$(VCTargetsPath)Microsoft.Cpp.targets" /gt; lt;ImportGroup Label="ExtensionTargets" /gt; lt;/Projectgt;
…и из .vcxproj.user
файла:
lt;?xml version="1.0" encoding="utf-8"?gt; lt;Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"gt; lt;PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"gt; lt;DebuggerFlavorgt;LinuxDebuggerlt;/DebuggerFlavorgt; lt;RemoteDebuggerWorkingDirectorygt;{the-path}lt;/RemoteDebuggerWorkingDirectorygt; lt;RemoteDebuggingTargetgt;{my-ip}(username={my-user-name}, port=22, authentication=None)lt;/RemoteDebuggingTargetgt; lt;RemoteGDBPathgt; lt;/RemoteGDBPathgt; lt;/PropertyGroupgt; lt;/Projectgt;
Комментарии:
1. Вы изменили некоторые конфигурации или, возможно, на некоторые конфигурации повлияла повторная установка? Возможно, вам потребуется проверить конфигурации подключения и сосредоточиться на части отладки. Если вы следовали некоторым руководствам по настройке ранее, пожалуйста, проверьте их еще раз.
2. Конфигурация проекта точно такая же. Или кого ты имеешь в виду? И я проделал те же шаги, чтобы настроить сервер и Visual-Studio, как и в прошлый раз, где это работало.