How to compile Image Writer?
Hello,
I downloaded the latest version 0.5 of Win32DiskImager.
I copied the files in c:\Projects Qt\src
I installed QT SDK 4.8.0 and tried to compile the Win32DiskImager.
Using the compile.bat I get:
C:\Projects QT>compile
C:/QtSDK/
mingw32-make[1]: Entering directory `C:/Projects QT/src'
Makefile.
mingw32-make[1]: Leaving directory `C:/Projects QT/src'
mingw32-make: *** [release] Error 2
Press any key to continue . . .
I also tried the Visual Studio 2010 Addin of QT.
I get also a lot of errors:
diks.h: error C1014: too many include files: depth = 1024
And 'include file 'disk.h' includes itself
And cannot open source file QApilcation
And cannot open source file QtGui
Can someone help me?
What can I do to make this work?
Thank your very much for your help.
Paul Rattink
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Paul Rattink
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
I don't have a good idea of why you're having a problem, but a few things to try -
* Use a path without a space in it. Don't know if it matters, but maybe worth a shot.
* I'm not sure a build's been done with QT 4.8. Try the 4.7 build (in SDK 1.1.2, vs SDK 1.2).
* Do you really ned to compile? If not, try the binary download....
I'm not familiar with the VS2010 addin at all....
Revision history for this message
|
#2 |
Hello Jeff B,
Thank you very much for helping me. I installed the QTSDK version 4.7 you advised me. But I get the same errors. Later I set the environment variabele of Windows XP to:
QMAKESPEC = C:\QtSDK\
And I used the original compile.bat file and added the path:
cd src
C:\QtSDK\
c:\QtSDK\
cd ..
After running the compile.bat I get the error 'disk.h', because in disk.h
#include "disk.h". The file includes itself:too many include files.
I get an endless list of disk.h: errors...
I don't understand: EVERY ONE should have this error...because the file disk.h includes itself????!
I thougth I had a briliant Idea, I added macro's:
#ifndef DISK_H
#define DISK_H
(..original file lines)
#endif // DISK_H
But...I get another list of errors:
starting with:
disk.h: In function 'bool isVolumeUnmount
disk.h:134: error: 'FSCTL_
disk.h: At global scope:
disk.h:217: error: 'PSTORAGE_
disk.h:218: error: 'DEVICE_NUMBER' has not been declared
disk.h: In function 'BOOL GetDisksPropert
disk.h:220: error: 'STORAGE_
disk.h:220: error: expected ';' before 'Query'
disk.h:226: error: 'Query' was not declared in this scope
(...)
Note: There are however several qmake.exe files.
1C:\QtSDK\
2C:\QtSDK\
3C:\QtSDK\
4C:\QtSDK\
5C:\QtSDK\
6C:\QtSDK\
7C:\QtSDK\
8C:\QtSDK\
Which one should I use..?
I really do hope you have can give me some tips to solve the compile problem,
because I want to use the ImageWrite to do some MD5 Hash checking after
he has burned an USB Stick.
I really like the Win32ImageMaker...! So I do hope you can give me a clue how
to compile the source of this program.
Can you help me? Do I have to set more Environment variables..?
Greetings from Holland, Paul
Revision history for this message
|
#3 |
Sorry - just seeing your response.
*My* "disk.h" specifically does NOT "#include 'disk.h'". I agree that would be a problem. Not sure why yours would differ... Corruption?
Also, what version of windows?
These are all in the windows headers:
FSCTL_IS_
PSTORAGE_
STORAGE_
You should have them defined just from inclusion of the windows headers. But, I suspect that you have some kind of corruption issue, which means that I wouldn't try to track these down that hard. Did you try the binary download?
Revision history for this message
|
#4 |
Just FYI, md5sum for 0.5 source distribution:
win32diskimager
Revision history for this message
|
#5 |
Hello Jeff,
You were right I was working with version V0.4 in stead of V0.5.
I really tried 10000 things in order to compile the source.
When I compile version V0.5 of Win32ImageMaker I get still errors:
disk.h: 60: error: 'STORAGE_BUS_TYPE' does not name a type.
disk.cpp: In function 'bool checDriveType(
disk.cpp: 337: error: 'strukct _STORAGE_
disk.cpp: 337: error: 'BusTypeUsb' was not declared in this scope
mingw32-make]1]: *** [relase/disk.o] Error 1
Note: when I start the bin-file (Win32ImageMake
'File Error. An error occured while accessing the device. This usually means something is currently accessing the device; please close all applicatins and try again.
Error 1: Incorrect function'
Revision history for this message
|
#6 |
STORAGE_BUS_TYPE is defined in winioctl.h which is included by disk.h.
What version of Windows are you using?
Revision history for this message
|
#7 |
As far as your problem with "An error occured while accessing the device" - make sure that all open windows that point to the device are closed. This includes any open explorer windows.
Revision history for this message
|
#8 |
Hello Jeff,
Again thank you for helping me.
I have new information.
I installed the Qt Creater version 4.7.3 (default installation) on the pc of my work.
It has Windows XP Professional Service Pack3.
When I start the original Win32ImageMaker.exe it does not generate an error, like I get on my PC at home.
I compiled the Image Maker source v0.5 two times, in the Qt Creator.
First with Compiler Qt4.7.3 for Desktop - MinGw4.4 (Qt SDK) Debug
I get the following:
In file included from ..\src\disk.cpp:33:
..\src\/disk.h:60: error: 'STORAGE_BUS_TYPE' does not name a type
..\src\disk.cpp: In function 'bool checkDriveType(
..\src\
named 'BusType'
..\src\
mingw32-make[1]: Leaving directory `C:/ProjectsQT/
mingw32-make[1]: *** [release/disk.o] Error 1
mingw32-make: *** [release] Error 2
The process "C:\QtSDK\
Error while building project DiskImager (target: Desktop)
When executing build step 'Make'
Secondly I compiled in Qt Creator using Compiler Qt4.7.3 for Desktop - MSVC2008 (Qt SDK) Debug
I get the following:
Note: Compiled with Qt 4.7.3 for Desktop - MSVC2008 (Qt SDK) Debug
c:\projectsqt
type redefinition
C:\Program Files\Microsoft SDKs\Windows\
of '_STORAGE_
c:\projectsqt
redefinition
C:\Program Files\Microsoft SDKs\Windows\
of '_STORAGE_
c:\projectsqt
redefinition
C:\Program Files\Microsoft SDKs\Windows\
of '_STORAGE_
c:\projectsqt
redefinition
C:\Program Files\Microsoft SDKs\Windows\
of '_STORAGE_
(...)
So the second build is more hopeful, because I got too much info..:-)
I tried already to remove the " C:\Program Files\Microsoft SDKs\Windows\
I do hope you can give me a tip to make it compile completely.
Revision history for this message
|
#9 |
Thanks for the info. Can you try a command line build, instead of using QT Creator? I haven't played around with QT Creator.
In the Image Writer directory, run clean.bat and compile.bat. See if you get the same errors.....
Revision history for this message
|
#10 |
Hello Jef,
I tried your new disk.h and I tried to use clean.bat and another compile.bat.
But I get the same errors:
Using compile.bat, with lines:
C:\QtSDK\
c:\QtSDK\
generates:
In file included from disk.cpp:33:
disk.h:65: error: 'STORAGE_BUS_TYPE' does not name a type
disk.cpp: In function 'bool checkDriveType(
disk.cpp:337: error: 'struct _STORAGE_
named 'BusType'
disk.cpp:337: error: 'BusTypeUsb' was not declared in this scope
mingw32-make[1]: *** [release/disk.o] Error 1
mingw32-make[1]: Leaving directory `C:/ProjectsQT/
mingw32-make: *** [release] Error 2
Using compile lines:
C:\QtSDK\
c:\QtSDK\
Errors. It does not compile with compile.bat.
I also tried to compile your new disk.h file with Qt Creator, selecting the MSVC2008
compiler. Still errors. The trick of using the
'#ifndef _STORAGE_
I tried to removed the contents with /*...*/, make it take the winioctl.h file, but still errors.
The compiler keeps fightng with the winioctl.h of Microsoft SDK and that of the QtSDK directory.
Jef is it not possible to send me your source and your compiler, and all the steps you have taken (like environment variables, path, direcotries) to make the
compiler work....so that I can do the same you can...?
Thanks for the support.
Revision history for this message
|
#11 |
Paul - my source is no different than your source (or at least not significantly different) - it's 0.5 with the QT sdk. My compiler is mingw.
At the beginning of my PATH env dir, I added paths to the qt bin dir in order to use QMake, and to the mingw/bin area to find mingw-make (as well as g++).
But, saying that your disk.h includes "disk.h" - mine doesn't. So, something seems completely out of sync here. It doesn't strike me as a simple path problem....
Revision history for this message
|
#12 |
Hello Jef,
I used the latest source 0.5, so the "disk.h" is now ok.
I have set the same environment paths to mingw-make32 and g++.
When I have time (I have small children...) I am going to investigate why I get the 'STORAGE_BUS_TYPE' error.
I think I need to set another path, to make the compiler find the h-file where the
'STORAGE_BUS_TYPE' type has been defined.
Maybe this is the only problem I am dealing with...!
Thanx for your support.
Revision history for this message
|
#13 |
I have small kids too, so I know the deal. :-)
I added "-E" to my CXXFLAGS in my "Makefile.Release" to see precisely where STORAGE_BUS_TYPE (and hence winioctl.h) was being defined. What I see (in "release/disk.o") is this:
-------
# 241 "c:\\perl\
mingw32/
typedef enum _STORAGE_BUS_TYPE {
BusTypeUnknown = 0x00,BusTypeScs
eSsa,BusTypeFib
BusTypeSas,
} STORAGE_
-------
So, deciphering that path, it's coming from c:\\perl/
So, it seems to be coming from my perl install, which I installed in order to configure QT (IIRC).
Since I don't believe that it's a requirement to install perl to install the qtsdk (I installed and built QT from source), I'm not sure what QT does with it's include path when that's the case.
Let me know how it's going - we'll get you there building eventually. :-)
Revision history for this message
|
#14 |
Hello Jef,
The good news I have been able to compile source 0.5 using Qt Creator!!!
I added the following lines in disk.h:
//-----------Paul copied from Q:\QtSDK\
typedef enum _STORAGE_BUS_TYPE {
BusTypeAta,
BusTypeSsa,
BusTypeUsb,
} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
// -------
just above line:
'typedef struct _STORAGE_
The Bad news is that I can't find the 'MD5 Hash' check box in the 'mainwindow.ui'
In the Win32 Disk Imager.exe I can see the checkbox 'MD5 Hash', but it isn't in my 0.5 source.
Can you help me..??
Thanx!
Revision history for this message
|
#15 |
Hello Jef,
In the latest version 0.5 zipfile, that you can download with:
https:/
the md5 hash function is not available in the source.
The binary download has the md5 function. It is not in the mainwindow.ui and the md5.h file is missing.....???
I found the mainwindow.ui file in source files of revision 37:
http://
~gruemaster/
Tobin Davis, Date Date: 2012-02-15 22:38:41 UTC
mainwindow.ui 33.1.1 2012-02-15 18:00:30 UTC 8.3K
But the md5.h is missing !!
I found the mainwindow.ui file in source files of revision 44:
http://
~image-
jeffB, Date: 2012-03-23 23:02:00 UTC
mainwindow.ui 33.1.1 2012-02-15 18:00:30 UTC 8.3K
md5.h 39 2012-02-16 15:01:56 UTC 11.5K
Conclusion: the 'binary zip'-file of version 0.5 can not be created with the 'source zip'-file of version 0.5, because an older version has been zipped, without the md5 code.
Can you tell me what the latest version of Win32ImageMaker is...? Revision 44??
Thank you.
Revision history for this message
|
#16 |
Good find - it looks like version 0.5 was built off of rev 37, and md5.h was added in rev 39. The binary download was recreated due to some changes, but I'm guessing that the source zip wasn't.
The "latest version" is always going to be whatever's on "trunk" Right now, that's rev 44. That won't build to a specific "version" of ImageWriter though, obviously.
I'll ping Tobin about doing a release to rectify the source/binary discrepancy.
Thanks...
Revision history for this message
|
#17 |
Hello Jef,
I am happy that I could contribute a little bit to this opensource program..!!
So I am now able to add new code to the Image Maker source and to test it as well.
The only thing that I have to do, when I download the source files is to add the following
lines to the "disk.h" file, so that I can compile it with QT Creator (4.7.3, default download,
dowload file: Qt_SDK_
//-----------Paul copied from Q:\QtSDK\
typedef enum _STORAGE_BUS_TYPE {
BusTypeAta,
BusTypeSsa,
BusTypeUsb,
} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE;
// -------
I place these lines just above the following orignal lines of "disk.h":
// retrieve the storage device descriptor data for a device.
typedef struct _STORAGE_
(...)
(...)
} STORAGE_
I need to do this, because the STORAGE_BUS_TYPE is defined in this additional code, that I have
copied from file: Q:\QtSDK\
Thank you for helping me out.
Revision history for this message
|
#18 |
Glad that you're closer to it working, but the fact that you have to add those lines disturbs me. It should be picked up in the files from QT or MinGW.
But, glad that we're over the major hurdles.
Revision history for this message
|
#19 |
I think I have figured out this STORAGE_BUS_TYPE issue (or at least glanced into the insanity behind the issue). It appears that the mingw that ships with QT SDK 4.8.* is broken (I am now using 4.8.1 at work and have the same compiler error). Not sure why I didn't see this thread before (I found it via google of all things).
From what I have found, mingw switched their w32api to the cygwin w32api implementation some time ago. And that implementation was broken until 12/2010. Now, why this isn't updated in QT released 4/2012 is beyond me. I'm still trying to get answers.
In the meantime, I would suggest not installing mingw with qt 4.8.x at this time, install it separately from http://
Revision history for this message
|
#20 |
OK, so to get around this, install mingw from mingw.org and point QT-Creator to it instead of the one that ships with QT.
Revision history for this message
|
#21 |
Hello Tobin,
Thank you for the information!
I am glad I found a workaround...but a good 'mingw' that is not brooken should be better of cource.
Thank you for your support.
Greetings, Paul
Revision history for this message
|
#22 |
The STORAGE_BUS_TYPE issue goes even deeper it would appear. Newer device types are not defined in the mingw w32api.
Need to add the following to winioctl.h to be complete.:
BusTypeSd = 0x0C,
BusTypeMmc = 0x0D,
BusTypeVirtual = 0x0E,
BusTypeFileBa
BusTypeSpaces = 0x10,
BusTypeMax = 0x11,
NOTE: I am currently experimenting with this to see if it will resolve the newer SD reader issue, but I don't have high hopes.