MOC Parse error at “std”

By | November 4, 2018

You’re being a good little geek. You need to write a Qt program for both 32-bit and 64-bit platforms so you are using multiple VMs and keeping the repository on a shared drive. Everything compiles clean and runs great on the 32-bit VM. You boot the 64-bit VM, mount the shared drive and bam!

usr/include/c++/7/bits/stl_relops.:67: Parse error at "std"

Sucks to be you!

Searching the Web leads you to bug reports like this one. Good luck with that rabbit hole! More poking around leads to various things.

developer@developer-U18-04-64-bit-dev-VirtualBox:/mnt/share/git_repo/ipos$ ls /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h

You try hand installing QtCreator and re-starting the 64-bit VM which thankfully doesn’t solve the problem, because if it did you would _really_ be lost. In desperation you add the following to your .pro file knowing it is a hack you will need to trap on the 32-bit side.

INCLUDEPATH += /usr/include/x86_64-linux-gnu/c++/7/bits

No luck! And Web searches are of no use. How could this go so sideways?

Well my little geek, you got screwed with your pants on from afar. Some misguided powers that be high up in the Qt world decided to add a file to the Qt compile process and basically said nothing about it.

-rwxrwxrwx 1 root root 739 Oct 26 15:01 .qmake.stash

That hidden file needs to be blasted each time you build if you use a shared drive or someone accidentally added it to your source repo. It is automatically generated and stashes library paths. If you are using a shared drive to build and test your repo for multiple targets, the first step in your build process must be to nuke it. Then you will never see this error, your build will just take a touch longer.

For more insight about the art of software development read my new book “The Minimum You Need to Know About the Phallus of AGILE

Category: Information Technology Thank You Sir May I Have Another Tags: , ,

About seasoned_geek

Roland Hughes started his IT career in the early 1980s. He quickly became a consultant and president of Logikal Solutions, a software consulting firm specializing in OpenVMS application and C++/Qt touchscreen/embedded Linux development. Early in his career he became involved in what is now called cross platform development. Given the dearth of useful books on the subject he ventured into the world of professional author in 1995 writing the first of the "Zinc It!" book series for John Gordon Burke Publisher, Inc. A decade later he released a massive (nearly 800 pages) tome "The Minimum You Need to Know to Be an OpenVMS Application Developer" which tried to encapsulate the essential skills gained over what was nearly a 20 year career at that point. From there "The Minimum You Need to Know" book series was born. Three years later he wrote his first novel "Infinite Exposure" which got much notice from people involved in the banking and financial security worlds. Some of the attacks predicted in that book have since come to pass. While it was not originally intended to be a trilogy, it became the first book of "The Earth That Was" trilogy: Infinite Exposure Lesedi - The Greatest Lie Ever Told John Smith - Last Known Survivor of the Microsoft Wars When he is not consulting Roland Hughes posts about technology and sometimes politics on his blog. He also has regularly scheduled Sunday posts appearing on the Interesting Authors blog.