Reputation: 82
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
Reputation: 717
Have you tried using the following syntax?
-Wl,--whole-archive
I.e., no space after the comma and two dashes.
Upvotes: 12