You guys might thinking they are lot of questions in stack overflow based on this but the thing is that I am creating .dll file in visual studio 2010,as per I have learnt in internet lib file contain the address and dll file contain the code part.When you build the project the visual studio by itself should create the .lib,.exp,.dll etc files in the debug folder of the project but in my case only, .dll file created,but not the .lib,.exp etc can anyone solve this for me and tell where I am going wrong? answering this is surely appreciable. Thank you in advance
Asked
Active
Viewed 709 times
0
-
Possible duplicate: http://stackoverflow.com/questions/584041/how-do-i-build-an-import-library-lib-and-a-dll-in-visual-c – JBentley Apr 02 '14 at 12:41
1 Answers
1
Right click your project, click on properties. Enter the general tab under "Configuration properties", and in the drop down menu at "Configuration Type", select "Static Library (.lib)".

Ben
- 1,816
- 1
- 20
- 29
-
The OP wants an import library .lib, not a static library .lib. See the duplicate I posted above. – JBentley Apr 02 '14 at 12:39
-
Did you mark any of your DLL functions for export? That means using the dllexport keyword. – ScottMcP-MVP Apr 02 '14 at 12:40
-
hey jBentely, thanks for reply, the thing is that,this will create static library file(.lib) but not a dynamic one. I need both .dll and .lib. – Santhosh Apr 02 '14 at 12:40
-
@Santosh Yes, that is why I commented. See the duplicate that I posted in a comment to your question. – JBentley Apr 02 '14 at 12:42
-
@ScottMcP-MVP, ya i have wriiten code in my header like this: #include
namespace subc{ _declspec(dllexport) int algo(); } and defining in .cpp file like this :#include"hey.h" using namespace std; using namespace subc; int algo(){ int b=10; int c=20; int a=b+c; cout< – Santhosh Apr 02 '14 at 12:42 -
from command prompt of visual studio I can able to create .lib and .dll file by help this like https://www.youtube.com/watch?v=Jzh4ZULXsvo but why can't in visual studio application. please look in to it – Santhosh Apr 02 '14 at 12:47
-
@JBentley,i saw the link it's same question and the answer that link as provided I have worked it in the same procedure,then also I am not able to generate .lib and .dll files in my debug of project. – Santhosh Apr 02 '14 at 12:55
-
@Santosh Ok, but if you want an import library then why have you marked this answer as accepted when it is talking about a static library, and you yourself have said the answer doesn't solve your problem? You're just creating confusion for future readers of this question, making it look like the problem was solved when it wasn't. – JBentley Apr 02 '14 at 13:04
-
ya sry,at once i thought it's gud solution, but after i worked on it,it won't worked for me and i forget to change the accepted answer sign back to unsolved..sry again – Santhosh Apr 02 '14 at 14:27