How to use LDFLAGS in makefile

前端 未结 3 1431
广开言路
广开言路 2020-11-28 04:26

I am new to Linux OS. I am trying to compile a .c file using a makefile. The math library has to be linked. My makefile looks like this:

CC=gcc
         


        
3条回答
  •  [愿得一人]
    2020-11-28 04:48

    Seems like the order of the linking flags was not an issue in older versions of gcc. Eg gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) comes with Centos-6.7 happy with linker option before inputfile; but gcc with ubuntu 16.04 gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413 does not allow.

    Its not the gcc version alone, I has got something to with the distros

提交回复
热议问题