How to use an older version of gcc in Linux

前端 未结 4 1222
太阳男子
太阳男子 2020-12-20 13:39

In Linux I am trying to compile something that uses the -fwritable-strings option. Apparently this is a gcc option that doesn\'t work in newer version of gcc. I installed gc

4条回答
  •  清酒与你
    2020-12-20 14:23

    You say nothing about the build system in use, but usually old versions of gcc can be invoked explicitly, by something like (this is for an autotools-based build):

    ./configure CXX=g++-3.4 CC=gcc-3.4
    

    For a make-based build system, sometimes this will work:

    make CXX=g++-3.4 CC=gcc-3.4
    

    Most makefiles ought to recognise overriding CC and CXX in this way.

提交回复
热议问题