Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Compiling Qt with Struct Member Alignment of one (/Zp1)
Forum Updated to NodeBB v4.3 + New Features

Compiling Qt with Struct Member Alignment of one (/Zp1)

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DinosHaveNoLife
    wrote on last edited by
    #1

    I have a Qt project which uses a few other libraries made by the company i work for. A struct member alignment of one is used for every library and project in our system. I don't know the details but it is something hardware related.

    I managed to compile qtmain, QtCore and QtGui (the only ones i use) with a Struct Member Alignment of one. But when I build and run my project (which also has the /Zp1 flag) it runs into an assert in qmutex.h -> 'QMutex pointer is misaligned'. After some searching I found that QMutex can only be used with a Struct Member Alignment of 2 or 4. I tried to solve this issue with:
    @
    #pragma pack(push, 2)
    // the QMutex class
    #pragma pack(pop)
    @

    Still the assert is false.

    Version: Qt 4.8.4.
    IDE: Visual Studio 2005.

    Am I approaching this wrong or is changing the struct member alignment blasphemy?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved