Cannot use a relative Gcc path

Sysprogs forums Forums VisualGDB Cannot use a relative Gcc path

This topic contains 6 replies, has 2 voices, and was last updated by  support 5 months, 3 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20697

    krs
    Participant

    I get a gcc not found error when I press MakeFile Settings -> SycronizeSysRoot from VisualGDB.

    This works:

    <?xml version=”1.0″?>
    <CustomToolchain xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
    <Toolchain>
    <UnixSystem>false</UnixSystem>
    <AdditionalPathDirectories>
    <string>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\</string>
    </AdditionalPathDirectories>
    <RequireCtrlBreak>false</RequireCtrlBreak>
    <SourceDirMapping>
    <Directories />
    <PathStyle>Unknown</PathStyle>
    </SourceDirMapping>
    <Name>x86_64-nilrt-linux</Name>
    <UniqueID>com.sysprogs.imported.x86_64-nilrt-linux</UniqueID>
    <Location>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr</Location>
    <GCC>d:\IMS\GWTT\Software\NonEmbedded\VisualStudio\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe</GCC>
    <GXX>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-g++.exe</GXX>
    <GDB>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gdb.exe</GDB>
    <AR>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-ar.exe</AR>
    <OBJCOPY>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-objcopy.exe</OBJCOPY>
    <Make>$(VISUALGDB_DIR)\make.exe</Make>
    <UseCygwinBash>false</UseCygwinBash>
    </Toolchain>
    <Type>Linux</Type>
    <Version>
    <Revision>0</Revision>
    </Version>
    <Name>x86_64-nilrt-linux</Name>
    <IsShared>false</IsShared>
    </CustomToolchain>

    This does not work:

    <?xml version=”1.0″?>
    <CustomToolchain xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
    <Toolchain>
    <UnixSystem>false</UnixSystem>
    <AdditionalPathDirectories>
    <string>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\</string>
    </AdditionalPathDirectories>
    <RequireCtrlBreak>false</RequireCtrlBreak>
    <SourceDirMapping>
    <Directories />
    <PathStyle>Unknown</PathStyle>
    </SourceDirMapping>
    <Name>x86_64-nilrt-linux</Name>
    <UniqueID>com.sysprogs.imported.x86_64-nilrt-linux</UniqueID>
    <Location>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr</Location>
    <GCC>d:\IMS\GWTT\Software\NonEmbedded\VisualStudio\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe</GCC>
    <GXX>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-g++.exe</GXX>
    <GDB>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gdb.exe</GDB>
    <AR>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-ar.exe</AR>
    <OBJCOPY>$(ProjectDir)\../../../\Dependencies\x64LinuxCompiler\sysroots\i686-nilrtsdk-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-objcopy.exe</OBJCOPY>
    <Make>$(VISUALGDB_DIR)\make.exe</Make>
    <UseCygwinBash>false</UseCygwinBash>
    </Toolchain>
    <Type>Linux</Type>
    <Version>
    <Revision>0</Revision>
    </Version>
    <Name>x86_64-nilrt-linux</Name>
    <IsShared>false</IsShared>
    </CustomToolchain>

    #20700

    support
    Keymaster

    Hi,

    Sorry, this is actually by design – VisualGDB manages toolchains independently from projects (e.g. creates and maintains MSBuild property files, IntelliSense setup files, etc), so that multiple projects can reuse the same settings. As a result, it needs to know the absolute toolchain location without knowing the project location.

    Specifying $(ProjectDir) in the toolchain XML file will get this syntax copied to MSBuild files, so most of the build will likely work, although all advanced functionality (like sysroot synchronization, or IntelliSense file caching) may break as VisualGDB expects the location to be project-independent.

    Please note that the project/settings files won’t hardcode any toolchain directories – instead they contain the toolchain ID and version, so you can easily share them between multiple computers with different toolchain directories. If this doesn’t help, please let us know what you are trying to achieve and we will try to suggest a configuration that will work.

    #20709

    krs
    Participant

    I have the following folder structure:

    i686-nilrtsdk-mingw32 – with CustomToolchain.xml in \USR folder
    project1
    project2
    project3

    All projects use the same toolchain file. (same toolchain ID in .vcxproj)

    If I understood you correctly I cannot use a VS Macro or User Variable because it is project independent.
    So… could I use inside CustomToolchain.xml paths relative to the CustomToolchain.xml file itself?

    • This reply was modified 6 months ago by  krs.
    #20721

    krs
    Participant

    Can I use $(TOOLCHAIN_ROOT) instead of absolute path?

    #20742

    support
    Keymaster

    Hi,

    Sorry for the delay. We have added experimental support for relative paths in CustomToolchain.xml (using the $(ToolchainDir) syntax) to this build: http://sysprogs.com/files/tmp/VisualGDB-5.4.1.2185.msi

    Let us know if it works for you (you will need to delete the CustomToolchain.xml file and re-import it in order to get the correct path syntax).

    #20757

    krs
    Participant

    I have installed the provided build. created a new CustomToolchain.xml but the paths inside are not recognized:

    <?xml version=”1.0″?>
    <CustomToolchain xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
    <Toolchain>
    <UnixSystem>false</UnixSystem>
    <AdditionalPathDirectories>
    <string>$(ToolchainDir)\</string>
    </AdditionalPathDirectories>
    <RequireCtrlBreak>false</RequireCtrlBreak>
    <SourceDirMapping>
    <Directories />
    <PathStyle>Unknown</PathStyle>
    </SourceDirMapping>
    <Name>x86_64-nilrt-linux</Name>
    <UniqueID>com.sysprogs.imported.x86_64-nilrt-linux</UniqueID>
    <Location>.</Location>
    <GCC> $(ToolchainDir)\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe</GCC>
    <GXX> $(ToolchainDir)\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-g++.exe</GXX>
    <GDB> $(ToolchainDir)\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gdb.exe</GDB>
    <AR> $(ToolchainDir)\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-ar.exe</AR>
    <OBJCOPY> $(ToolchainDir)\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-objcopy.exe</OBJCOPY>
    <Make>$(VISUALGDB_DIR)\make.exe</Make>
    <UseCygwinBash>false</UseCygwinBash>
    </Toolchain>
    <Type>Linux</Type>
    <Version>
    <Revision>0</Revision>
    </Version>
    <Name>x86_64-nilrt-linux</Name>
    <IsShared>false</IsShared>
    </CustomToolchain>

    #20760

    support
    Keymaster

    Hi,

    This could happen if we missed some scenario. Please let us know what exactly do you mean by “paths not recognized”. If you get a specific error message while trying to build or debug a project, please ensure you quote the entire error text and also let us know what exactly triggers it.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.