Results 1 to 7 of 7

Thread: Weird bug related to QtGui4.dll and Qwt

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Weird bug related to QtGui4.dll and Qwt

    Hello!

    Some time ago I developed a software that should monitor app's ram memory consumption. Lately I decided to add internal graphs using Qwt and till now everything run fine.

    After many tests opening the software inside Qt Creator, I created a installable version usnig Inno and when I try to execute it, a strange message appears:

    The procedure entry point _ZN14QWindowSurfaceC2EP7QWidget could not be located in the dynamic link library QtGui4.dll.

    This problem is making me unable to use the software outside Qt creator.

    A second problem also arrised, now related to Qwt I think:

    when I first tried to execute my app, Windows sad that the QtOpenGL4.dll (or something like) was missing. The problem is that while I'm using Qwt to plot a simplw QwtPlot, I'm using nothing of OpenGL. Not sure if one has to do with the other, but in any case, I'm mentioning it.



    Thanks,

    Momergil

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Weird bug related to QtGui4.dll and Qwt

    you made a mistake creating the installable version.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Weird bug related to QtGui4.dll and Qwt

    Quote Originally Posted by amleto View Post
    you made a mistake creating the installable version.
    Sorry, no way. I use the same installator as always, only changing things such as the name of the app, file locations, etc.. And the software's intallable version itself is the same that is running inside Qt.

    Notice that during compilation mingw reports:

    c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
    This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.

    Added after 25 minutes:


    Correction: I did some research comparing to older versions of my software and I found that the problem is in the function that plot the graph:

    Note: MReadWrite is a convenience class for file manipulation.
    SAFEDELETE === delete

    Qt Code:
    1. MReadWrite *mrw = new MReadWrite(this);
    2.  
    3. if (!mrw->openRead(QDir::currentPath() + "/Log_RAM_10.log"))
    4. {
    5. QMessageBox::warning(this,"Erro","Falha ao abrir grafico.");
    6. SAFEDELETE(mrw);
    7. return;
    8. }
    9. else
    10. {
    11. QVector<double> xPoints, data_emuso, data_disponivel, data_servidor, data_central, data_mysql, data_http1, data_http2;
    12. double xCounter = 0.0;
    13. int linhaCounter = 0, ultimoTracejado = 0;
    14.  
    15. // Header localizer
    16. while (!mrw->isAtEnd())
    17. {
    18. linhaCounter++;
    19.  
    20. const QString linha = mrw->readLine();
    21.  
    22. if (linha.contains("------------------------------------------------"))
    23. ultimoTracejado = linhaCounter;
    24. }
    25.  
    26. mrw->goToLine(ultimoTracejado + 2);
    27.  
    28. while (!mrw->isAtEnd())
    29. {
    30. const QString linha = mrw->readLine();
    31.  
    32. data_emuso.append(linha.section("\t",2,2).toDouble());
    33. data_disponivel.append(linha.section("\t",3,3).toDouble());
    34. data_servidor.append(linha.section("\t",5,5).toDouble());
    35. data_central.append(linha.section("\t",6,6).toDouble());
    36. data_mysql.append(linha.section("\t",7,7).toDouble());
    37. data_http1.append(linha.section("\t",8,8).toDouble());
    38. data_http2.append(linha.section("\t",9,9).toDouble());
    39.  
    40. xPoints.append(xCounter++);
    41. }
    42.  
    43. mrw->closeFile();
    44. SAFEDELETE(mrw);
    45.  
    46. if (!data_emuso.isEmpty() && !data_disponivel.isEmpty() && !data_servidor.isEmpty() && !data_central.isEmpty()
    47. && !data_mysql.isEmpty() && !data_http1.isEmpty() && !data_http2.isEmpty())
    48. {
    49. QDialog *graphWindow = new QDialog(this);
    50. graphWindow->setFixedSize(800,400);
    51. graphWindow->setWindowTitle("Gráfico (base: 10 min)");
    52.  
    53. QWidget *graphWidget = new QWidget(graphWindow);
    54. graphWidget->resize(graphWindow->size());
    55.  
    56. QwtPlot *plot = new QwtPlot(graphWidget);
    57. plot->resize(plot->parentWidget()->size());
    58. plot->setAxisScale(QwtPlot::xBottom,0.0,xPoints.last());
    59. plot->setAxisTitle(QwtPlot::xBottom,"Amostras");
    60. plot->setAxisTitle(QwtPlot::yLeft,"Valor (MByte)");
    61. plot->setAxisScale(QwtPlot::yLeft,0.0,4096.0);
    62. plot->setCanvasBackground(QBrush(Qt::white));
    63.  
    64. QwtPlotCurve *curva_emuso = new QwtPlotCurve("curva_emuso");
    65. curva_emuso->attach(plot);
    66. curva_emuso->setPen(QPen(Qt::red,2.0));
    67. curva_emuso->setSamples(xPoints,data_emuso);
    68. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    69. curva_emuso->show();
    70.  
    71. QwtPlotCurve *curva_disponivel = new QwtPlotCurve("curva_disponivel");
    72. curva_disponivel->attach(plot);
    73. curva_disponivel->setPen(QPen(Qt::gray,2.0));
    74. curva_disponivel->setSamples(xPoints,data_disponivel);
    75. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    76. curva_disponivel->show();
    77.  
    78. QwtPlotCurve *curva_servidor = new QwtPlotCurve("curva_servidor");
    79. curva_servidor->attach(plot);
    80. curva_servidor->setPen(QPen(Qt::blue,2.0));
    81. curva_servidor->setSamples(xPoints,data_servidor);
    82. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    83. curva_servidor->show();
    84.  
    85. QwtPlotCurve *curva_central = new QwtPlotCurve("curva_central");
    86. curva_central->attach(plot);
    87. curva_central->setPen(QPen(Qt::green,2.0));
    88. curva_central->setSamples(xPoints,data_central);
    89. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    90. curva_central->show();
    91.  
    92. QwtPlotCurve *curva_mysql = new QwtPlotCurve("curva_mysql");
    93. curva_mysql->attach(plot);
    94. curva_mysql->setPen(QPen(Qt::cyan,2.0));
    95. curva_mysql->setSamples(xPoints,data_mysql);
    96. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    97. curva_mysql->show();
    98.  
    99. QwtPlotCurve *curva_http1 = new QwtPlotCurve("curva_http1");
    100. curva_http1->attach(plot);
    101. curva_http1->setPen(QPen(Qt::yellow,2.0));
    102. curva_http1->setSamples(xPoints,data_http1);
    103. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    104. curva_http1->show();
    105.  
    106. QwtPlotCurve *curva_http2 = new QwtPlotCurve("curva_http2");
    107. curva_http2->attach(plot);
    108. curva_http2->setPen(QPen(Qt::darkYellow,2.0));
    109. curva_http2->setSamples(xPoints,data_http2);
    110. curva_emuso->setRenderHint(QwtPlotCurve::RenderAntialiased,true);
    111. curva_http2->show();
    112.  
    113. plot->replot();
    114. plot->show();
    115. graphWindow->exec();
    116.  
    117. SAFEDELETE(curva_emuso);
    118. SAFEDELETE(curva_disponivel);
    119. SAFEDELETE(plot);
    120. SAFEDELETE(graphWindow);
    121. }
    122. }
    To copy to clipboard, switch view to plain text mode 


    Added after 42 minutes:


    Ok, I think is a Qwt problem... I managed to change the function to the following code and the problem don't appear:

    Qt Code:
    1. MReadWrite *mrw = new MReadWrite(this);
    2.  
    3. if (!mrw->openRead(QDir::currentPath() + "/Log_RAM_10.log"))
    4. {
    5. QMessageBox::warning(this,"Erro","Falha ao abrir grafico.");
    6. SAFEDELETE(mrw);
    7. return;
    8. }
    9. else
    10. {
    11. QVector<double> xPoints, data_emuso, data_disponivel, data_servidor, data_central, data_mysql, data_http1, data_http2;
    12. double xCounter = 0.0;
    13. int linhaCounter = 0, ultimoTracejado = 0;
    14.  
    15. // Localiza ponto de inicio
    16. while (!mrw->isAtEnd())
    17. {
    18. linhaCounter++;
    19.  
    20. const QString linha = mrw->readLine();
    21.  
    22. if (linha.contains("------------------------------------------------"))
    23. ultimoTracejado = linhaCounter;
    24. }
    25.  
    26. mrw->goToLine(ultimoTracejado + 2);
    27.  
    28. while (!mrw->isAtEnd())
    29. {
    30. const QString linha = mrw->readLine();
    31.  
    32. data_emuso.append(linha.section("\t",2,2).toDouble());
    33. data_disponivel.append(linha.section("\t",3,3).toDouble());
    34. data_servidor.append(linha.section("\t",5,5).toDouble());
    35. data_central.append(linha.section("\t",6,6).toDouble());
    36. data_mysql.append(linha.section("\t",7,7).toDouble());
    37. data_http1.append(linha.section("\t",8,8).toDouble());
    38. data_http2.append(linha.section("\t",9,9).toDouble());
    39.  
    40. xPoints.append(xCounter++);
    41. }
    42.  
    43. mrw->closeFile();
    44. SAFEDELETE(mrw);
    45.  
    46. if (!data_emuso.isEmpty() && !data_disponivel.isEmpty() && !data_servidor.isEmpty() && !data_central.isEmpty()
    47. && !data_mysql.isEmpty() && !data_http1.isEmpty() && !data_http2.isEmpty())
    48. {
    49. QDialog *graphWindow = new QDialog(this);
    50. graphWindow->setFixedSize(800,400);
    51. graphWindow->setWindowTitle("Gráfico (base: 10 min)");
    52.  
    53. graphWindow->exec();
    54. SAFEDELETE(graphWindow);
    55. }
    56. }
    To copy to clipboard, switch view to plain text mode 

    Now the code that makes the bug appear:
    Qt Code:
    1. //...
    2.  
    3. if (!data_emuso.isEmpty() && !data_disponivel.isEmpty() && !data_servidor.isEmpty() && !data_central.isEmpty()
    4. && !data_mysql.isEmpty() && !data_http1.isEmpty() && !data_http2.isEmpty())
    5. {
    6. QDialog *graphWindow = new QDialog(this);
    7. graphWindow->setFixedSize(800,400);
    8. graphWindow->setWindowTitle("Gráfico (base: 10 min)");
    9.  
    10. QwtPlot *plot = new QwtPlot(graphWidget); //This line is causing the problem!!!!!!!!!!!1
    11. graphWindow->exec();
    12. SAFEDELETE(graphWindow);
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

    So now what is wrong with my plot?
    Last edited by Momergil; 12th March 2013 at 19:25.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Weird bug related to QtGui4.dll and Qwt

    The linker is looking for QWindowSurface::QWindowSurface(QWidget*), used in a module built with MingW, in the DLL your installer has installed and is failing to find it. This could be because your installer has installed:
    • a version of the Qt library built with MSVC,
    • a version of the Qt library built with a binary incompatible version of MingW,
    • a version of the Qt library from before Qt 4.3 when QWindowSurface was created, or
    • a version of the Qt library that does not export the symbol (which is private to Qt).

    Take your pick.

  5. The following user says thank you to ChrisW67 for this useful post:

    Momergil (14th March 2013)

  6. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Weird bug related to QtGui4.dll and Qwt

    Quote Originally Posted by ChrisW67 View Post
    The linker is looking for QWindowSurface::QWindowSurface(QWidget*), used in a module built with MingW, in the DLL your installer has installed and is failing to find it. This could be because your installer has installed:
    • a version of the Qt library built with a binary incompatible version of MingW,

    Take your pick.
    Thanks Chris once again When reading your answer I remembered that the pack I used to ctrl+c/ctrl+v with the dlls required for dynamic qt apps compilation was probably from Qt 4.7 whereas I'm using Qt 4.8 and the last Qwt version After uptading the dlls package, a new one was required and since then the software is finally running outside Qt Creator.

    Thanks again,

    Momergil

  7. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Weird bug related to QtGui4.dll and Qwt

    Quote Originally Posted by amleto View Post
    you made a mistake creating the installable version.
    Quote Originally Posted by Momergil View Post
    Sorry, no way. ...
    Quote Originally Posted by Momergil View Post
    Thanks Chris once again When reading your answer I remembered that the pack I used to ctrl+c/ctrl+v with the dlls required for dynamic qt apps compilation was probably from Qt 4.7 whereas I'm using Qt 4.8 and the last Qwt version After uptading the dlls package, a new one was required and since then the software is finally running outside Qt Creator.

    Thanks again,

    Momergil
    Thought so!
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  8. #7
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Weird bug related to QtGui4.dll and Qwt

    Quote Originally Posted by amleto View Post
    Thought so!
    ^^

    Thanks amleto

Similar Threads

  1. Crash in qtgui4.dll
    By HeReSY in forum Qt Programming
    Replies: 7
    Last Post: 17th January 2011, 11:52
  2. how to optimize the size of QtCore4.dll and QtGui4.dll
    By lovelypp in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2008, 11:28
  3. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  4. Weird color problems related to QTextEdit and QPainter
    By Erlendhg in forum Qt Programming
    Replies: 5
    Last Post: 18th June 2007, 21:57
  5. Compiling QtCore4 and QtGUI4 as small as possible
    By pkirk25 in forum Qt Programming
    Replies: 5
    Last Post: 8th December 2006, 21:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.