user2355104
user2355104

Reputation: 82

link issue with whole-archive & no-whole_archive options

I tried to use -whole-archive/-no-whole-archive options for linking. The gcc is 4.1.2. when I try:

g++ ...... -Wl, -whole-archive libA.a -Wl, -no-whole-archive libB.a ...

It says -whole-archive and -no-whole-archive are unrecognized. When I replace -whole-archive with --whole-archive, and same to no-whole-archive, it says

error: unrecognized command line option "-fwhole-archive"
error: unrecognized command line option "-fno-whole-archive"

Does anyone know where the problem comes from?

Upvotes: 3

Views: 8454

Answers (1)

Atafar
Atafar

Reputation: 717

Have you tried using the following syntax?

-Wl,--whole-archive

I.e., no space after the comma and two dashes.

Upvotes: 12

Related Questions