sdgfsdh
sdgfsdh

Reputation: 37121

How do I tell GCC to link the C standard library, not the C++ one?

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

Answers (1)

Florian Weimer
Florian Weimer

Reputation: 33757

Link with gcc instead of g++. gcc does not link in the standard library by default, unlike g++.

Upvotes: 4

Related Questions