Problem with *.XSD files in resources
-
wrote on 2 Dec 2011, 15:57 last edited by
Hello,
I have problem. I want to use XSD file as resource file. It contains some useful information.
Environment : Windows & Visual studio 2005.
Project *.vcproj is generated from *.pro file by using qmake.
Extract from *.pro :
RESOURCES += $$src_project/xml/qt4_pdf_viewer_xml.qrc
qt4_pdf_viewer_xml.qrc :
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/xml/">
<file>file_list.xsd</file>
</qresource>
</RCC>Output of compiler:
1>------ Build started: Project: qt4-pdf-viewer (projects\qt4-pdf-viewer), Configuration: Debug Win32 ------
1>Creating DataSet class using XSD ...
1>Writing file 'c:\projects\qt4-pdf-viewer\build\Win32\make\msdev.8\file_list.h'.
1>file_list.h
1>c:\projects\qt4-pdf-viewer\build\Win32\make\msdev.8\file_list.h : fatal error C1083: Cannot open compiler generated file: '....\Debug\rels\qt4-pdf-viewer" /link /dll /out:file_list.dll': Invalid argument
1>Build log was saved at "file://c:\projects\qt4-pdf-viewer\build\Win32\Debug\rels\qt4-pdf-viewer\BuildLog.htm"
1>qt4-pdf-viewer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 12 up-to-date, 0 skipped ==========!!!!!
If you:
1] change qrc file for example to :
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/xml/">
<file>file_list.xsd</file>
</qresource>
</RCC>2] rebulid project
So compile pases without problems. Problem is XSD postfix of resource file.
What is problem ??? -
wrote on 2 Dec 2011, 16:19 last edited by
I forgot write : I use QT 4.7.4
-
wrote on 2 Dec 2011, 20:33 last edited by
isn't those two qrc files you posted the precise same ?
-
wrote on 2 Dec 2011, 20:40 last edited by
No, realy no.
Difference is only in postfix of file.
Files exist in both cases. -
wrote on 2 Dec 2011, 20:43 last edited by
Sorry I see it.
Second valid qrc file is for example :<!DOCTYPE RCC>
<RCC version=“1.0”>
<qresource prefix=”/xml/”>
<file>file_list.xxx</file>
</qresource>
</RCC>Difference is only in postfix contained file.
-
wrote on 2 Dec 2011, 20:50 last edited by
maybe the xsd extension enables some type of namespace / validation checking ?
Edit: forget what I said :)
-
wrote on 2 Dec 2011, 20:59 last edited by
I see this is related some use of xsd with VS.. then I can't suggest anything helpful.
But if that is not the intention then it probarly clashes with this:
http://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio -
wrote on 2 Dec 2011, 21:21 last edited by
Thanks. I will try study it.
I suppose, that it is some bug in qmake. But I dont know how I can avoid it.
Maybe by copying xsd file into other file in first step (realized by independent vcproj project). And compile my proces with qrc contained copy of xsd with different postfix.
But it is obscure solution :-). -
wrote on 2 Dec 2011, 21:47 last edited by
you could compile the ressource file and include as an out of exe ressource, something like rcc -binary ...qrc
its of course mentioned in the documentation somewhere. -
wrote on 2 Dec 2011, 22:07 last edited by
good idea
thanks
1/10