Did you run qmake to get a new Makefile after adding Q_OBJECT?Originally Posted by niko
I'm currently doing a exercise of the OopDocbook:
http://cartan.cas.suffolk.edu/moin/O...taobjects.html
(free registration required to view this)
I created a very simple PetManager (as described in the example) - and link this to libdataobjects. (download here: http://cartan.cas.suffolk.edu/oopdocbook/dist/)
From my pro-file:
INCLUDEPATH += d:\qt\libs\dataobjects
win32:LIBS += d:\qt\libs\libdataobjects.a
(i complied libdataobjects.a myselfe)
....when i now use the DataObject-Class from libdataobjects compiling and linking works fine, but the compiled application exits with: "Can't initialize the Application (0xc0000005)."
I found out that this stands for Permission denied. But what does that mean?
When I don't use Q_OBJECT in the class that inherits DataObject everything works fine (but i can't use signal/slots etc then ofcourse)
please help!
(PS: I'm on Win2k, Qt4.1, MinGW)
Did you run qmake to get a new Makefile after adding Q_OBJECT?Originally Posted by niko
thanks for the reply,
yes i did.Did you run qmake to get a new Makefile after adding Q_OBJECT?
Some more information I found out:
- When i start the debugger and make exactly one step-into the application quits with the same error-message.
- when i don't link to libdataobjects but instead copy the source-files of the used classes to my application everything works fine
(so i assume it's a problem with the linking...)
Did you compile that library in release or debug mode? Do you use the same mode for your application?
i did build both in debug mode.
and tried both in release-mode too - doesn't help.
I attached my files, perhaps someone would like to help and see if he can reproduce the problem
(or - better - tell me what i'm making wrong)
steps to reproduce:
Qt Code:
unpack attached zip set CPPLIBS=absolutepath to libs-dir (used by qmake-scripts) cd libs qmake make cd .. cd PetManager qmake make debug\PetManagerTo copy to clipboard, switch view to plain text mode
I think it works:Originally Posted by niko
(I use PLD Linux and Qt 4.1.1).ohje
"
<object class="PetList" name="" >
<object class="Pet" name="" >
<property name="Type" type="QString" value="Kuh" />
<property name="Breed" type="QString" value="Schwarzbunt" />
<property name="Name" type="QString" value="Serena" />
<property name="ID" type="int" value="20" />
<property name="Birthday" type="QDate" value="2001-02-12" />
<object class="Maintenance" name="" >
<property name="Event" type="QString" value="Klauen schneiden" />
<property name="Date" type="QDate" value="2006-01-12" />
<property name="Cost" type="int" value="100" />
</object>
</object>
</object>
"
Hallo
Did you buld those libraries as static ones or as DLLs? Did you try to copy all DLLs to the directory where your executable is?
much thanks for testing!
(how bad it works for you... probably only a problem on win32?)
[qoute]Did you buld those libraries as static ones or as DLLs? Did you try to copy all DLLs to the directory where your executable is?[/quote]
as dll (the standard-behaviour)
...and yes - i copied the dlls into the direcotory.
Yes, I just checked the sources and all classes are declared like this:Originally Posted by niko
Which means that they aren't ready for use in DLLs (in short: you can't use those classes outside the DLL, because they're not exported).Qt Code:
Q_OBJECT // ... };To copy to clipboard, switch view to plain text mode
It should be:Where EXPORT macro is either __declspec(dllimport), __declspec(dllexport) or empty. See this thread for more info.Qt Code:
Q_OBJECT // ... };To copy to clipboard, switch view to plain text mode
aaah, much thanks for that hint!
i compiled the libary now static and everything is working just fine!
big thanks!
Bookmarks