Menu

Release build not working

Help
2020-05-18
2020-06-13
  • Flower lady

    Flower lady - 2020-05-18

    Hey folks,

    So, the build process for PythonQt is sort of a black box to me. I've tried to understand it, but there is so much going on here that I've sort of resigned myself to just being happy that my debug build works. However, today that has changed, as I need a release build, and I'm getting an error:

    LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in com_trolltech_qt_core_builtin0.obj  PythonQt-Qt5-Python38   C:\...\PythonQt\src\PythonQtQFileImporter.obj
    

    The error speaks for itself, but for I can't for the life of me figure out why it's happening. From what I can tell, com_trolltech_qt_core_builtin0.obj is generated by the release build, so I have no idea how or why this would get generated with a different runtime library than the main project. I know that 'MD_DynamicRelease' is the correct one since this is the release build, but I'm not sure where to start investigating how to rectify this mismatch.

     
  • Flower lady

    Flower lady - 2020-05-20

    Man, tough audience, huh?

     
  • Flower lady

    Flower lady - 2020-05-29

    Update: Still no luck. I did make another post with more info here: https://github.com/MeVisLab/pythonqt/issues/11

    It seems that maybe, even in release mode, the MDd_DynamicDebug runtime library is being used in stead of MD_DynamicRelease for PythonQt. This doesn't make any sense to me. I've dug through the project settings PythonQt.pro and src.pro, and everything looks fine. All of the settings in my MSVC solution also look fine. The static library itself builds fine for the project PythonQt-Qt5-PythonXY, and is is using the /MD flag. This is just very strange.

     
  • Flower lady

    Flower lady - 2020-06-11

    Hi Florian, glad to hear from you! Unfortunate that you haven't run into this issue.

    I actually hadn't made any modifications to the MSVC solution before things stopped working. I just have been building in debug for the past few months, and finally made the leap to compile a release version of the DLLs.

    I'm about 80% convinced that this is a very strange problem with MOC. I'm using QT 5.12, and I'm not sure if there are any oddities that have been introduced.

    Which leads me to the question, is it possible to build PythonQt without using MOC on the generated header files? The custom build step is what seems to be contentious.

     
    • Florian Link

      Florian Link - 2020-06-12

      Yes, the moc required and it only generates addition cpp files that are
      compiled like the rest of the files. Hm, I would try to setup my
      installation anew, remove all tmp files, recreated vcxproj and so on, like
      you start on a clean machine.

      On Thu 11. Jun 2020 at 22:55, Flower lady fancyflowerlady@users.sourceforge.net wrote:

      Hi Florian, glad to hear from you! Unfortunate that you haven't run into
      this issue.

      I actually hadn't made any modifications to the MSVC solution before
      things stopped working. I just have been building in debug for the past few
      months, and finally made the leap to compile a release version of the DLLs.

      I'm about 80% convinced that this is a very strange problem with MOC. I'm
      using QT 5.12, and I'm not sure if there are any oddities that have been
      introduced.

      Which leads me to the question, is it possible to build PythonQt without
      using MOC on the generated header files? The custom build step is what
      seems to be contentious.


      Release build not working


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/pythonqt/discussion/631393/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       
  • Flower lady

    Flower lady - 2020-06-12

    Hi Florian,

    Unfortunately, I tried all of that, and still no luck. I've even gone as far as to pull PythonQt's source directly into my own project, and I'm STILL getting the error in release build:

    Error   LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in com_trolltech_qt_core_builtin0.obj  grand_blue  C:\Users\dante\Documents\Projects\grand-blue-engine\grand_blue\PhysXCommon_static_32.lib(GuFeatureCode.obj) 1   
    
    Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in com_trolltech_qt_core_builtin0.obj  grand_blue  C:\Users\dante\Documents\Projects\grand-blue-engine\grand_blue\PhysXCommon_static_32.lib(GuDistanceSegmentTriangle.obj) 1   
    

    I'm only using PythonQt to wrap up my own custom classes for use in Python, so I'm wondering if it's feasible to just skip the loading of QtCore and QtGui altogether, and just use the features of PythonQt that wrap my own custom classes. Is this something that you think would be feasible? My last resort is to try to remove the calls

    PythonQt_init_QtCoreBuiltin(NULL);
    PythonQt_init_QtGuiBuiltin(NULL);
    

    And all related hooks, since that seems to be the contentious part of the code.

     
  • Flower lady

    Flower lady - 2020-06-13

    Got it, thanks again Florian. Turns out, I had introduced a stray _DEBUG definition in PythonQtPythonInclude, which was ruining everything. So as I'd suspected all along, it was my fault. I'd added that line a year ago to test something and had forgotten about it.

    As to why I hadn't caught it when I reinstalled PythonQt, it turns out git also wasn't tracking my changes properly, so things didn't actually get overwritten when I pulled from the repo. An unfortunate comedy of errors.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.