[SOLVED] Syntax error: newline unexpected in ui
-
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.
-
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?
-
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.
-
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 directoryC:/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.)
-
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
-
Excellent! Feel free to post, if you get stuck up.
-
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 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!
-
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?
-
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.
-
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