thanks for your response,
i only the dll file, not the lib file. can my program just work with the dll alone? or is it possible to generate lib file from the dll file?
Thank you,
mrpc_cambodia
Main Topics
Browse All TopicsHello,
I am new to C++ programming. I started to develop application using Visual Studio C++ 2008. in my application, i need to use some function in a DLL file provided by a third party software vendor.
I dont know how to import that dll into my application? can you show me how? actually i only have one file with DLL as file extension. is it enough to import and use it? how about *.lib file? can you tell me the difference between this two type of file?
i received the below error when i build my applicaiton, hope it gives you further awareness of my problem:
Error 1 error LNK2019: unresolved external symbol "public: virtual __thiscall ImqStr::~ImqStr(void)" (??1ImqStr@@UAE@XZ) referenced in function _msgTrigger MsgExits.obj
Thanks in advance,
mrpc_cambodia
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
thanks drichards,
now i can compile my program. but to compile i need to specify 4 lib files instead of 1. and with me i only have one dll file with the same name as one of my lib file.
so can you clarify me do i need to have 4 dll files that correspond to the 4 lib files in order for my application to execute sucessfully? because now it can compile.
Thanks so much,
mrpc_cambodia
These are the libs file that i need to specify to the linker input, sorry it's not 4 files, but 5. only the first 2 files and the last one, i can find it's corresponding dll file:
imqb23vn.lib
imqs23vn.lib
libdiapi.lib
libwdisys.lib
WSock32.Lib
I have included my code file and header in the attachment as well. Actually this code is a template from an application. once i successfully compiled it, and deployed the dll to the target application, it can't be opened for execution. the original dll is 20kb, but my version is only 7kb.
In addition, when i compile dll project, it produces one dll file and one lib file. but for this project, the lib file is not produced at all.
I need your advice.
Thanks so much, you have given me alot of help.
mrpc_cambodia
WSock32 is a standard windows library and the Winsock dlls are on the machine (they are not named the same, and that's OK). The first two apear to be IBM MQ Series libraries, and I don't konw what the dlls are for those. Try runnign the code and it wil tell you if you are missing dlls.
If you have runtime issues, look in the system folders (<windows root> and <windows root>\System32) and in the folder where you program is installed (or the Visual Studio output folder). If the dlls are not there, you need to move them to one of these locations.
I am thinking of one thing that could cause the problem. i compile my application with visual studio 2008. and the final dll is to be used by a third party application which was build with visual studio 6. So could there be compatibility problem?
i am going to try to recompile my application with Visual C++ 6 compiler.
Thanks so much.
mrpc_cambodia
Is this with mismatched compiler versions between your main app and the dll? This is typical of the type of error you get when it doesn't work. Otherwise, it may just be that you have passed bad parameters to the dll routine. You are now into runtime debugging, which is more involved than figuring out build problems.
with the application that i'm refering to so far. it has a sample dll and a sample C++ code which i can modify to compile into dll to work with the application.
the strange thing is: i have tried both dlls, and the same error message is produced in the event viewer.
Other than this error, the application works fine on my platform.
I do really appreciate your help,
mrpc_cambodia
I don't think it does involve any bad paramater passing. i just copy and paste the dll in a designated folder and as in the product documentation, it said so.
it leads me to think it could be a platform problem. I'll investigate more and let you know any further clue i could found.
Thank you,
mrpc_cambodia
Thanks so much for your effort.
Your contribution is really amazing. With your clear instruction, my problem could have been solved since the beginning.
Now my problem is solved. it's not an error on my side, it's the documentation from the vendor that is the source of the error.
Thank you,
Have a nice day.
Business Accounts
Answer for Membership
by: drichardsPosted on 2008-10-31 at 23:19:31ID: 22855875
Assuming a shared library (dll), the dll is the runtime component and the lib file is the compile time component of the third party software. You need to go into the project properties and add a few things:
1) Under Linker->General, add a the folder where the lib is found in "Additional Library Directories"
2) Under Linker->Input, add the lib file name (e.g. mycomponent.lib)
That will resolve your link problems.
Then copy the dll into the folder with your executable, and it should run.