Problem with *.XSD files in resources
-
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 ??? -
I forgot write : I use QT 4.7.4
-
isn't those two qrc files you posted the precise same ?
-
No, realy no.
Difference is only in postfix of file.
Files exist in both cases. -
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.
-
maybe the xsd extension enables some type of namespace / validation checking ?
Edit: forget what I said :)
-
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 -
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 :-). -
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. -
good idea
thanks