Solved Error: Compiling legacy Souce code
-
@VRonin
I downloaded the latest qwt 6.1.3 and I followed the instruction that you mentioned.
I used command line (CMD) and at the end it failed:What i did :
cd C:\qwt-6.1.3
qmake qwt.pro -o MakeFile
Info: creating stash file C:\qwt-6.1.3.qmake.stashThen I can see that the file MakeFile was created
then I typed:C:\qwt-6.1.3>Mingw32-make -f MakeFile
then it compile all the files OK until it get to the state below:
generating moc/moc_predefs.h
g++: CreateProcess: No such file or directory
Mingw32-make[2]: *** [moc/moc_predefs.h] Error 1
Mingw32-make[2]: Leaving directoryC:/qwt-6.1.3/src' Mingw32-make[1]: *** [release-all] Error 2 Mingw32-make[1]: Leaving directory
C:/qwt-6.1.3/src'
Mingw32-make: *** [sub-src-make_first-ordered] Error 2I don't know what went wrong. However, a Lib folder was created but was empty.
Any idea? -
I just tried and it's extremely easy.
- download and unpack the source from https://sourceforge.net/projects/qwt/files/qwt/
- open a developer console and
cd
to the folder where you unpacked the source - call
qmake
on the command line - call
make
on the command line (nmake
for MSVCmingw32-make
for mingw) - call
make install
on the command line (nmake install
for MSVCmingw32-make install
for mingw) - The library will be ready for you in
/usr/local/qwt-x.x.x
or, on Windows,C:/Qwt-x.x.x
-
When looking at some of your problems, I am wondering if there is a problem with your installation of Qt creator and Qt libs.
Did you follow the advice far above and did a fresh installation using the online installer?
This should give a fresh and complete setup of Qt creator and Qt libs. There you can check step by step with the examples that components are working.Presumably there are some mix due to installation of different Qt creator versions and possibly also some Qt lib versions. At least that would explain your trouble to compile qwt.
-
I started with fresh and the latest qt online installation and because it didn't work, I went and I tried diffirent version.
As the source code was created in 13/04/2014, I tried different Qt and Qt creator down to version 2.2.1 whch seem resolve the issue of the legacy header file.
This what I got installed in my PC:
Qt version: 4.0.0, 4.7.4 and 5.1
Qt Creator version: 4.5.1, 2.4.1,2.3.0 and 2.2.1.
The source code was created using Qt 4.7.4 and also uses qwt 6.0.0. I don't know about the Qt Creator version but I worked it out ( using the source code date) to be version 2.2.1.
Does having many different vesion causes issues ?
I got Windows 10 64 bit. The Qt Creator is 32 bit. Can this be a problem?I may try to un-install everything and try fresh.
-
@robrob said in Error: Compiling legacy Souce code:
Does having many different vesion causes issues ?
Many Qt lib versions do not create a problem.
I got Windows 10 64 bit. The Qt Creator is 32 bit. Can this be a problem?
No. I have win10 64 bit and standard Qt creator 32 bit V4.5.1 as well. And definitely not the problems you have. And I am using also qwt, but newer versions because of Qt5.
I may try to un-install everything and try fresh.
That is highly recommended. With the online installer you can install only one Qt creator version, which is completely sufficient. Online installer helps you slao to find the right MinGW compiler which you need to install to work with the Qt libs version.
Note, the online installer is installing typically Qt libs under c:/Qt/5.4.2 or similar while the creator is installed under c:/Qt/tools. Best advice is not to mess around with this.
-
Hi Koahnig and thank you for the reply.
That is highly recommended. With the online installer you can install only one Qt creator version, which is completely sufficient. Online installer helps you slao to find the right MinGW compiler which you need to install to work with the Qt libs version
I tried to compile the qwt with Qt Creator 4.5.1 ( with Qt 4.7.4) which I think it is the latest version and it failed. Then I tried with version 2.4.1 ( with Qt 4.7.4) and it worked ( only few warining messages). Now I got the lib folder.
It seem to me that any project has to be opened or compiled by the Qt Creator version which created the project in the first place, thus using the latest Qt Creater version to open an old or legacy source code would fail compilaton. This is what I experienced so far but then I just started using Qt so it is too early for me. Please correct me if I am wrong. -
@robrob said in Error: Compiling legacy Souce code:
It seem to me that any project has to be opened or compiled by the Qt Creator version which created the project in the first place, thus using the latest Qt Creater version to open an old or legacy source code would fail compilaton.
No. You don't even need Creator to build a QMake project. Of course you need to set up suitable compilers, library version, debuggers etc. for the build.
Please correct me if I am wrong.
You are.
-
@robrob said in Error: Compiling legacy Souce code:
I tried to compile the qwt with Qt Creator
You don't compile with QtCreator, QtCreator is an IDE not a compiler. You need to make sure your environment is set up correctly (compiler, Qt).
-
Hi Jsulm,
When I say compile, I mean build. -
What we are trying to tell you is that Qt creator is an IDE (Integrated Deveopment Environment). This is basically an editor with the capability to launch other programs.
When you are making a build through creator it is nothing else than opening command line on windows and calling qmake for the specific pre-build you have chosen. When you have 10 different Qt lib versions on your PC, you have 10 different tool chains with 10 associated qmakes. Therefore, you can change in between the tool chain and compile (build) with different compilers and Qt libs.
qmake accesses some setup configuration files indicating what the compiler used for the build was and therefore, it will use the appropriate compiler.
Qt header files are part of Qt libs and go along with them. The same for QWT, also moc and other stuff. There is apparently an issue with the setup of your Qt libraries and teh associated tools. Changing to older versions of Qt creator does little if nothing change.
-
@koahnig
What we are trying to tell you is that Qt creator is an IDE (Integrated Deveopment Environment).
Ok, I see. I knew that bit.
Most of the time I use the IDE to build the project because it is more convinent. For example Microsoft Visual Studio.
I am not familiar with using the compiler directlty. I found it hard to set the compiler parameters. This transparent when I use IDE.
Is it easy to use the compiler and the linker directly ? -
It is not so hard. However, I have not done in real work for a long time.
When you have followed instructions to build QWT, you are calling qmake that is already the lowest you should get.
Using Qt creator helps to set up parameters and that is the best you can do. Especially when you do not want to bother about the details. This all shall make the work easier. You basically have a couple of different layers, which can be called independently, but all requires a special syntax.
The IDE is helping to organize all, but that's it. Standard headers are part of the compiler as it has always been and always will be. Qt headers are part of Qt. QWT header are part of QWT.
So all this are different tools. Only some stupid examples.
When you are trying to eat a steak, but you have only a spoon, you typically got a significant problem. It does not matter when you have the spoon in the right or left hand. A fork and a steak knife are the proper tools and typically some conventions how to use.
When you are changing Qt creator versions it is similar to change the spoon from left to right hand. -
@robrob You don't need to call the compiler directly. If it is a qmake based project you simply do:
cd PATH_TO_QWT qmake make make install
-
cd PATH_TO_QWT
qmake
make
make install*I tried that but it didn't work then I tried Qt Creator 2.4.1 and it did build and generate the lib folder with its *.dll library.
If it is a qmake based project
How can you tell if it is qmake project or other project?
Is qmake a compiler and Mingw32-make a linker?
I can see that the creator call qmake first then call ming32-make and at the end the . exe is generated. -
I would like to thank every one who helped me here . your information was very valuable.
Now I managed to compile the source without error. I can also debug and run the software.
There is a tiny issue :
debug folder has a .exe file.
release folder is empty (no .exe)
I can't publish the application. A message say:"you can publish at the moment". -
force a release build, call
make release
instead of justmake
-
@VRonin said in Error: Compiling legacy Souce code:
force a release build, call make release instead of just make
How do you that within Qt Creator ?
I can see :
It call qmake :
15:22:32: Starting: "c:\qt\4.7.4\bin\qmake.exe" "C:\Users\rabmerab\Documents\Qt projects\SA430.Gui1\V2.0\Src\SA430Gui.pro" -r -spec win32-g++ "QMLJSDEBUGGER_PATH=C:/Qt/4.7.4/qtc-qmldbg".then it call ming32-make
15:23:49: 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.Debug -
@robrob
After a bit of head scratching, I found how to force the Qt Creator to generate .exe in the release folder.
The confusion was in the project setting when once your open the project; default setting was : one for debug and one for release. This made believe that, it will generate both debug folder and release folder when I press Build button.
I did see both folder created but only debug folder was filled with files.
However, the IDE Gui, there another button where you can select between debug and release function.
Selecting Release function resolve the issue.
Now this thread is RESOLVED,