Menu

#72 Compilation issue with QT_NAMESPACE

open
nobody
None
5
2021-07-28
2020-04-15
Anonymous
No

Replace QT_FORWARD_DECLARE_CLASS(QClass) instead of class QClass;
Add QT_BEGIN|END_NAMESPACE for all Q_DECLARE_TYPEINFO

find . -name '.h' -type f -print0 | xargs -0 sed -i 's|^class (Q[A-Z][a-zA-Z0-9_]);|QT_FORWARD_DECLARE_CLASS(\1)|g'
find . -name '.h' -type f -print0 | xargs -0 sed -i 's|(Q_DECLARE_TYPEINFO([^)]);)|QT_BEGIN_NAMESPACE\n\1\n\QT_END_NAMESPACE\n|g'

Discussion

  • Anonymous

    Anonymous - 2020-04-15
    find . -name '*.h' -type f -print0 | xargs -0 sed -i 's|^class \(Q[A-Z][a-zA-Z0-9_]*\);|QT_FORWARD_DECLARE_CLASS(\1)|g'
    find . -name '*.h' -type f -print0 | xargs -0 sed -i 's|\(Q_DECLARE_TYPEINFO(.*);\)|QT_BEGIN_NAMESPACE\n\1\n\QT_END_NAMESPACE\n|g'
    
     
  • Anonymous

    Anonymous - 2021-07-28

    Patch for 6.2.0

        find . -name '*.h' -type f -print0 | xargs -0 sed -i '
            s|^class \(Q[A-Z][a-zA-Z0-9_]*\);|QT_FORWARD_DECLARE_CLASS(\1)|g;
            s|\(Q_DECLARE_TYPEINFO(.*);\)|QT_BEGIN_NAMESPACE\n\1\n\QT_END_NAMESPACE\n|g
            s|^\(.*class Q[A-Z][a-zA-Z0-9_]*;\)|QT_BEGIN_NAMESPACE\n\1\nQT_END_NAMESPACE|g'
    
     

Anonymous
Anonymous

Add attachments
Cancel





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.