libQGLViewer
is a library for OpenGL 3D scenes in Qt applications. The good things is that it brings libQGLViewer implemented things like the dynamic movement of the camera, and allows the user to interact with the scene with the mouse and keyboard.
things in Linux libQGLViewer are extremely simple, just install the development package and the library is ready for use. In Windows things change a bit, it's harder to make the library is ready to use and also make use of it.
The official website of libQGLViewer are the steps to compile the library with the Microsoft Visual Studio, but they assume that one has the integration of the commercial version of Qt with Microsoft Visual Studio ell and that's not always the case, in my case example, does not happen. So here are the steps to compile the library using the Microsoft Visual C + + 2008 Express Edition without the need for integrating the commercial version.
These are the steps:
Download the source code libQGLViewer the library
page. Unzip the source code into a folder on your PC. I recommend C: \\ libQGLViewer \\ 2.3.4 (the 2.3.4 was the one I downloaded but it may be that the time you read the post there is a newer version. Also remember that the folder path must not contain spaces) . Open console from Microsoft Visual Studio 2008. Home -> All Programs -> Microsoft Visual C + + 2008 Express Edition -> Visual Studio Tools -> Command Prompt Visual Studio 2008. Go to the folder where you unzipped the source code and there libQGLViewer enter QGLViewer folder. (Must be located in the path C: \\ libQGLViewer \\ 2.3.4 \\ QGLViewer)
Compile using the following commands:
release compilation creates a folder inside the folder where the QGLViewer QGLViewer2.dll
file. Copy this. Dll to C: \\ Windows \\ system32 to make it available to applications using the library.
Then select everything in the release folder and move it to the folder QGLViewer (the parent folder of release) and eliminate the release folder, this will do to facilitate the operation of the library. It's just a matter of ease any more.
That's it. It is possible to use applications that make use of the library libQGLViewer.
now explain how to compile the examples that come with source code package libQGLViewer. Examples are found in the examples folder. In theory you should be able to compile all the time but this does not work so you have to do it one by one. We start with the simplest, the SimpleViewer.
- SimpleViewer In the folder that is located within the source code examples is required to compile SimpleViewer. To compile the example, follow these steps: simpleViewer.pro Open file with a text editor (can be notepad). This file contains
- code to try to automatically detect where the include files and library of QGLViewer but Windows does not work at all well so let's remove all the code is useless.
- locate the file line # # # # # # Unix configuration and remove all code is from there to the line # # # # # # Windows configuration.
- Below the line # # # # # # Windows configuration is the following code: {win32
- MOC_DIR = moc
OBJECTS_DIR = obj}
Let's edit it to look like this:
MOC_DIR = moc OBJECTS_DIR = obj
Then remove all the code that is below the OBJECTS_DIR, so it was just something like this:
Windows configuration # # # # # #
MOC_DIR = moc = obj
OBJECTS_DIR
Up of this code there are two lines starting with # INCLUDEPATH and # LIBS. These lines tell the compiler where to look for include files and library libQGLViewer. We edit them to make them point to the correct path, the lines should be something like:
INCLUDEPATH *= C: \\ libQGLViewer \\ 2.3.4
LIBS *=-LC: \\ libQGLViewer \\ 2.3.4 \\ QGLViewer-lQGLViewer2
Note: Do not forget to remove the # that is the beginning of the line as it marks the line as a comment.
That's it. After this run qmake to create the Makefile, then nmake to compile the program. This will generate an executable simpleViewer.exe in the folder. Already compiled by example.
If you find any examples or problems compiling the library itself with the steps I have left here do not hesitate to write or leave comments.libQGLViewer If you plan to use in your application I recommend that you do not start with one. Pro vacuum, but one copy. Pro who edited the examples to compile and edit the sources and adding headers of their own project, this will greatly facilitate the collection and remove them off problems unresolved external symbols that appear regularly in using libQGLViewer.
Finally a recommendation. The vast majority of those who downloaded the libQGLViewer not downloaded to use applications that use the library or for viewing the examples were shocked but to develop our own applications.
0 comments:
Post a Comment