Specifying linker options with MSBuild

Sysprogs forums Forums VisualGDB Specifying linker options with MSBuild

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11752
    jmkresse
    Participant

    I’m trying to take a project that works fine using Gmake and set up a new project that does the same thing, but using MSBuild instead.

    It looks like I’m running into problems specifying that I want a map file (in Gmake, one of the LDFLAGS was -Map=Debug/xxxxxx.map). It’s also complaining it can’t find the library (I used the same settings as in Gmake).

    What do I need to fix?

    Thanks!

    #11756
    support
    Keymaster

    Hi,

    Please use the -Wl,-Map=… syntax instead. Note that if you are using MSBuild, you can enable map file generation via VS Project Properties -> Linker Settings -> Advanced (not VisualGDB Project Properties).

    #11773
    jmkresse
    Participant

    Thanks for this information.

    I am still having problems, though, with getting this to work. It looks like I am possibly having problems with the syntax for the directory separator. For the Map file name, I have tried Debug/xxxxx.map, Debug\xxxxx.map, Debug\/xxxxx.map, and other permuations without success. What is the correct syntax for this?

    (And I am having a similar problem with one of my Preprocessor Definitions. When I use Gmake, I used -DTH_FILE_DIR_PATH=\”../IOFiles/\”, and again, with MSBuild, I have tried various permutations of “, /, and \ without success. What is the appropriate syntax for MSBuild?)

    Thanks!

    #11774
    support
    Keymaster

    Hi,

    Normally just a forward slash (/) should suffice. If you want to define a macro containing a string, you can use the syntax shown below:

    E.g. the following code will now compile:

        const char *test = MYMACRO;

    Please note that using string literals in macros specified via command line might cause IntelliSense errors that are fixed in the upcoming v5.3 Preview 4.

    #11775
    jmkresse
    Participant

    Thanks! It looks like I got things working.

    [One note: MSBuild puts the object files, the executable, and the map file in different places than Gmake, so I also had to adjust things so they would end up in the same directories that Gmake used (we have scripts which rely on the executable and map file to be in a certain directory).]

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.