Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Error with QT under eclipse and windows 7
Error with QT under eclipse and windows 7 [message #957992] Thu, 25 October 2012 17:09 Go to next message
Omar Mustafa is currently offline Omar Mustafa
Messages: 3
Registered: October 2012
Junior Member
Hello guys,

I have tried now about 8 hours to get running qt on eclipse. Also I have installed MinGW, QT Integration and CDT for C++ programming under eclipse.

I get following error messages on my console if I try to compile an empty project:
19:00:08 **** Build of project test ****
mingw32-make.exe debug
mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[1]: Entering directory `D:/Entwicklung/SmartBlue/test'
g++ -c -g -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"c:\Qt\4.8.3\include\QtCore" -I"c:\Qt\4.8.3\include\QtGui" -I"c:\Qt\4.8.3\include\Qt3Support" -I"c:\Qt\4.8.3\include" -I"c:\Qt\4.8.3\include\ActiveQt" -I"debug" -I"c:\Qt\4.8.3\mkspecs\default" -o debug\main.o main.cpp
In file included from c:\Qt\4.8.3\include/QtCore/qglobal.h:1:0,
mingw32-make.exe[1]: Leaving directory `D:/Entwicklung/SmartBlue/test'
from c:\Qt\4.8.3\include/QtCore/../../src/corelib/global/qnamespace.h:45,
from c:\Qt\4.8.3\include/QtCore/qnamespace.h:1,
from c:\Qt\4.8.3\include/QtCore/../../src/corelib/kernel/qobjectdefs.h:45,
from c:\Qt\4.8.3\include/QtCore/qobjectdefs.h:1,
from c:\Qt\4.8.3\include/QtCore/../../src/corelib/kernel/qobject.h:47,
from c:\Qt\4.8.3\include/QtCore/qobject.h:1,
from c:\Qt\4.8.3\include\QtCore/../../src/corelib/kernel/qabstracteventdispatcher.h:45,
from c:\Qt\4.8.3\include\QtCore/qabstracteventdispatcher.h:1,
from c:\Qt\4.8.3\include\QtCore/QtCore:3,
from main.cpp:1:
c:\Qt\4.8.3\include/QtCore/../../src/corelib/global/qglobal.h:45:20: fatal error: stddef.h: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [debug/main.o] Error 1
mingw32-make.exe: *** [debug] Error 2


can please somebody helps me. I'm with the end with my nerves.

thanks a lot to all.

Kind Regards,





Re: Error with QT under eclipse and windows 7 [message #958001 is a reply to message #957992] Thu, 25 October 2012 17:18 Go to previous messageGo to next message
Omar Mustafa is currently offline Omar Mustafa
Messages: 3
Registered: October 2012
Junior Member
If I try to compile with the command line and g++ I get following error message:
main.cpp:1:18: fatal error: QtCore: No such file or directory
compilation terminated.

I hope this helps to find the error.
Re: Error with QT under eclipse and windows 7 [message #962788 is a reply to message #958001] Mon, 29 October 2012 10:28 Go to previous messageGo to next message
Anthony Turner is currently offline Anthony Turner
Messages: 1
Registered: October 2012
Location: New York
Junior Member
Hey Omar,


Your problem sounds like it has to do with forgetting to include the QtCore for your compiler's path.

I have just spent the past couple of days pulling my hair out with trying to integrate QT with eclipse. I even attempted GDK+, GTKmm and wxWidget.

Finally, last night, I have QT working with eclipse. The only problem is when ever I run project with QT code that uses a Q_OBJECT( this is for Signals and Slots ), I get a compile error about v_table. I looked it up and it has something to do with QMake and mocing up ( moc.exe I believe ).


Anyhow, for your problem, go to your Project, select Properties, then C/C++ Build, and Settings.
Underneath the first tab ( Tool Settings ), select the compiler you are using. For example, If you are creating a C++ project, then select GCC C++ compiler. If a C Project, then select GCC C Compiler.

Select Includes . You will notice at the top it says "Include Paths (-I)", this is key because if you was to compile and run your project with another compiler ( such as QT Creator, or in cmd with MinGW32-make ), you would notice in console or compiler verbose output that there are directories which have this -I before them. For Example, -IC:\QT\include\QtCore
These are the paths needed for eclipse.

In your case, you need to click on the green plus icon and add the path to where the QtCore file is located.

So, what you can do, in command console, compile your program with mingw32-make:
Go to your project directory in command prompt ( assuming windows ).
compile your project once by doing each of these lines pushing enter after each line...

qmake -project
qmake
mingw32-make

This is assuming your environment variables are setup to know where qmake and mingw32-make are.

After the last command ( mingw32-make ), take note of what flags and paths are used when your project is compiled.

Like I mentioned, anything with -I in front of it gets added to your projects GCC Compiler Include.

There will be one line with -L and then a directory; this is your Library path.
This path gets added to MinGW C++ Linker, Libraries, Libraries Search Path, which is also with in the same section as the GCC C++ compiler.

There will be flags with -l ( lower case L ), each one that comes after the -l goes in MinGW C++ Linker, Libraries, Libraries (-l). Just the name of the library with out the -l.

In MinGW C++ Linker, Miscellaneous, there is a section named Linker Flags. Here, you can add the linker flags. I forget which one they were exactly from console, but they are around or before the -L and where the Linker options begin. It should say something like g++ -mthreads -Wl,-subsystem,windows

There are a bunch of flags for the G++ C++ compiler as well. Many start with -D
The base ones are something like -c -fmessage-length=0 -Wextra -fno-exceptions -fno-rtti These can be set in the Miscellaneous section of the GCC C++ Compiler.

Have you set up an external Builder?
If not, Go to C/C++ Build
ToolChain editor
Under Current builder choose GNU Make Builder then click apply.
Then go to C/C++ Build
Builder type should be External Builder
Build command: mingw32-make


It has taken me a lot of time to figure this out, so I'm happy to share it.
All works well with eclipse except the Q_OBJECT. Because of this, I created a small batch file to compile my program. I use this in eclipse through the external configuration launcher.
The autoexec.bat runs the commands i mentioned above:

qmake -project
qmake
mingw32-make

I hope my info is organized and easy to follow.
Best wishes and happy coding.



YasuoCodez
Re: Error with QT under eclipse and windows 7 [message #1058535 is a reply to message #962788] Tue, 14 May 2013 12:18 Go to previous messageGo to next message
sushil pandey is currently offline sushil pandey
Messages: 4
Registered: May 2013
Junior Member
Hi,
I followed this post to integrate "rosegardenmusic.com" project's source code on windows 7 64 but machine. Now I am getting the following errors on my console while building the project.
**** Build of configuration Debug for project rosegarden ****

mingw32-make all
'Building file: ../src/sound/rtmidi/RtMidi.cpp'
'Invoking: GCC C++ Compiler'
g++ -I"C:\Program Files (x86)\Nokia\Eclipse" -I"-IC:\QT\include\QtCore" -O0 -g3 -Wall -c -fmessage-length=0 -Wextra -fno-exceptions -fno-rtti -MMD -MP -MF"src/sound/rtmidi/RtMidi.d" -MT"src/sound/rtmidi/RtMidi.d" -o"src/sound/rtmidi/RtMidi.o" "../src/sound/rtmidi/RtMidi.cpp"
In file included from ../src/sound/rtmidi/RtMidi.cpp:41:0:
../src/sound/rtmidi/RtMidi.h:645:2: warning: unused parameter 'clientName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:647:8: warning: unused parameter 'portNumber' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:647:8: warning: unused parameter 'portName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:648:8: warning: unused parameter 'portName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:651:15: warning: unused parameter 'portNumber' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:654:8: warning: unused parameter 'clientName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:660:3: warning: unused parameter 'clientName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:662:8: warning: unused parameter 'portNumber' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:662:8: warning: unused parameter 'portName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:663:8: warning: unused parameter 'portName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:666:15: warning: unused parameter 'portNumber' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:667:8: warning: unused parameter 'message' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.h:670:8: warning: unused parameter 'clientName' [-Wunused-parameter]
../src/sound/rtmidi/RtMidi.cpp: In static member function 'static void RtMidi::error(RtError::Type, std::string)':
../src/sound/rtmidi/RtMidi.cpp:86:38: error: exception handling disabled, use -fexceptions to enable
src/sound/rtmidi/subdir.mk:18: recipe for target 'src/sound/rtmidi/RtMidi.o' failed
mingw32-make: *** [src/sound/rtmidi/RtMidi.o] Error 1

Any help please. I did'nt created a new post because I think I can give a reference of this post that how much it has helped me to integrate it.
Thanks,
Sushil
Re: Error with QT under eclipse and windows 7 [message #1058549 is a reply to message #1058535] Tue, 14 May 2013 12:44 Go to previous messageGo to next message
Nobody Mising name is currently offline Nobody Mising name
Messages: 75
Registered: July 2010
Member
sushil pandey wrote on Tue, 14 May 2013 08:18
Now I am getting the following errors on my console while building the project.

How does your problem relate to Eclipse CDT if you are building with custom makefile?

Do you get these errors only from building inside Eclipse and everything works fine if you build from cmd.exe (so that there is Eclipse problem somewhere)?

P.S. Eclipse just calls mingw32-make and parses its output. So if your makefile or environment is not configured properly Eclipse can do nothing about this. You should fix makefile/environment regardless of Eclipse.
Re: Error with QT under eclipse and windows 7 [message #1059791 is a reply to message #1058549] Tue, 21 May 2013 15:35 Go to previous messageGo to next message
sushil pandey is currently offline sushil pandey
Messages: 4
Registered: May 2013
Junior Member
Hi,

I followed below links

wwwdotrosegardenmusicdotcom/wiki/dev:eclipse

wwwdotyoutubedotcom/watch?v=8FhkEzinEdI

to integrate "rosegarden" on eclipse juno. Now the problem is that every time I am getting a new fatal error "No such file or directory" when I build the project. Even the files exists. I am not able to find a proper solution.
I am very new to eclipse and don't have any idea how to build through cmd.exe.

Here is the content of .metadata/.log file.

!SESSION 2013-05-21 20:59:31.668 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Framework arguments: -product org.eclipse.epp.package.cpp.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.cpp.product -clean

!ENTRY org.eclipse.egit.ui 2 0 2013-05-21 20:59:51.070
!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level
Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory.
The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in
this system level configuration. The Git installation location can be configured on the
Team > Git > Configuration preference page's 'System Settings' tab.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.egit.ui 2 0 2013-05-21 20:59:51.071
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\sushil'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

Could you please provide me a better solution.

Thanks,
Sushil
Re: Error with QT under eclipse and windows 7 [message #1059893 is a reply to message #1059791] Wed, 22 May 2013 06:49 Go to previous messageGo to next message
sushil pandey is currently offline sushil pandey
Messages: 4
Registered: May 2013
Junior Member
sushil pandey wrote on Tue, 21 May 2013 11:35
Hi,

I followed below links

wwwdotrosegardenmusicdotcom/wiki/dev:eclipse

wwwdotyoutubedotcom/watch?v=8FhkEzinEdI

to integrate "rosegarden" on eclipse juno. Now the problem is that every time I am getting a new fatal error "No such file or directory" when I build the project. Even the files exists. I am not able to find a proper solution.
I am very new to eclipse and don't have any idea how to build through cmd.exe.

Could you please provide me a better solution.

Thanks,
Sushil

Re: Error with QT under eclipse and windows 7 [message #1060226 is a reply to message #1059893] Thu, 23 May 2013 15:25 Go to previous messageGo to next message
sushil pandey is currently offline sushil pandey
Messages: 4
Registered: May 2013
Junior Member
Hi All,

I am finally able to short-out these problems by using eclipse's europa version with MinGW 3.4.2 and QT 4.3.3. Now there is no previous errors (initially it was 521 errors Smile).

But now I can see 2 new error while importing the source code (which is on C:/Users/sushil/Desktop/rosegarden) as QT Gui Project in eclipse.

mingw32-make debug
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/sushil/Desktop/rosegarden'
mingw32-make[1]: *** No rule to make target `..\win32-mingw-rtmidi\data\locale\ca.qm', needed by `debug\rosegarden.exe'. Stop.
mingw32-make[1]: Leaving directory `C:/Users/sushil/Desktop/rosegarden'
mingw32-make: *** [debug] Error 2

I know this is something related to project's properties or preferences settings. But I am very new to eclipse so I think I messed up something while troubleshooting my previous errors.

Any help please.

Thanks,
Sushil Pandey
Re: Error with QT under eclipse and windows 7 [message #1060353 is a reply to message #1060226] Fri, 24 May 2013 09:02 Go to previous message
Nobody Mising name is currently offline Nobody Mising name
Messages: 75
Registered: July 2010
Member
sushil pandey wrote on Thu, 23 May 2013 11:25
I know this is something related to project's properties or preferences settings. But I am very new to eclipse so I think I messed up something while troubleshooting my previous errors.

How is that "related to project's properties or preferences settings" if Eclipse just calls mingw32-make and everything about building is defined inside your custom (or generated?) makefile? You can call mingw32-make manually outside of Eclipse and get exactly the same problems, so how is that related to Eclipse itself?

Can't understand why do you ask about problems with building rosengarden on CDT forum and not on rosengarden forum/mailing list.
Previous Topic: Override method Run of the C projects
Next Topic:Content assist - Proposal types
Goto Forum:
  


Current Time: Sat Sep 20 14:19:15 GMT 2014

Powered by FUDForum. Page generated in 0.01977 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software