Fixing KeePassXR on Windows

80 views
Skip to first unread message

TheZero

unread,
Oct 18, 2016, 2:53:46 PM10/18/16
to KeePassX Reboot
Hi guys,

I'm in the process of writing Build Instruction for every platform (Linux, MacOS and Windows)

I have some problem compiling on the last one.
I use Qt 5.3 and MinGW4.8 (with QTCreator)

The first is this line: https://github.com/keepassxreboot/keepassx/blob/develop/src/gui/MainWindow.cpp#L704
The compiler says "MessageBox is not a class", replacing "MessageBox" with "QMessageBox" fix the compiler error it on Windows
On Linux the fix gives no error from the compiler.
Someone can test?

The second problem is this: https://github.com/keepassxreboot/keepassx/blob/develop/src/http/Server.cpp#L25
On windows this is a "no such file or directory"
I've tried to compile under cygwin but the error keep showing.

We need to fix this before the 2.1.0 release




magkopian

unread,
Oct 18, 2016, 3:31:13 PM10/18/16
to KeePassX Reboot

Regarding the first issue, I can confirm that using "QMessageBox" instead of "MessageBox" on Linux, at least with the version 5.3.2 of Qt gives no errors from the compiler and the produced binary seems to work just fine.

droidmonkey

unread,
Oct 20, 2016, 4:33:17 PM10/20/16
to KeePassX Reboot
MessageBox is declared here: https://github.com/keepassxreboot/keepassx/blob/develop/src/gui/MessageBox.h

It is a wrapper around QMessageBox that allows you to dismiss it with a particular answer which is handy for testing. I think it is safe to replace with a QMessageBox in that function but its weird that its throwing an error.

Looks like in the Server.cpp file we need to wrap that include with a linux preprocessor and find an alternative for windows. I am not even sure what it provides.

TheZero

unread,
Oct 20, 2016, 5:47:17 PM10/20/16
to KeePassX Reboot
Maybe the MessageBox.h is not included, tomorrow I will see

For the Server.cpp I think so if Cygwin or MinGW don't work. I will do more tests.

TheZero

unread,
Oct 21, 2016, 5:01:59 AM10/21/16
to KeePassX Reboot
if "gui/MessageBox.h" is included after "http/Server.h" it works fine.

Anyay there is still the POSIX vs Windows Socket so if we implement this (https://github.com/keepassxreboot/keepassx/issues/50) we can build for Windows without Keepasshttp support

droidmonkey

unread,
Oct 22, 2016, 10:55:35 AM10/22/16
to keepass...@googlegroups.com
I'm sure there is a more Qt way of doing business... I am not sure we even need to use MicroHTTPD. Like I said a while ago in the KeePassX pull request for this, the code needs to be deep dived and evaluated for security concerns, etc etc


Qt Network Server examples:

TheZero

unread,
Oct 22, 2016, 11:20:43 AM10/22/16
to KeePassX Reboot
I was thinking that too. It's useless using external libraries when you have socket support with Qt.

For the POSIX/Windows socket I found a fix with preprocessor condition on each platform. (I will make some test and push it)

Dividing (and rewriting) the keepassxhttp code into a library will take some time but It has to be done.
Maybe after the 2.1.0 release (?)

droidmonkey

unread,
Oct 22, 2016, 5:32:52 PM10/22/16
to KeePassX Reboot
I'd say if we want to offer the flexibility of on/off http we need to do it before the first major push to distros. It will take a lot more effort to use pure Qt instead of the current setup.

Priority 1 - Incorporate major PR's and features from community
Priority 2 - Remove extra dependencies (microhttpd)
Priority 3 - Split http into separate library

Does that make sense?

TheZero

unread,
Oct 23, 2016, 8:06:59 AM10/23/16
to KeePassX Reboot
Yes, it's exactly what I was saying. +1

TheZero

unread,
Oct 24, 2016, 1:56:10 PM10/24/16
to KeePassX Reboot
I think we need to open a new Issue/Question(here on Groups) about the Priority list.

Anyway I have proposed this fix for Windows
https://github.com/keepassxreboot/keepassx/pull/53

And I'm starting rewriting documentation on the Wiki (look at the sidebar)
https://github.com/keepassxreboot/keepassx/wiki/
Reply all
Reply to author
Forward
0 new messages