Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

/bin/sh: 1: Syntax error: "(" unexpected ??



  • My buggy OS is "at work" .
    Periodically it get an entry in Qt editor which I did not make , especially when doing "cut and paste". My build process usually finds the extras, but this time it is in make somewhere...

    I do not know how to access the make file.

    I can successfully build and run a project .
    After few simple edit another build gets me this :

    :-1: error: [ui_mainwindow.h] Error 2
    

    I need a SUGGESTION to find and correct this error.
    Can I access makefilke "/bin/sh " using QtCreator IDE ?

    I prefer not to monkey with anything attached to "make / qmake" - when things works Qt tIDE DOES THE job (for me ) just fine.

    or when I "Run qmake " get this OK output

    09:26:57: Running steps for project TEST_PROJECT...
    09:26:57: Starting: "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" '/media/d/QT/CAT_MDI_24 (copy)/CAT_V1 11_1_2021 (copy)_WORKS/TEST_PROJECT.pro' -r -spec linux-g++-64 CONFIG+=debug
    09:26:57: The process "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" exited normally.
    09:26:57: Elapsed time: 00:00.
    

    I honestly do not know how I got this output :

    09:16:09: Running steps for project TEST_PROJECT...
    09:16:09: Configuration unchanged, skipping qmake step.
    09:16:09: Starting: "/usr/bin/make" -j4
    /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../../CAT_MDI_24\ (copy)/CAT_V1\ 11_1_2021\ (copy)_WORKS/mainwindow.ui -o ui_mainwindow.h
    /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../../CAT_MDI_24\ (copy)/CAT_V1\ 11_1_2021\ (copy)_WORKS/mainwindow_cat_tab.ui -o ui_mainwindow_cat_tab.h
    /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../../CAT_MDI_24\ (copy)/CAT_V1\ 11_1_2021\ (copy)_WORKS/dialogtest.ui -o ui_dialogtest.h
    Makefile:571: recipe for target 'ui_mainwindow.h' failed
    Makefile:574: recipe for target 'ui_mainwindow_cat_tab.h' failed
    Makefile:577: recipe for target 'ui_dialogtest.h' failed
    **/bin/sh: 1: Syntax error: "(" unexpected
    /bin/sh: 1: Syntax error: "(" unexpected**
    /bin/sh: 1: make: *** [ui_mainwindow.h] Error 2
    Syntax error: "(" unexpected
    make: *** Waiting for unfinished jobs....
    make: *** [ui_mainwindow_cat_tab.h] Error 2
    make: *** [ui_dialogtest.h] Error 2
    09:16:09: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project TEST_PROJECT (kit: Desktop)
    When executing step "Make"
    09:16:09: Elapsed time: 00:00.
    

    PS
    I try to exit and reload the project and SAME error persist.
    Once the "(" unexpected is there it won't go away - it needs to be manually deleted is my best guess.


  • Lifetime Qt Champion

    Don't use ( and ) in your path (but a proper VCS instead hundreds of copies of your source code in different folders)



  • @Christian-Ehrlicher said in /bin/sh: 1: Syntax error: "(" unexpected ??:

    Don't use ( and ) in your path (but a proper VCS instead hundreds of copies of your source code in different folders)

    SOLVED

    That did it, thanks.
    I have been making OS copies and rename them , thus "loosing" the () generated by OS "copy" .
    Still like to know how did you figure this out.
    The extended error was pointing to the make(file) , like to know how to actually access the file... but can work on that.


  • Lifetime Qt Champion

    @AnneRanch said in /bin/sh: 1: Syntax error: "(" unexpected ??:

    know how to actually access the file

    Use an editor...



  • @AnneRanch
    I would suggest you do not try to edit the Makefile. It is generated via qmake from Creator, you're not supposed to alter it.

    In addition to having followed @Christian-Ehrlicher's advice not to have ( or ) in your path names, under Linux at least you might like not to put spaces into file/directory names, as you have done. Up to you, yes you can do, but it can potentially lead to complications/errors that you just do not need to fight with....



  • @JonB
    Would you kindly suggest how to veryfy, further analyze this error?
    There is a difference between modifying the file and trying to find out more about error. Your reply is somewhat superfluous - it does no address the issue at all.



  • @AnneRanch

    Your reply is somewhat superfluous - it does no address the issue at all.

    Thanks as usual for your response, you have a nice way of phrasing things. Fine, follow @Christian-Ehrlicher's advice not to include ( ) in your paths, which caused you a problem, and ignore mine not to include spaces, which can also can cause problems. Better still, go ahead and edit the Makefile generated by Creator to your heart's content. Or just look at it, and see what you make of the error messages from your /bin/sh & make knowledge. There's little point trying to advise you.


Log in to reply