Error when trying to specify the ldflags in a gyp file

1.5k views Asked by At

I am trying to create a makefile through GYP. I had errors saying that ld cannot find the necessary libraries so I included them in ldflags in the gyp file. The code I have is:

'link_settings': {
        'ldflags': [
          '-L/path/to/lib1' , '-L/path/to/lib2', ...
        ],
        'libraries': [
          '-llib1',
          '-llib2', ...
        ],
      },

The previous errors dissappeared, but now I am getting a new one

group ended before it began (--help for usage)
collect2: ld returned 1 exit status

I tried adding the libraries in the 'libraries' list with an absolute path but the result is the same. I saw this question but I don't thing it helps me (or I can't understand how). I would really appreciate your help!

1

There are 1 answers

0
user2928287 On BEST ANSWER

I solved this error by specifying the exact libraries that I wanted to include from each directory:

'ldflags': [
      '-L/path/to/lib1 -llib1' , '-L/path/to/lib2 -llib2', ...
    ],