Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I restarted coding in C++ a couple of months ago, after several years of C# programming. And in C#, Using Microsoft Visual C#, I would create dlls and then use the dlls in my programs. All I would have to do is import of course and add the reference through the gui. I tried doing something similar in C++, but I can't get it to work. I create a dll project and then when I try to use the dll in C++ it says class not found. I hope I'm giving a clear view of what I would like to do.

Another question that might help me or might not. Let's say that I want to use iostream. iostream is in a dll correct? I want to do something like that.
Posted
Updated 1-Jul-11 5:30am
v2

1 solution

You can use static or dynamic linking. For VS2005 you can find samples here and here
I would recommend dynamic linking.

If you need to use libraries which you don't own, you'll need the .lib file along with the .DLL. You must specify the additional libs in project's properties->Configuration properties->Linker->Input->Additional Dependencies. Of course, you must ensure the compiler can find them. If they are not in PATH, then you can specify where to search: Configuration properties->Linker->General->Additional Library Directories

Iostream is part of standard libraries, you don't need to include anything.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900