Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Syntax error: newline unexpected in ui

[SOLVED] Syntax error: newline unexpected in ui

Scheduled Pinned Locked Moved Mobile and Embedded
12 Posts 2 Posters 5.1k Views
  • 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.
  • A Offline
    A Offline
    admd91
    wrote on 29 Jan 2015, 02:12 last edited by
    #1

    Hello, I am using planning to use an i.mx6q SABRE from freescale, after following this thread https://community.freescale.com/thread/309578, in order to build GUI apps for the board, I tried to build a project I found on the net. But I keep seeing an error that goes:

    ../wpa_gui-qt4/wpagui.ui:-1: error: 2: ../wpa_gui-qt4/wpagui.ui: Syntax error: newline unexpected

    Can anyone help me with issue? Based from reading threads about this same error, but for different boards, it seems to be the way the environment is setup, but I followed the previously mentioned thread and Qt Creator didn't show any error. I did make a few changes, for example, I specified the device type to be a desktop PC, but I believe my compiler, debugger, etc. settings are correct.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kumararajas
      wrote on 29 Jan 2015, 09:51 last edited by
      #2

      Hello,

      I haven't worked on the target that you specified. But, I have worked on embedded targets.

      Based on your explanation, even I feel that you should not be having problem with the environment set up.
      However to confirm that, you can write "Hello world" C++ program, build successfully and then build similar "Hello world" Qt project.
      First step would be, not including ".ui" file. And once you reach success, you can try with .ui file.

      Meanwhile can you please share .pro file and and file lists?

      --Kumar

      1 Reply Last reply
      0
      • A Offline
        A Offline
        admd91
        wrote on 30 Jan 2015, 04:23 last edited by
        #3

        Hello kumararajas,

        I'll try your suggestion, for the meantime here is the download link for the Qt project: http://w1.fi/releases/wpa_supplicant-2.3.tar.gz. The folder 'wpa_gui-qt4' contains the .pro file if I'm correct.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kumararajas
          wrote on 30 Jan 2015, 08:24 last edited by
          #4

          Hi,

          I did download the code from the link. And did build it in my workspace.

          I could build it successfully. (It was throwing an error for "u8" datatype. I did a quick fix by making it as "int")

          Build log:
          @
          13:50:15: Running build steps for project wpa_gui...
          13:50:15: Configuration unchanged, skipping qmake step.
          13:50:15: Starting: "C:\Qt\qtcreator-2.4.1\mingw\bin\mingw32-make.exe"
          C:/Qt/qtcreator-2.4.1/mingw/bin/mingw32-make.exe -f Makefile.Release
          mingw32-make.exe[1]: Entering directory C:/Users/suseelk/Downloads/wpa_supplicant-2.3.tar/wpa_supplicant-2.3/wpa_supplicant/wpa_gui-build-desktop-Qt_4_8_4__4_8_4__Debug' gcc -c -pipe -O2 -Wall -Wextra -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\os_win32.o ..\..\src\utils\os_win32.c g++ -c -pipe -O2 -Wall -Wextra -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\main.o ..\wpa_gui-qt4\main.cpp ..\..\src\utils\os_win32.c: In function 'os_daemonize': ..\..\src\utils\os_win32.c:119: warning: unused parameter 'pid_file' ..\..\src\utils\os_win32.c: In function 'os_daemonize_terminate': ..\..\src\utils\os_win32.c:126: warning: unused parameter 'pid_file' ..\..\src\utils\os_win32.c: In function 'os_setenv': ..\..\src\utils\os_win32.c:180: warning: unused parameter 'name' ..\..\src\utils\os_win32.c:180: warning: unused parameter 'value' ..\..\src\utils\os_win32.c:180: warning: unused parameter 'overwrite' ..\..\src\utils\os_win32.c: In function 'os_unsetenv': ..\..\src\utils\os_win32.c:186: warning: unused parameter 'name' ..\..\src\utils\os_win32.c: In function 'os_exec': ..\..\src\utils\os_win32.c:263: warning: unused parameter 'program' ..\..\src\utils\os_win32.c:263: warning: unused parameter 'arg' ..\..\src\utils\os_win32.c:263: warning: unused parameter 'wait_completion' g++ -c -pipe -O2 -Wall -Wextra -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\wpagui.o ..\wpa_gui-qt4\wpagui.cpp g++ -c -pipe -O2 -Wall -Wextra -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\eventhistory.o ..\wpa_gui-qt4\eventhistory.cpp g++ -c -pipe -O2 -Wall -Wextra -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\scanresults.o ..\wpa_gui-qt4\scanresults.cpp c:\Qt\4.8.4\bin\rcc.exe -name icons ..\wpa_gui-qt4\icons.qrc -o release\qrc_icons.cpp g++ -c -pipe -O2 -Wall -Wextra -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DCONFIG_CTRL_IFACE -DCONFIG_NATIVE_WINDOWS -DCONFIG_CTRL_IFACE_NAMED_PIPE -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.8.4\include\QtCore" -I"c:\Qt\4.8.4\include\QtGui" -I"c:\Qt\4.8.4\include" -I"..\wpa_gui-qt4" -I"..\..\wpa_supplicant" -I"..\..\src" -I"..\..\src\utils" -I"c:\Qt\4.8.4\include\ActiveQt" -I"release" -I"." -I"." -I"c:\Qt\4.8.4\mkspecs\win32-g++" -o release\qrc_icons.o release\qrc_icons.cpp g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o release\wpa_gui.exe object_script.wpa_gui.Release -L"c:\Qt\4.8.4\lib" -lmingw32 -lqtmain -lws2_32 -static -lQtGui4 -lQtCore4 mingw32-make.exe[1]: Leaving directory C:/Users/suseelk/Downloads/wpa_supplicant-2.3.tar/wpa_supplicant-2.3/wpa_supplicant/wpa_gui-build-desktop-Qt_4_8_4__4_8_4__Debug'
          13:51:00: The process "C:\Qt\qtcreator-2.4.1\mingw\bin\mingw32-make.exe" exited normally.
          @

          So, I do not see any issue.

          --Kumara

          (I did remove some of build statements, to fit the message in the post.)

          --Kumar

          1 Reply Last reply
          0
          • A Offline
            A Offline
            admd91
            wrote on 30 Jan 2015, 09:19 last edited by
            #5

            Hello kumararajas and thank you for your reply! I tried to build a console app using the settings I got from the previously mentioned thread, it seems that there is a problem with my environment. I'm not sure what it is at this point, but I'll be updating this thread once I get an idea to resolve this. Thanks

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kumararajas
              wrote on 30 Jan 2015, 09:23 last edited by
              #6

              Excellent! Feel free to post, if you get stuck up.

              --Kumar

              1 Reply Last reply
              0
              • A Offline
                A Offline
                admd91
                wrote on 30 Jan 2015, 10:01 last edited by
                #7

                Also kumararajas, if its possible can you send me the binary? I would like to test it on my board. Thank yo u very much!

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kumararajas
                  wrote on 30 Jan 2015, 10:06 last edited by
                  #8

                  Admd91,

                  To which platform you want to build?

                  I could build successfully using g++ compiler. You have to look for the suitable compiler.

                  And, I would recommend you to fix the problem of "Not being able to build". That would enable you to build by yourself.

                  Best Regards,
                  Kumara

                  --Kumar

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    admd91
                    wrote on 4 Feb 2015, 10:17 last edited by
                    #9

                    [quote author="kumararajas" date="1422612394"]Admd91,

                    To which platform you want to build?

                    I could build successfully using g++ compiler. You have to look for the suitable compiler.

                    And, I would recommend you to fix the problem of "Not being able to build". That would enable you to build by yourself.

                    Best Regards,
                    Kumara[/quote]

                    Hello kumararajas,

                    I finally built the said project, it seems I just needed to run qtcreator.sh and not the Qt Creator binary directly.

                    Thanks for your help!

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kumararajas
                      wrote on 9 Feb 2015, 13:12 last edited by
                      #10

                      Why is that so? I do run qtcreator binary directly, when I want to build applications.

                      Is it that, you have problem with environment variables?

                      --Kumar

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        admd91
                        wrote on 13 Feb 2015, 00:04 last edited by
                        #11

                        According to this guide: https://community.freescale.com/thread/309578, we need to run qtcreator.sh since we added the line "source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi" at the very beginning of the script, so that when you run the script, the environment variables are properly set.

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kumararajas
                          wrote on 13 Feb 2015, 09:56 last edited by
                          #12

                          Hi admd91,

                          The key is to set the environment variables correctly.

                          @
                          source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi
                          @

                          When run this script, it loads all the environment variables correctly. Then the environment is set correctly to cross compile your application.

                          After you execute the script, you might run the following

                          @
                          qmake -project
                          qmake
                          make
                          @

                          This is one way to build the Qt application. Or else, You can also set the Build and Run options in Qt creator with the cross compiler path and build it directly from the Qt Creator.

                          --Kumara

                          --Kumar

                          1 Reply Last reply
                          0

                          1/12

                          29 Jan 2015, 02:12

                          • Login

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