PDA

View Full Version : dll yet again



frenk_castle
18th October 2009, 22:08
Ok. I have made a shared library project. Compiled it into a dll. It is very simple dll just defining one class with one member and one method. Then I tried to add this dlll to a new project and failed. I have read post on this forum concerning this problem but I am still unable to do this. Probably missing something stupid.

In the attachment are MyClass project which makes the dll, Using project in which I what to add MyClass.dll and Using1 project in which I tried to add MyClass.dll and failed. Please take a look and tell me what am I doing wrong.

I have tried this using Qt 4.5.2 and Windows XP servise pack 2.

Thanks in advance.

spirit
19th October 2009, 08:05
read this (http://www.qtcentre.org/forum/f-newbie-4/t-dll-using-qt-17255.html/?highlight=QWidget) thread.

frenk_castle
19th October 2009, 10:00
First thanks. I will take I detailed look at your example after a completely wake up. :)

If I see correctly and I say again I just woke up so my mental powers are not 100% you needed the whole project which makes the dll in order this to work. I was trying to make the dll as a shared library using Qt and then just connect that complete dll to my next project. For instance. I make a dll which has classes used for fractal computing. I email that dll to my friend who is a physicist he connect his project to my dll and use my classes for his project.

I know that this may be ungrateful on my part but can you connect Qt project to an already compiled dll, dll is made by Qt also, and use it without anything else? When i think about it the answer will probably be no but just to be sure.

Thanks in advance.

George Neil
19th October 2009, 13:38
I tried out your zip file with the following modifications...

First in your usage1, include the path for the header file. This removes the compiler errors..

Second: linker - Aditional Library Directories: include the path to the lib file
Aditional Dependencies : include MyClass.lib
Also copy your dll file to the usage1 debug folder.

frenk_castle
19th October 2009, 23:01
Thanks. I will try it like that. If it is not to much trouble could you zip your modifications and put that modified and working project back on the board just in case I can't replicate your instructions. Thanks again.

spirit
20th October 2009, 06:54
this is your example with some modifications. after compilation you should put dll in directory with executable.

frenk_castle
20th October 2009, 07:31
Thank you guys very much.