开发者

Adding a library to an MFC project

开发者 https://www.devze.com 2023-03-16 12:15 出处:网络
So this might be super basic, but that\'s what happens when you get a job you aren\'t wholly qualified for, right?

So this might be super basic, but that's what happens when you get a job you aren't wholly qualified for, right?

I've got an MFC project, everything is working great, but I'm trying to add the string and stringstream directive into the project.

No matter where I put #include <string> and #include <sstream> I get the "string: undeclared identifier" error.

Tha开发者_开发技巧nks in advance? :D


Try std::string instead of string, since string is in the std namespace


Concerning that topic of this is

Adding a library to an MFC project

and I was searching for solution how to add dll to MFC project I will add here solution as time saver for all of you...

If you want to reference library you need 3 files:

  1. LibraryName.h
  2. LibraryName.lib
  3. LibraryName.dll

Follow steps:

  1. Add all these to you solution.
  2. In your application file add header file using #include "LibraryName.h"
  3. Click right mouse button on your project and chose "References"
  4. Go to Configuration Properties -> Linker -> Input
  5. In field Additional Dependencies write "LibraryName.lib", you can also check Ignore All Default Libraries to No

Compile and Have Fun!

0

精彩评论

暂无评论...
验证码 换一张
取 消