Reputation: 37121
I would like to statically link my C application against the C standard library that I have installed. I want to ensure that the C++ standard library is not linked.
I have tried passing -nodefaultlibs
, but this also disables the C library.
How do I disable the C++ standard library and force C mode?
Upvotes: 0
Views: 583
Reputation: 33757
Link with gcc
instead of g++
. gcc
does not link in the standard library by default, unlike g++
.
Upvotes: 4