Use g++ instead of gcc on .c files

Sysprogs forums Forums VisualGDB Use g++ instead of gcc on .c files

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

    I would like VisualGDB to use g++ instead of gcc on .c files. How do I change to Project Properties to do that? (I know I can manually edit the Makefile, but I need to be able to do this on many projects, so I can’t do that.)

    #11007
    jmkresse
    Participant

    In other words, I want make to use $(CXX) instead of $(CC) on .c files, and I want to avoid having to hand edit the Makefile to do that.

    #11008
    jmkresse
    Participant

    I think I found an answer to my own question. If I’m incorrect, or if someone has a better or more elegant answer, please post.

    My answer is to do the following:
    In the VisualGDB Project Properties, under Makefile settings, under Build tools, in Additional arguments, I put:

    CC=$(CXX)
    #11011
    support
    Keymaster

    Hi,

    That should work. Another option would be to add “-x c++” to the CFLAGS to explicitly tell GCC to treat the file as a .cpp file.

    #11016
    jmkresse
    Participant

    Thanks! I think I like that option better.

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