after being recommended on using VS 2005 here from you folks I did so, and everything fine so far but now there is a problem, I was following a tutorial, and the writer was using VS 2003.
The thing is that he created dll then he used dll functions in another c++ project everything fine on his computer (his studio created lib file) besides dll there is supposed to be created a lib file, but my VS 2005 (pro.) is not creating one and so I can't really import functions in another project.
Basically I'm interested to create functions in C++ and use them in C#, can anyone help accomplish this? (I don't really need this for real world program its just for learning purposes)
Thanx in advance
The compiler will not generate the .lib file if the dll contains no exported functions or objects. Put this in one of the *.cpp files and you will get a .lib file. Then do the same thing with the other functions/objects you want to be visible outside the dll.
__declspec( dllexport ) int foo;
I did that
and on the actuall project I tried to import it this way:
extern "C" __declspec( dllexport ) int foo;
but I get errors and I see no .lib file!
extern "C" __declspec( dllimport) int foo;
Can someone tell me as well on how to use these functions in a C# project ?
I'm not going to answer the same question on two different boards.