LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2010, 02:31 AM   #1
Krzysztow
Member
 
Registered: Apr 2010
Posts: 31

Rep: Reputation: 15
qt git problem, QObject: no such file or directory.


Hi all,

Sorry if someone thinks, this topic should be somewhere else. However, this is a linux application. Nevertheless issue concerns both linux and windows.

I have a strange problem on my computer. I am using qt 4.7 on linux (ubuntu lucid) and windows (XP, 7). I wrote some project, that works fine in Linux and commited it on a remote server. Then I switched to Windows and dowloaded the repository. All works fine (compilation and execution), unless I change anything in any file. I mean, when I change (add or remove some space, character, comment a line, whatever) a file, and try to compile for the second time, I get an error:
"error: QObject: No such file or directory "
In git (tortoise) I have a settings so that appropariate new lines are taken for each OS.

Has anyone of You had similar issues, or someone has idea how to fix it. I need it really badly. It could be due to encoding, however qtcreator has possibility to choose between text-encoding styles, however after playing around , I managed to get nothing.

Will appreciate any help,
Kryzsytof Wielgo

Thank You for any help,
all the best.
 
Old 07-23-2010, 08:23 AM   #2
Krzysztow
Member
 
Registered: Apr 2010
Posts: 31

Original Poster
Rep: Reputation: 15
Additional notes

When everything is fine (no changes have been done), I get g++ with following parameters
Code:
mingw32-make[1]: Entering directory `C:/repo/SomeClass'
C:/Qt/2010.02.1/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[2]: Entering directory `C:/repo/SomeClass'
c:\Qt\2010.02.1\qt\bin\uic.exe someclass.ui -o ui_someclass.h
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DUTILS_LIBRARY -DQT_DLL -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.02.1\qt\include\QtCore" -I"c:\Qt\2010.02.1\qt\include\QtNetwork" -I"c:\Qt\2010.02.1\qt\include\QtGui" -I"c:\Qt\2010.02.1\qt\include\QtXml" -I"c:\Qt\2010.02.1\qt\include\QtTest" -I"c:\Qt\2010.02.1\qt\include" -I"c:\Qt\2010.02.1\qt\include\ActiveQt" -I"release" -I"." -I"c:\Qt\2010.02.1\qt\mkspecs\win32-g++" -o release\someclass.o someclass.cpp
In case there has been a change, I get:

Code:
mingw32-make[1]: Entering directory `C:/repo/SomeClass'
C:/Qt/2010.02.1/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[2]: Entering directory `C:/repo/Project'
g++ -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DGROUPADDRESSMODEL_LIBRARY -DQT_DLL -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT someclass.cpp -o SomeClass
So there is no include path specified for g++ arguments, although in Makefile.Release it is. There is include path, as well as some ui forms parameters.

Anyone knows why compiler omits these information, please?

Thank You.
 
Old 07-23-2010, 01:24 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by Krzysztow View Post
In git (tortoise) I have a settings so that appropariate new lines are taken for each OS.
But maybe git only fixes the newlines after you check in the code, no? I don't remember if mingw tools want unix or DOS newlines; what editor are you using to change the file?
 
Old 07-24-2010, 04:58 AM   #4
Krzysztow
Member
 
Registered: Apr 2010
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ntubski View Post
But maybe git only fixes the newlines after you check in the code, no? I don't remember if mingw tools want unix or DOS newlines; what editor are you using to change the file?
Thank You very much. I think I got the solution and it was elswhere. The problem is to include some *.h files (e.g. file.h) we use #include <File>, where file File has #include "<path>/file.h" directive. On Unix this is not an issue, however on windows it is when the file File has the same name as on of the classes being compiled. It gets an error, as stated before when someone changes a file having File class. Then, when I do anything to File file (insert/remove) new line, compilation goes well.

But this is cumbersome, I would have to insert nl everytime changes to File class are done. So the easiest way is to change #include <File> into #include <MyFile> and a file accordingly.

Thank You very much. I really ate my teeth on it and bdaly needed a help.

Regards,
Krzysztof Wielgo.
 
  


Reply

Tags
file, git, qt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SBo-git - slackbuilds.org on git (with patches for current) ponce Slackware 47 03-12-2011 05:12 AM
Can git checkout a single file in a unique directory? gctaylor1 Programming 2 12-05-2009 08:19 AM
inconsistency issue of git-clone ***/git/mesa/drm with the existing kernel source centguy Linux - Desktop 2 10-08-2008 10:36 PM
Git permissions in object directory frndrfoe Linux - Software 0 05-12-2008 04:27 PM
QObject won't connect binarybob0001 Programming 1 12-05-2007 12:45 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration