Greetings to Jin and fellow OSG/Qt users. Jin,
I am glad that you got your setup working. I am unsure of the specific differences between g++ and Visual C++, but I would recommend that you be careful using win32-g++ as your QMAKESPEC when using Visual Studio anything as your build environment, unless you have found a way to use g++ as your compiler/linker within the Visual Studio IDE (in which case, you can probably ignore everything I say below). Using g++ as your compiler/linker within the Visual Studio IDE is completely outside my experience (I do not know if such a thing is even possible). Generally, I have found that http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio is a good place to start for Visual Studio specific instructions for building OSG. Just make sure that you use the correct 3rd party dependencies (it looks like you are using the correct ones). >From the error message I read in what I think is your original post, it looks like you may not have added OSG's bin directory and/or the 3rd party bin directory to your path before trying build the example that uses OSG with Qt. If you are using the CMake GUI, use the advanced view to make sure that all the CMake settings are correct before trying to generate project files for the examples; you may have to manually make changes to some of the settings; I am unfamiliar with configuring CMake from the command line. At the time when you saw the error, had you already successfully installed Qt and OSG in the desired debug and release builds? Are you using debug Qt libraries with debug OSG libraries, and release Qt libraries with release OSG libraries? With Visual C++, you can not mix debug binaries with release binaries. I notice in what I think is your original post that you do not mention g++. How did you determine that win32-g++ was the QMAKESPEC you needed? Did you build Qt with a g++ compiler/linker? Are you using an already built Qt SDK? As daunting as it may seem, if you are using a Qt SDK that was not already built with Visual Studio 2008, you may want to consider building Qt from source code yourself. Qt has pretty good instructions on how to do that specific to the version of Qt you want to use. I would start with http://qt.nokia.com/, and follow the links to the version of Qt you want to use with OSG. If I followed the thread correctly, you specifically mentioned VS2008 on Windows 7. Does Qt not offer a Visual Studio 2008 QMAKESPEC? If so, I would recommend using that, unless you are using a version of Qt SDK already built with g++; in that case, you should also consider building OSG with the same type of setup as that used to build the Qt SDK. I do not think that g++ binaries are compatible with Visual C++ binaries. I hope this helps. In any event, good luck in your work with OSG and Qt. D.J. On Thu, May 19, 2011 at 5:28 AM, jin tongo <[email protected]> wrote: > Hi, > > thanks for the reply, I solved the problem. > For all of you who struggle, here is how I did this: > > I downloaded the QTSDK, installed it in C:\ > Set environment variables: > QTDIR to C:\QtSDK\Desktop\Qt\4.7.3 > QMAKESPEC to win32-g++ > Since I wanted to work with Microsoft Visual Studio 2008 I added > C:\QtSDK\Desktop\Qt\4.7.3\msvc2008\bin to the Path environment variable > > Updated Microsoft Visual Studio 2008 to SP1, downloaded this update from > Microsoft (important, because without Visual Studio SP1 I got linker crashes > when compiling osg) > > - I checked out OpenSceneGraph from the repository > - Also checked out the OpenSceneGraph Data > (on the website under downloads -> SVN) > Both into C:\Projects\ > > I also downloaded the 3rdParty_VC9sp1_x86_x64_V5.7z , just used the x82 > Version and packed it all into C:\Projects\3rdParty (next to the > OpenSceneGraph Repositories, and made sure the folders for x86 (like bin, > include, lib were directly in the 3rdParty folder). > > Then I ran CMake over my C:\Projects\OpenSceneGraph and created the build > folder C:\Projects\OpenSceneGraph\build. > Made sure > - that the CMake install Path was set to > C:\Program_Files(x86)\OpenSceneGraph. > - that CMake found the 3rdParty folder and many libraries (ofc. not all of > them) > - that I checked build OSG examples > - that CMake found the QT executable and I checked build QT examples > > Then I hit generate. > > I set some environment variables: > OSG_FILE_PATH to C:\Projekte\OpenSceneGraph-Data > OSG_DIR to C:\Program Files (x86)\OpenSceneGraph > added C:\Projekte\3rdParty\bin;C:\Program Files (x86)\OpenSceneGraph\bin to > the Path environment variable > > I opened the .sln file in C:\OpenSceneGraph\build with Visual Studio. > Set it to Debug and compiled it (ALL BUILD). > The after around 20 min it was finished and i right clicked the INSTALL > target and told Visual Studio to build that (which just copies the right > files into my CMake install path (C:\Program_Files(x86)\OpenSceneGraph). > > Then I set Visual Studio to Release and did ALL BUILD again. > After 20 min again, it was finished and again i did the INSTALL target. > > And oh my gosh I was finally done and now it works > > Thank you! > > Cheers, > jin > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=39535#39535 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

