1.Install required tools.CMake,GLUT(freeglut3,freeglut3-dev) and X Miscellaneous Utilities headers(libxmu),X Input Device headers(libxi-dev) with this command.
sudo apt-get install cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev
2.Qt-4.8.1 was installed already.
3 Export qmake PATH to ENV,using bash_profile or .profile as appropriate.or mention qmake PATH where ever necessary,like if the build files are generated using cmake-gui then for the QT_QMAKE_EXECUTABLE property name show the qmake PATH.
4.Show the BOOST path /usr/include/
6.Already the glut and glew dependencies are mentioned in the FindGLUT.cmake and FindGLEW.cmake files which are SET in the main CMakeLists.txt file.
5.configure and generate the build files and subsequently compile the project sources with make -j8.
Thursday, September 26, 2013
Friday, July 5, 2013
QtCreator+Qt4.8.1+Windows+Mingw stray'\376'
Yes,you are right.your file in the project got encoded somehow,so nuetralize it...i mean copy it to Notepad or something and remove all formatting,n replace this file with the one in the project..and compile once again.it worked for me.i hope this works for you too as simple as that.
Thursday, June 27, 2013
How to use Kdevelop with CMake.
when I was using Redhat linux os for a project I had to work with kdevelop IDE.the build system was cmake.there were some 3rd party libraries like qwt, glut&glew also included in the project.for loading the project into kdevelop first the cmake has to generate the make files which the kdevelop will recognise."Cmake -G kDevelop3" command will generate the specific files required for the IDE.then it is easy to import the project into kdevelop.debugging is easy in kdevelop as the variable values are shown when Hovered, and version control is also easy.compare it with Qtcreator for the pros and cons.
Friday, June 14, 2013
SVN setup on a Local Machine
SVN setup on a Local Machine.
Sometimes it is required to setup a svn repository on a local machine, in some cases the Linux filesystem will be on a shared drive.Generally SVN needs URL terminology for referring to the repository,so we will setup a repository using a file system access.(file://).
The following step creates the repository.
svnadmin create --fs-type fsfs /redhat/svn/projectname/
The above project name directory is filled with some files and directories which are necessary for a repository customization etc.
The following step Imports an existing project.and generally it is a custom for svn projects for this kind of directory structure.
tags..
branches..
trunk..
here in the trunk directory the actual project files are present.once your project is ordered in this fashion and cleansed of any unwanted things like binaries and generated files or compiled code.
svn import /path/to/project/ file:///redhat/svn/projectname/trunk -m 'Initial import'
Here if the SVN_EDITOR and other variables are not set then a error message will be reported.
so -m option with the commit message “Initial Import” will avoid the error message.
The following step creates the subversion specific and version aware working copy.
svn checkout file:///redhat/svn/projectname .
The above step checkout(created)a copy of project in to the current directory “.”(dot).
there will be a .svn direcory in the working copy
The working copy information can be obtained by the info command.
The below command gives the details of the version controlled project copy.
svn info
Handling your project (editing and adding files).in your working copy
After adding a class or any new files in your project when you type “svn status” there will be response for the files that are present in your working copy.
if there is a “?” then it is a new file.
if there is “M” then it is a modified file.
svn status
? project/class.cpp
? project/class.h
M project/main.cpp
Now add the two files class.cpp and class.h to the svn using the following command.
svn add class.cpp class.h
Now the two files are under version control which can be confirmed by the command “svn status”.
when everything is fine compiling and working and you have decided for the commit do it the same way using the below command.
svn ci -m “Added a new class”
svn checkout -r 4 file:///redhat/svn/projectname
the above command will retrieve the particular version of your project which is revision 4,it can also mean,that you change the code to that date on which project is versioned as 4.
if we want to know the the information of individual files which are under version control we can do so by doing this.
svn info projectname/main.cpp
Path: /redhat/svn/projectname/main.cpp
Name: main.cpp
URL: file:///redhat/svn/projectname/main.cpp
Revision: 3
In the same way for finding the version of class.cpp and class.h do so by
svn info projectname/class.cpp
Path: /redhat/svn/projectname/class.cpp
Name: class.cpp
URL: file:///redhat/svn/projectname/class.cpp
Revision: 4
Other commands
---------------
revert undo all changes in the current directory.
update fetch all the changes committed from another working directory.
diff show the difference between the files in the current directory across the versions.
remote respository of your project will be accessed in the following way.
file:///redhat/svn/projectname ⇐===> svn+ssh://url.of.desktop/redhat/svn/projectname.
Monday, December 10, 2012
libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
RedHat64 + qt sdk-offline-linux-x86_64 +FcFreeTypeQueryFace+Building application yields libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
Cause for compiling the sources.
When my office have blocked access to internet for all RedHat workstations ,i could not download packages,and it was not possible to download from the PC side as well,because of the company security policies.so i had to download it from somewhere, get it,and compile in the workstation.
I started with invoking Qt_SDK_Lin64_offline_v1_1_2_en.run file for installing the SDK like this and got this error,
./Qt_SDK_Lin64_offline_v1_1_2_en.run: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./Qt_SDK_Lin64_offline_v1_1_2_en.run)
so i started compiling gcc4.3.2 and its dependent sources(mpfr-2.4.2.tar,gmp-4.3.2.tar,mpc-0.8.1.tar)
-----------------------------------------------------------------------------------------------------
1.mpfr-2.4.2.tar
mkdir mpfrbuild ; cd mpfrbuild ; ../mpfr-2.4.2/./configure --prefix=$PWD ;make -j8 && make install
2.gmp-4.3.2.tar
mkdir gmpbuild ; cd gmpbuild ; ../gmp-4.3.2/./configure --prefix=$PWD ;make -j8 && make install
3.mpc-0.8.1.tar
mkdir mpcbuild ; cd mpcbuild ; ../mpc-0.8.1/./configure --with-gmp-lib=/gmpbuild/lib --with-gmp-include=/gmpbuild/include --with-mpfr-include=/mpfrbuild/include --with-mpfr-lib=/mpfrbuild/lib --with-mpc-include=/mpcbuild/include --with-mpc-lib=/mpcbuild/lib --prefix=$PWD ;make -j8 && make install
4 Configuring and compiling the GCC 4.6.3
------------------------------------------
mkdir gcc463build ; cd gcc463build ; ../gcc-4.6.3/./configure --with-gmp-lib=/gmpbuild/lib --with-gmp-include=/gmpbuild/include --with-mpfr-include=/mpfrbuild/include --with-mpfr-lib=/mpfrbuild/lib --with-mpc-include=/mpcbuild/include --with-mpc-lib=/mpcbuild/lib --enable-languages=c,c++ --prefix=$PWD ;make -j8 && make install
Errors when compiling GCC sources
-------------------------------------
checking for suffix of object files... configure: error: in `../x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
By adding mpc,mpfr,gmp Library paths to the LD_LIBRARY_PATH the make continues
Download fontconfig-2.4.2.tar.gz+ make;make install
and setenv /PATH/TO/THE/LIBRARY:$LD_LIBRARY_PATH
or LIBS += -L/PATH/TO/fontconfig-2.4.2/lib in the .pro or CMakeLists.txt
more comments and information is available at http://theitdepartment.wordpress.com/2009/03/15/centos-qt-fcfreetypequeryface/
Cause for compiling the sources.
When my office have blocked access to internet for all RedHat workstations ,i could not download packages,and it was not possible to download from the PC side as well,because of the company security policies.so i had to download it from somewhere, get it,and compile in the workstation.
I started with invoking Qt_SDK_Lin64_offline_v1_1_2_en.run file for installing the SDK like this and got this error,
./Qt_SDK_Lin64_offline_v1_1_2_en.run: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./Qt_SDK_Lin64_offline_v1_1_2_en.run)
so i started compiling gcc4.3.2 and its dependent sources(mpfr-2.4.2.tar,gmp-4.3.2.tar,mpc-0.8.1.tar)
-----------------------------------------------------------------------------------------------------
1.mpfr-2.4.2.tar
mkdir mpfrbuild ; cd mpfrbuild ; ../mpfr-2.4.2/./configure --prefix=$PWD ;make -j8 && make install
2.gmp-4.3.2.tar
mkdir gmpbuild ; cd gmpbuild ; ../gmp-4.3.2/./configure --prefix=$PWD ;make -j8 && make install
3.mpc-0.8.1.tar
mkdir mpcbuild ; cd mpcbuild ; ../mpc-0.8.1/./configure --with-gmp-lib=/gmpbuild/lib --with-gmp-include=/gmpbuild/include --with-mpfr-include=/mpfrbuild/include --with-mpfr-lib=/mpfrbuild/lib --with-mpc-include=/mpcbuild/include --with-mpc-lib=/mpcbuild/lib --prefix=$PWD ;make -j8 && make install
4 Configuring and compiling the GCC 4.6.3
------------------------------------------
mkdir gcc463build ; cd gcc463build ; ../gcc-4.6.3/./configure --with-gmp-lib=/gmpbuild/lib --with-gmp-include=/gmpbuild/include --with-mpfr-include=/mpfrbuild/include --with-mpfr-lib=/mpfrbuild/lib --with-mpc-include=/mpcbuild/include --with-mpc-lib=/mpcbuild/lib --enable-languages=c,c++ --prefix=$PWD ;make -j8 && make install
Errors when compiling GCC sources
-------------------------------------
checking for suffix of object files... configure: error: in `../x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
By adding mpc,mpfr,gmp Library paths to the LD_LIBRARY_PATH the make continues
to do
-----
-----
for this error libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
Download fontconfig-2.4.2.tar.gz+ make;make install
and setenv /PATH/TO/THE/LIBRARY:$LD_LIBRARY_PATH
or LIBS += -L/PATH/TO/fontconfig-2.4.2/lib in the .pro or CMakeLists.txt
more comments and information is available at http://theitdepartment.wordpress.com/2009/03/15/centos-qt-fcfreetypequeryface/
Sunday, August 26, 2012
Qt Tips
How to add QToolbar to the MainWindow using QT Designer.
Method 1
Drag and Drop from the QActionEditor
Create some QActions from Action Editor tab in the designer.Each of these QActions can be edited from their context menu.these can be dragged on to the
default mainToolBar present on the mainWindow.
Method 2
Selet from mainwindow contextmenu
Right-click on the main window and select Add toolbar from the context menu. To add buttons to the toolbar, you must create some QActions. Select the Action
Editor tab (if the tab is nowhere to be seen, go to the view menu and make sure Action Editor is checked), push the create new action button and fill the
form that appears. Then drag your newly created action from the list in the action editor to the toolbar.
Method 3
Writing UI Code in C++
Generally if you write C++ code this can be done in multiple ways using addToolBar();
QToolBar *tool = new QToolBar;
tool->setGeometry(0,0,200,20);
QToolButton *button = new QToolButton;
button->setGeometry(0,0,10,20);
tool->addWidget(button);
If the area is not specified then the toolbar is placed at the end of the current tool bar block.otherwise it will be added to the specified area in the main window.
Eg:-
QToolBar *fileToolBar= addToolBar(Qt::BottomToolBarArea,fileToolBar);
A nice example is available which illustrates, how to code in Qt with C++ is available here.
Thursday, August 23, 2012
What is Opengl and Qt with OpenGL.
What is opengl
OpenGL is the industry’s most widely used 2D and 3D graphics API.
OpenGL is a low level API which requires the programmer to write the exact steps needed to render a scene in a 3d space.
So it is up to the programmer to specify geometry primitives in a 3D space, apply coloring,texturing, lighting effects and render the objects onto the screen.
As OpenGL is "low-level" graphics API, An application using OpengGL must tell the computer how to draw a scene in terms of low level primitives such as vertices, lines and polygons.
For example, to draw a cube, the cube’s eight vertices must be specified.
Imagine attempting to render something as complex as a Cam-shaft using one of these low-level APIs.
As, these APIs are highly sensitive to the order in which functions are called, making direct OpenGL API call is error prone.
So high-level APIs which support object oriented 3D visualization have been developed.
These scene graph APIs allow the programmer to define a scene and then place objects in the scene.
For 2D visualization there is no standard for scenegraph,Qt has QGraphicsView which allows to render the 2d scenes easily using opengl.
For 3D visualization, APIs like Open Inventor and VTK are standard.
OpenGL is cross-platform, but the choice of the widget toolkit that encapsulates the OpenGL scene willl limit the application to a particular platform.
QtOpenGL
Role of Qt.Qt provides the 'glue-code' required to embed an opengl rendered area into a window,With Qt Window System,QWS, the window management,handling events like widget paint event,and user input events like mouse,keyboard events.
with Qt's cross platform API it will be easier for porting the application on to the desired platform.
Not only that any visualization application definitely requires additional APIs to print documents, parse XML, read databases, and use threads,networking, and so on and so forth.
An ideal toolkit should support all these additional utilities and be cross-platform at the same time.
Qt becomes the best choice among the other windowing tool-kits,such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows platform,as it supports both the platforms and also many IDE's like VisualStudio,Eclipse,NetBeans.
Not only that Qt has an unique IDE Qt-Creator a versatile cross-platform complete integrated development environment available on Linux, Mac OS X and Windows operating systems.
Subscribe to:
Posts (Atom)