B. Bergeron
B. Bergeron

Reputation: 90

How to use of external class without specifying them in #include directives?

I have a solution compose of many C++ projects and most of them use the "std::string" class. However, there's not a single #include directive for the header which results in many C2039: 'string' is not a member of 'std' fatal errors. Therefore, whoever previously made the solution must have a way to tell Visual Studio to auto-include the header. How can I do such things?

Upvotes: 2

Views: 87

Answers (1)

B. Bergeron
B. Bergeron

Reputation: 90

Based on VTT's comment, I found that you can "Force include" file in Configuration Properties => C/C++ => Advanced and add "(header name)" to the Forced include File field. That's one way to do it.

Upvotes: 1

Related Questions