yun93us / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

compiling 1.2beta1 #123

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compiling under windows xp and Qt4.8
2. I try to compile 
3. I've read the details sections from the wiki about the wineventnotifier but 
I don't how to solve this issue

 C:\Documents and Settings\INSlaGarrotxa\Escritorio\qextserialport-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug\examples\qespta\..\..\..\qextserialport-1.2beta1\src\qextserialport_win.cpp:115: error: invalid use of incomplete type 'struct QWinEventNotifier'
.
.
.
.

Original issue reported on code.google.com by fpbo...@gmail.com on 26 Mar 2012 at 9:08

GoogleCodeExporter commented 8 years ago
Hi spbosch,

I could not figure out in which case this will happened. If other users do not 
encounter this problem, perhaps something you have done caused this.

For example, you have copied the qextwineventnotifier_p.h file to 
include/QtCore/private/qwineventnotifier_p.h

Original comment by dbzhang...@gmail.com on 26 Mar 2012 at 9:11

GoogleCodeExporter commented 8 years ago
Hi dbzhang,

I'm just following the steps of "How to use(1)". I haven't copied the 
qextwineventnotifier_p.h to include/QtCore/private/qwineventnotifier_p.h
shall I ? 

Anyway now I downloaded the qwineventnotifier_p.h from 
http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/qwineventnotifier_p.h
 and copied it, but now I have new compilation problems:

C:\Documents and 
Settings\INSlaGarrotxa\NewVisioIE\3rdparty\qextserialport\src\qextserialenumerat
or_win.cpp:-1: error: undefined reference to 
`_imp__SetupDiGetDeviceRegistryPropertyW@28'
C:\Documents and 
Settings\INSlaGarrotxa\NewVisioIE\3rdparty\qextserialport\src\qextserialenumerat
or_win.cpp:-1: error: undefined reference to `_imp__SetupDiOpenDevRegKey@24'
...
...
...
...

Any help is welcome.

   Thank you 

Original comment by fpbo...@gmail.com on 27 Mar 2012 at 8:49

GoogleCodeExporter commented 8 years ago
After all I opted to test a more easy way for me "How to use(3)". I compile it 
with success... and project works fine.

Original comment by fpbo...@gmail.com on 27 Mar 2012 at 11:35

GoogleCodeExporter commented 8 years ago
Hi fpbosch,

The problem you come with seems rather strange, but it is not difficult to 
solve.

Your can add message() to the qextserialport.pri to see what happened.

{{{
    win32:contains(QT_VERSION, ^4\\..*\\..*):!exists($$[QT_INSTALL_HEADERS]/QtCore/private/qwineventnotifier_p.h){
        message("Hello, I am here....")
        message("Hi," $$[QT_INSTALL_HEADERS])
        DEFINES            += QESP_NO_QT4_PRIVATE
        HEADERS            += $$PWD/qextwineventnotifier_p.h
        SOURCES            += $$PWD/qextwineventnotifier_p.cpp
    }
}}}

And, In the *.h/*.cpp ,you can add #warning 

{{{
#if XXXX
#....
#warning I am branch1
#....
#else
#...
#warning I am branch2
#...
#endif
}}}

Original comment by dbzhang...@gmail.com on 28 Mar 2012 at 6:44

GoogleCodeExporter commented 8 years ago
Hello,

I faced this problem yesterday under W7 with Qt4.7.4.
I think the test isn't fully working, and isn't able to determine if the file 
"QtCore/private/qwineventnotifier_p.h" is present or not... So the test was 
wrong, QESP_NO_QT4_PRIVATE not defined, and includes missing...

On my machine, I just had to comment the test and everything worked fine. (but 
I lost portability).

Original comment by romain...@gmail.com on 2 Apr 2012 at 9:09

GoogleCodeExporter commented 8 years ago
OK, I just ran into this issue (incomplete struct QWinEventNotifier), but I 
also got an include file failure 
("../../../src/corelib/kernel/qwineventnotifier_p.h"). 
Here's what I'm finding:
(I have a Qt 4.8.0 install, on which I've run the updater once or twice. I've 
removed anything not related to Windows development with the mingw toolchain. I 
do have the 4.8.0 sources installed.)

c:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtCore\private\qwineventnotifier_p.h 
exists on my system. It's contents are just:

  #include "../../../src/corelib/kernel/qwineventnotifier_p.h"

which doesn't exist. 

Now, if I look where the package manager installed the sources 
(c:\QtSDK\QtSources\4.8.0\src\corelib\kernel), I find the file it's looking 
for. 
I also find that 
c:\QtSDK\QtSources\4.8.0\include\QtCore\private\qwineventnotifier_p.h is the 
same as 
c:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtCore\private\qwineventnotifier_p.h.

I thus conclude that the 'qwineventnotifier_p.h' test in the .pro files isn't 
quite sufficient because it's possible to setup a Qt system such that the test 
will pass, but the thing won't actually compile.

If anyone can tell me what to put onto my system (using Qt package manager) so 
that it will work, I'd be happy. For the moment I've moved the offending file 
(c:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtCore\private\qwineventnotifier_p.h) 
to another name. At this point I can build and run the library and examples 
just fine.

Original comment by mhko...@moberg.com on 5 Apr 2012 at 5:20

GoogleCodeExporter commented 8 years ago
I'm having the exact same problem: on a clean install of Qt 4.8.0, I'm having 
C:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtCore\private\qwineventnotifier_p.h  
on my system.

And qextserialport does not compile. If I remove the QtSDK file, it compiles.

Original comment by pascal.m...@density-tech.com on 11 Apr 2012 at 7:44

GoogleCodeExporter commented 8 years ago
Ok, I see

QtSDK does provide a "private/qwineventnofifier_p.h", but contents of it is 
broken.

 #include "../../../src/corelib/kernel/qwineventnotifier_p.h"

So this should be bug of QtSDK installer and updater.

IMO, there are several workarounds can be used.

1. If Qt's source code can be found in your hardware, fix the contents of this 
broken file. For example, change to

  #include "c:\QtSDK\QtSources\4.8.0/src/corelib/kernel/qwineventnotifier_p.h"

or you can simply replace the file 
"include/QtCore/private/qwineventnotifier_p.h" with 
"src/corelib/kernel/qwineventnotifier_p.h"

2. If Qt's source code does not exist in your hardware, you can download this 
file from 
http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/kernel/qwineventnotifier_p.h

then put it to $QTDIR/include/QtCore/private/qwineventnotifier_p.h

3. Remove the broken file

$QTDIR/include/QtCore/private/qwineventnotifier_p.h

then QextSerialPort will auto select qextwineventnotifier_p.h

4. 

Original comment by dbzhang...@gmail.com on 11 Apr 2012 at 9:00

GoogleCodeExporter commented 8 years ago
This is a bug of QtSDK, workaround will be given in FAQ

Original comment by dbzhang...@gmail.com on 10 Aug 2012 at 9:32