Got "Missing separator" error building Cppcheck - build

I have trouble building Cppcheck in Windows. It's ok while building in Studio, but when I try build.bat, it fails with the following:
Makefile.Release:148: *** missing separator. Stop.
mingw32-make: *** [release] Error 2
I'm not good with all the makefile technology, but the problematic spot does look broken:
{..\externals\tinyxml}.cpp{temp\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fotemp\ #<<
$<
<<
Looks like something screws the generation of configuration dependent Makefiles. Any ideas?
UPDATE: Could it be related to the fact, I'm building 1.60 using qmake from Qt 5.1?

Using this in the root folder should work:
mingw32-make LDFLAGS=-lshlwapi

Related

Unable to Compile a Qt project in qtcreator

I am unable to compile a simple Qt project (an example with the mainwindow). I tried it via command shell and also on QtCreator. first qmake should create makefile with the command rule uic to translate as simple as it should my ui to a .h.
Qt Creator indicating the below warning / error messages on the console.
09:06:30: Running steps for project untitled...
09:06:30: Starting: "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" C:\workspace_llb_27-05-2016\untitled\untitled.pro -r -spec win32-g++
09:06:32: The process "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" exited normally.
09:06:32: Starting: "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe"
C:/mingw/mingwx64_481r0-sjlj-rev2/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
/C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h
Makefile.Debug:318: recipe for target 'ui_mainwindow.h' failed
process_begin: CreateProcess(NULL, /C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
mingw32-make[1]: *** [ui_mainwindow.h] Error 2
mingw32-make[1]: Leaving directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
09:06:33: The process "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled (kit: Qt 5.6.0 (Built by mingwx64_481r0-sjlj-rev2))
When executing step "Make"
Thanks
I find the solution eventually. If It happens to me it could happen to anyone. Actually everything have worked before I install gitbash. I set as variable system the bin of gitbash to my path system. However gitbach contains sh.exe which unix tool. So everytime I build via Qtcreator or console 2 uic_wrapper were created one .sh one .bat and all my makefile were unix like. in nutshell never set any UNIX TOOL TO YOUR WINDOWS SYSTEM. Mingw could contain MSYS take care !! at least most of tools oriented development are UNIX like.
I am suspecting something wrong with your Desktop Kit maybe. I tried to create a new default mainwindow project just like how you did and I see the first few steps like below:
14:48:15: Running steps for project untitled...
14:48:15: Starting: "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" C:\untitled\untitled.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
14:48:16: The process "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" exited normally.
14:48:16: Starting: "D:\Qt\Qt5.6.0\Tools\mingw492_32\bin\mingw32-make.exe"
D:/Qt/Qt5.6.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
You can notice there's a difference between the qmake path my application is using compared to yours.
Mine looks like this: D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe
Yours looks like this: D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe
And I guess qt-everywhere-opensource-src-5.6.0 looks like the Qt source code that you might have pulled from web. Hope this information gives you some pointer to figure out what's going wrong.

libQt5Core.so: undefined reference to `__cxa_throw_bad_array_new_length#CXXABI_1.3.8

I'm using a cross compiled qt 5.4.2 and I getting the following error when I try to build simple QtWidget app (the app is just a window)
09:55:42: Running steps for project untitled...
09:55:42: Configuration unchanged, skipping qmake step.
09:55:42: Starting: "/usr/bin/make"
g++ --sysroot=/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot -Wl,-O1 -Wl,-rpath,/usr/local/qt5.4-d6cx/lib -o untitled main.o mainwindow.o moc_mainwindow.o -L/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/local/qt5.4-d6cx/lib -lQt5Widgets -L/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/lib64 -L/usr/local/qt5.4-d6cx/lib -lQt5Gui -lQt5Core -lGLESv2 -lpthread
/home/pf/ssdk-d6cx/host/usr/x86_64-buildroot-linux-gnu/sysroot/usr/local/qt5.4-d6cx/lib/libQt5Core.so: undefined reference to `__cxa_throw_bad_array_new_length#CXXABI_1.3.8'
collect2: ld returned 1 exit status
make: *** [untitled] Error 1
09:55:42: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled (kit: d6cx)
When executing step "Make"
09:55:42: Elapsed time: 00:00.
I really don't understand what is going on.
Could be a compatibility problem with some libs on the target OS?
I will appreciate any help that point me to the solution.
Thanks in advance.
I found the solution to the problem.
The real problem was that I was using Qt Creator as IDE to cross compile and it set qmake to use a device different that the one I was cross compiling for.
I mean the original setting for qmake was:
qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec linux-g++
and it should be:
qmake '/home/pf/D6Cx/test app/untitled/untitled.pro' -r -spec devices/linux-d6cx-g++
whith this last one configuration the app is built correctly!!
The way I use to force qmake to use my specific device was (in Qt Creator):
go to Projects/Build setting
in the section Build Steps -> qmake add in Additional arguments:
-spec devices/linux-d6cx-g++
and that will overwrite the original setting for -spec
Thanks!

Unrecognized Command Line Option '-WI'

I'm trying to set up my Qt for college and I'm running into some issues. I'm running Windows 8, and I'm not sure which version of Qt or QtCreator but not the latest - we were given the version installer so we must use this one, although I did install the latest MinGW myself before the QtCreator setup.
I tried some demo code in QtCreator and I got the error "Unrecognized Command Line Option "-WI" when I try run the following code.
#include <QtCore/QCoreApplication>
#include <QtGui/QMessageBox>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QMessageBox msgBox;
msgBox.setText("This is some text.");
msgBox.exec();
return a.exec();
}
I need to do my assignment and I'm not sure how I can do it when I'm getting all of these strange errors.
Any help would be appreciated.
Thanks in advance!
* EDIT *
This is the error output that I can find in QtCreator during the build process.
Running build steps for project TestProject...
Configuration unchanged, skipping qmake step.
Starting: "C:/MinGW/bin/mingw32-make.exe" -w
mingw32-make: Entering directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
C:/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\TestProject.exe debug/main.o -L"c:\Qt\2010.04\qt\lib" -lQtCored4
Makefile.Debug:73: recipe for target 'debug\TestProject.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
Makefile:34: recipe for target 'debug' failed
mingw32-make: Leaving directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
g++: error: unrecognized command line option '-Wl'
mingw32-make[1]: *** [debug\TestProject.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/MinGW/bin/mingw32-make.exe" exited with code %2.
Error while building project TestProject (target: Desktop)
When executing build step 'Make'
Here are the contents of the .pro file generated by QtCreator :
QT += core
QT -= gui
TARGET = TestProject
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
As Mats says the problem is the extra -Wl in the command line.
This is due to a bug in the QT conf files, and thankfully this can be fixed "permanently" (locally).
You need to edit one (possibly both) of these files (often in C:\Qt\2010.02\qt\mkspecs):
mkspecs\default\qmake.conf
mkspecs\win32-g++\qmake.conf
changing this:
QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
to this:
QMAKE_LFLAGS = -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
because somehow the -Wl, from the start of the first line is wrongly on the end of the second line.
After this edit, if you clean and then rebuild your project you will no longer see the error.
Notes:
this same bug causes this issue too, so thanks to leemes for his answer there)
it is fixed in Qt since version 4.7 I believe
The problem is clearly:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\TestProject.exe debug/main.o -L"c:\Qt\2010.04\qt\lib" -lQtCored4
I'm not sure exaclty how this is compiled, but to me it looks like a makefile with -Wl${somestuff} and for some reason ${somestuff} is not defined. Either that, or there is a spurious -Wl in the commendline for the link command, but that seems less likely.

Can't build test application with WxWIdgets in Netbeans

I'm a total c++ Newbie.
I'm trying to build windows aplications with Wx-Widgets under Net Beans.
So far so good. I have instaled everything, configured, build wx-widgets and attached it to the new project - with help of a good man here: Can't make wx-widget work with net-beans.
Now I try to build my first app:
#include <wx/string.h>
int main(int argc, char **argv)
{
wxPuts(wxT("A wxWidgets console application"));
}
and this is what I get:
I'm not sure if this is readable so I paste the errors:
g++ `C:\WXWIN\wx-config --cxxflags` -c -g -I../../../WXWIN/include `C:\WXWIN\wx-config --cxxflags` -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
/bin/sh.exe: C:WXWINwx-config: command not found
/bin/sh.exe: C:WXWINwx-config: command not found
In file included from ../../../WXWIN/include/wx/defs.h:21:0,
from ../../../WXWIN/include/wx/string.h:25,
from main.cpp:1:
../../../WXWIN/include/wx/platform.h:196:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
make[1]: Leaving directory `/c/xampp/htdocs/WxWwigets_tutorial'
BUILD FAILED (exit value 2, total time: 859ms)
Please notice that I have set everything in linker and compiler like ordered: http://wiki.wxwidgets.org/Compiling_using_Netbeans
The error is right in front of you: "command not found". If you use /bin/sh, you must use Unix style paths, e.g. C:/WXWIN/wx-config instead of DOS paths with the backslashes.
I seriously advise you to get familiar with the environment you're using instead of just following the Wiki instructions without understanding them, otherwise your problems won't be over any time soon.

Dev-C++ - [Build Error] [main.o] Error 1

Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im not getting anywhere with it... at the moment and every project I try to compile gives the same error...
C:\Dev-Cpp\MY_Project\Makefile.win [Build Error] [main.o] Error 1
Compiler log
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\MY_Project\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\MY_Project\Makefile.win" all
g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -pg -g3
The system cannot find the path specified.
make.exe: *** [main.o] Error 1
Execution terminated
What is your OS? I think Bloodshed version of the program have some problems with Win8. However you can download Orwell version. It runs smoothly.
Have you looked at this thread? Specifically the first post on this page.