CodeLite qmake plugin disabled Global Paths...

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 qmake plugin disabled Global Paths...

Post by jiapei100 »

Hi:

Questions again.

It's said that in

Code: Select all

Settings->Build Settings->gnu g++->Advanced->Global Paths->Libraries Path
If I set up the libraries path correctly, the project will automatically look for the used libraries under this folder.

However, it seems if I created my project using QMakePlugin , the above "global paths" is useless at all now.

Code: Select all

Plugins->QMake->New qmake based project

I strictly follow the tutorial at http://codelite.org/LiteEditor/QmakePlugin

Then , when I tried to build my QMake project, I obtained the following warning messages .

Code: Select all

make[1]: warning: -jN forced in submake: disabling jobserver mode.
/usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ -unix -o objcrop.mk objcrop.pro
WARNING: Failure to find: moc_objcrop.cpp
WARNING: Failure to find: ui_objcrop.h
RCC: Warning: No resources in 'objcrop.qrc'.

And finally, I obtained the following error messages:

Code: Select all

g++  -o Debug/objcrop Debug/main.o Debug/moc_objcrop.o Debug/objcrop.o Debug/qrc_objcrop.o Debug/moc_objcrop.o   [color=#FF0000] [b]-L/usr/lib[/b][/color] cxcore cv cvaux highgui ml -lQtGui -lQtCore -lpthread
g++: cxcore: No such file or directory
g++: cv: No such file or directory
g++: cvaux: No such file or directory
g++: highgui: No such file or directory
g++: ml: No such file or directory
make[1]: *** [Debug/objcrop] Error 1
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/objcrop'
make: *** [All] Error 2
----------Build Ended----------
0 errors, 286 warnings

look at the red word "-L/usr/lib", this seems to tell /usr/lib is the only search paths for linked libraries.
That is to say, QMakePlugin projects ignore "Global Paths->Libraries Path" settings which seems to be a serious bug of CodeLite.
It's then understandable that libraries cxcore, cv, cvaux, highgui, ml are not able to be found under "/usr/local/lib".

Then, in order to build my project, I put "/usr/local/lib" under project->settings->Linker->Library Path.

In this case, error messages still exist as

Code: Select all

g++  -o Debug/objcrop Debug/main.o Debug/moc_objcrop.o Debug/objcrop.o Debug/qrc_objcrop.o Debug/moc_objcrop.o   [color=#FF0000] [b]-L/usr/lib /usr/local/lib[/b][/color] cxcore cv cvaux highgui ml -lQtGui -lQtCore -lpthread
g++: cxcore: No such file or directory
g++: cv: No such file or directory
g++: cvaux: No such file or directory
g++: highgui: No such file or directory
g++: ml: No such file or directory
(I only know "-L/usr/lib -L/usr/local/lib", but is "-L/usr/lib /usr/local/lib" also working?? )
however, libraries cxcore, cv, cvaux, highgui, ml are still not able to be found under these two folders.

Best Regards
JIA Pei
Last edited by jiapei100 on Sun Jan 03, 2010 3:44 pm, edited 1 time in total.
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 qmake plugin disabled Global Paths...

Post by eranif »

jiapei100 wrote:That is to say, QMakePlugin projects ignore "Global Paths->Libraries Path" settings which seems to be a serious bug of CodeLite.
A bug? Yes. Serious bug? I doubt it - as it is not recommended to work with those paths since it affects *all* workspaces.
jiapei100 wrote:(I only know "-L/usr/lib -L/usr/local/lib", but is "-L/usr/lib /usr/local/lib" also working?? )
This is the output generated from *qmake* makefile and not from within codelite's own makefile (which are now disabled, since qmake is taking over)

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 qmake plugin disabled Global Paths...

Post by jiapei100 »

So, Eran:

Can you please help to tell me how to add user libraries in QMakePlugin project?

I can manually revise the .pro file .

However, the GUI based "project->Settings->linker" will not work any longer???

Thanks
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 qmake plugin disabled Global Paths...

Post by eranif »

jiapei100 wrote:However, the GUI based "project->Settings->linker" will not work any longer???
You can still use the GUI settings. One caveat with the linker settings:
since qmake does not differentiate between LIBS and LIBPATH (they are both set into the LIBS variable), you will need to specify the compiler flags as well.

For example:
Lets say that you want to add /usr/lib and /usr/local/lib to your library search path.

Without qmake plugin enabled for the project, the 'Library Path' will contains:

Code: Select all

/usr/lib;/usr/local/lib
With qmake plugin enabled:

Code: Select all

-L/usr/lib;-L/usr/local/lib
Please submit a bug report for this at SF
Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite qmake plugin disabled Global Paths...

Post by eranif »

In short, all your above comments are fixed in SVN trunk:

- Global compiler paths (libs / includes) are now honored by the qmake plugin
- 'Export' makefile now uses the qmake plugin to generate the makefile (when enabled) - you did not report it, but I noticed it is broken while testing
- Lib paths from the project settings ("GUI") are now prefixed with the correct linker switch (by default it is "-L")
- Libraries from the project settings ("GUI") are now prefixed with the correct linker switch (by default it is "-l")

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 qmake plugin disabled Global Paths...

Post by jiapei100 »

Hi, Eran:

Yes, i can see that huge progress has been made !!
Thank you so so so so so so so much !!!

My current problem is
I still have to add a needed include directory into my project settings.

The Global Paths in

Code: Select all

Settings->gnu g++->Advanced->Global Paths->Include Path (Libraries Path)
still doesn't affect my current project search path at all.

You mentioned this could be correct, right?

I thought, no matter what type of project it is, (qt based, console projects, etc.)
Global Paths should always work for all projects inside the current workspace.


What's more, my current compilation errors become

Code: Select all

../utils/Debug/libutils.a(ImageView.o): In function `CImageView':
/home/jiapei/MyPrograms/codelite/aam/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/home/jiapei/MyPrograms/codelite/aam/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/home/jiapei/MyPrograms/codelite/aam/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
/home/jiapei/MyPrograms/codelite/aam/utils/src/ImageView.cpp:13: undefined reference to `vtable for CImageView'
../utils/Debug/libutils.a(ImageView.o): In function `~CImageView':
/home/jiapei/MyPrograms/codelite/aam/utils/src/ImageView.cpp:23: undefined reference to `vtable for CImageView'

Well, I defined (surely, declared first) all functions in this class, and now I'm pasting my class declaration:

Code: Select all

#ifndef __IMAGEVIEW_QT__
#define __IMAGEVIEW_QT__

#include <QGraphicsView>
#include <QLabel>
#include <QBoxLayout>


#include "cv.h"
#include "highgui.h"

using namespace std;
using namespace cv;

/**
show an image in the corresponding wxWindow
*/
class CImageView : public QGraphicsView
{
	Q_OBJECT

private:
	bool					m_isDrawing;
	QGraphicsScene*			m_QTScene;
	QImage*					m_QTImage;
protected:
	void					paintEvent(QPaintEvent *event);

public:
    CImageView( QWidget *parent = 0 );
    virtual                 ~CImageView( );

    //CImageView&             operator=(const CImageView& iImgView);

	void					putImage(const Mat& image);
};

#endif  // __IMAGEVIEW_QT__

The error reports of " undefined reference to `vtable for ***' " hints that something is missing.
I guess the reason could be QGraphicsView is not declared (defined) before the definition of CImageView.


In fact, GUI of this project was developed by Qt Designer and was successfully compiled under Eclipse Galileo.

I've got those ".pro ; .qrc ; .ui " files under my folder. just wondering how to compile everything all together?
The attached picture shows all files under my project folder.

If I dragged my existing intermediate (meta) files "moc_objcrop.cpp", "qrc_objcrop.cpp", "objcrop.qrc", "objcrop.pro" and "objcrop.ui" and "ui_objcrop.h" into my CodeLite project, I will obtain the "first defined here" error messages:

Code: Select all

g++  -o Debug/objcrop Debug/main.o Debug/objcrop.o Debug/moc_objcrop.o Debug/qrc_objcrop.o Debug/qrc_objcrop.o Debug/moc_objcrop.o    -L/usr/lib -L../utils/Debug -L../AAM/Debug -lcxcore -lcv -lcvaux -lhighgui -lml -lgsl -lgslcblas -lboost_regex -lboost_filesystem -lutils -lAAM -lQtGui -lQtCore -lpthread
Debug/qrc_objcrop.o: In function `qInitResources_objcrop()':
/home/jiapei/MyPrograms/codelite/aam/objcrop/qrc_objcrop.cpp:18: multiple definition of `qInitResources_objcrop()'
Debug/qrc_objcrop.o:/home/jiapei/MyPrograms/codelite/aam/objcrop/qrc_objcrop.cpp:18: first defined here
Debug/qrc_objcrop.o: In function `qCleanupResources_objcrop()':

So, any suggestions?
Besides, I am building this project "objcrop", which actually relies on "libutils.a".
The "undefined reference to `vtable for " errors are telling that it's "libutils.a" is missing some definitions.
Therefore, do I need to create a QMakePlugin project for "libutils.a" meanwhile???

Cheers
JIA
You do not have the required permissions to view the files attached to this post.
Welcome to Vision Open
http://www.visionopen.com
Post Reply