I am trying to make a static library using Code::Blocks and when I make a new static library project it generates a cpp file with functions encased with extern "C" I am just wondering if this is necessary or if I can write the functions in normal c++ as well.

Recommended Answers

All 2 Replies

Oh, also what other types of syntax can be used in static libraries? structs? classes? inheritance? templates?

> I am just wondering if this is necessary or if I can write the functions in normal c++ as well.

No, it isn't necessary. As always, you would need to build both the library and the program using the library with the same compiler (version).

> Oh, also what other types of syntax can be used in static libraries?

Anything that you could use in a program without libraries.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.