CodeLite QT4 -- a full example please...

General questions regarding the usage of CodeLite
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

CodeLite QT4 -- a full example please...

Post by jiapei100 »

Hi:

Here comes an additional question.

My C++/QT4 project runs ok in both Eclipse Galileo and Netbeans 6.8

However, after porting some down to CodeLite, project building reports the following error messages:

./Debug/objcrop.o: In function `objCrop':
/workspace/objcrop/objcrop.cpp:10: undefined reference to `vtable for objCrop'
/workspace/objcrop/objcrop.cpp:10: undefined reference to `vtable for objCrop'
/workspace/objcrop/objcrop.cpp:10: undefined reference to `vtable for objCrop'
/workspace/objcrop/objcrop.cpp:10: undefined reference to `vtable for objCrop'
./Debug/objcrop.o: In function `~objCrop':
/workspace/objcrop/objcrop.cpp:36: undefined reference to `vtable for objCrop'
./Debug/objcrop.o:/home/jiapei/MyPrograms/codelite/aam/objcrop/objcrop.cpp:36: more undefined references to `vtable for objCrop' follow
./Debug/objcrop.o: In function `objCrop::tr(char const*, char const*)':
/workspace/objcrop/objcrop.h:23: undefined reference to `objCrop::staticMetaObject'
../utils/Debug/libutils.a(ImageView.o): In function `CImageView':
/workspace/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/workspace/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/workspace/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/workspace/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
../utils/Debug/libutils.a(ImageView.o): In function `~CImageView':
/workspace/utils/src/ImageView.cpp:23: undefined reference to `vtable for CImageView'
../utils/Debug/libutils.a(ImageView.o):/workspace/utils/src/ImageView.cpp:23: more undefined references to `vtable for CImageView' follow
collect2: ld returned 1 exit status
make[1]: *** [Debug/objcrop] Error 1
make[1]: Leaving directory `/workspace/objcrop'
make: *** [All] Error 2
----------Build Ended----------
1 errors, 0 warnings

It seems to tell that some of the functions declared but not defined. (by google http://www.google.co.uk/search?q=+undef ... =firefox-a )


It's strange that both CodeLite and CodeBlocks report such kind of staffs, but Eclipse / Netbeans /Visual Studio won't .

I know it is only GCC compiler that reports this error. Anything I need to take care of this??

In my case
objcrop is a QT4 project, which depends on my own static library libutils.a
The above error messages seem to tell there are some undefined functions in libutils.a
I double checked project utils, and nothing undefined !!!

What should I do next? Please do help.

Best Regards
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite QT4 -- a full example please...

Post by eranif »

jiapei100 wrote:It's strange that both CodeLite and CodeBlocks report such kind of staffs
Then now I know that I am in a good company
jiapei100 wrote:What should I do next? Please do help.
If GCC complains, then there is something wrong with your code, not doubt here (note that VC is a different compiler, however the newer gcc is more strict)

From the error it implies that you have declared some virtual functions without implementation, but its hard to tell without seeing the code

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite QT4 -- a full example please...

Post by jiapei100 »

Hi, yes, you are correct.

I believe I'm missing something as well.

It's just because QT project will generate some meta files I think, which is used to further produce the final binary executable.

From my own code, I can't see anything missing. I believe it's a QT settings issue.

Like in QT Creator, Eclipse Galileo, Netbeans 6.8, under Ubuntu 9.10, None of these 3 IDEs complains my code.
Also, I believe Eclipse and Netbeans are using GCC as well. (Maybe QT Creator is using its own QT C++ compiler, that's why qmake exisits)

However, what should I set up for QT project using CodeLite?

seriously confused.

Thanks anyway. Just need a full QT example using CodeLite.

Best Regards
JIA Pei


eranif wrote:
jiapei100 wrote:It's strange that both CodeLite and CodeBlocks report such kind of staffs
Then now I know that I am in a good company
jiapei100 wrote:What should I do next? Please do help.
If GCC complains, then there is something wrong with your code, not doubt here (note that VC is a different compiler, however the newer gcc is more strict)

From the error it implies that you have declared some virtual functions without implementation, but its hard to tell without seeing the code

Eran
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite QT4 -- a full example please...

Post by eranif »

Its pretty easy to configure Qt + CodeLite:

Read this:

http://codelite.org/LiteEditor/QmakePlugin

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite QT4 -- a full example please...

Post by jiapei100 »

Thanks Eran.

Question posted at http://codelite.org/forum/viewtopic.php?f=11&t=731

I followed http://codelite.org/LiteEditor/QmakePlugin to set up Qt4 for CodeLite in ubuntu 9.10

The 'QTDIR' should point to your Qt's base installation directory



How to set up 'QTDIR' in Ubuntu 9.10?

I've got

/usr/include/qt4 -- for all header files
/usr/lib/qt -- for libraries


So, do we set 'QTDIR' to '/usr' ?? or something else?

Cheers
JIA Pei




eranif wrote:Its pretty easy to configure Qt + CodeLite:

Read this:

http://codelite.org/LiteEditor/QmakePlugin

Eran
Welcome to Vision Open
http://www.visionopen.com
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite QT4 -- a full example please...

Post by jiapei100 »

Thanks eranif !!

CodeLite is cool !!
I'm now able to deal with QT4 project in CodeLite SVN now.

Suggestion:

It's better for the users to create a QT4 project directly, other than using Plugins.
How do you think of it?

cheers
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite QT4 -- a full example please...

Post by eranif »

jiapei100 wrote:Suggestion:

It's better for the users to create a QT4 project directly, other than using Plugins.
How do you think of it?
I dont understand your suggestion, can you please elaborate?

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite QT4 -- a full example please...

Post by jiapei100 »

Sorry, my mistake.

It seems QT projects can be created in both ways

1) Plugins->QMake->New qmake based project-> ......

2) Click on the current workspace, then
Create New Project->
Categories (GUI)
Type (Qt with qmake enabled)...


I was thinking only the first is working and I was suggesting the 2nd way.

Cheers
JIA
Welcome to Vision Open
http://www.visionopen.com
Post Reply