Hi Markus,

We don't often here of programmers using Mingw so you will be mixing
things in rather bleeding edge way, so if you do come across problems
there is good chance you'll be the first one to come across it.  I
don't use Mingw personally, or even Windows, so can't help
specifically.

Since at this stage one can't know if it's an issue with the
compiler/dependencies/Qt/OSG or your code I would suggest trying to
get your code compiling and working on a less niche platform
combination, this way you'll be able to test to see if it's an issue
with Mingw build environment or Qt/OSG/your code and you'll be more
likely to be able to leverage the experiences of the rest of the
community if there is a problem.

Robert.

On 17 April 2012 00:47, Markus Svilans <[email protected]> wrote:
> Hello everyone,
>
> I am trying to use OSG 3.0.1 with Qt 4.8.0, with the mingw 64-bit compiler on 
> Win7 Pro.
>
> So far, I have successfully set up a 64-bit build environment (in C:\mingw64) 
> and built the Qt libraries. All the Qt examples work, and I’m able to create 
> new Qt programs quickly and easily.
>
> Next, I downloaded OSG 3.0.1 and built it, using CMake. The osgviewerQt 
> example program compiled and ran fine, so I thought I was ready to start 
> writing programs that use OSG and Qt together. This is when the strangeness 
> started.
>
> As a first test, I tried reproducing the osgviewerQt example program myself 
> using Qt Creator. I created a new Qt Widget app, and copy & pasted code from 
> the osgviewerQt example. After setting up the .pro file, to link with the 
> required OSG DLL files, the application built without any errors. However, it 
> did not run.
>
> I ran my test program in a debugger, and here is the backtrace:
>
> First chance exception 0x00000000C0000005 ACCESS_VIOLATION occurred at 
> 0x0000000000782803, read of address 0xFFFFFFFFFFFFFFFF at 0x0000000000782803 
> (in C:\Users\Markus\Desktop\OSG examples\libosgd.dll)
> 0x0000000000782803 _ZN3osg6Object21setThreadSafeRefUnrefEb + 0x4B in 
> libosgd.dll
> 0x000000006AE05B7F _ZN9osgViewer15CompositeViewer15constructorInitEv + 0x117 
> in libosgViewerd.dll
> 0x000000006AE015D1 _ZN9osgViewer15CompositeViewerC2Ev + 0x191 in 
> libosgViewerd.dll
> 0x0000000000401BB8 OsgQtTest02.exe
> 0x0000000000401615 OsgQtTest02.exe
> 0x00000000004013CE OsgQtTest02.exe
> 0x00000000004014E8 OsgQtTest02.exe
> 0x000000007675652D BaseThreadInitThunk + 0xD in kernel32.dll
> 0x0000000076CEC521 RtlUserThreadStart + 0x21 in ntdll.dll
>
>
> (My test program is called OsgQtTest02.exe)
>
> I can reproduce this behaviour easily, just by deriving a class from QWidget 
> and osgViewer::CompositeViewer, and then creating an instance of it in 
> main.cpp, like this:
>
> #include < QtGui/QApplication >
> #include "viewwidget.h"
> #include < iostream >
> int main(int argc, char *argv[])
> {
>    std::cout << "Program starting" << std::endl;
>
>    QApplication a(argc, argv);
>    ViewWidget w;
>    std::cout << "Widget created" << std::endl;
>    w.show();
>
>    return a.exec();
> }
>
> This is the declaration of the ViewWidget class:
>
> #include < QtGui/QWidget >
> #include < osgViewer/CompositeViewer >
> class ViewWidget : public QWidget, public osgViewer::CompositeViewer
> {
>    //Q_OBJECT
>
> public:
>    ViewWidget(QWidget *parent = 0);
>    ~ViewWidget();
> };
>
> The message "Program starting" will appear, but "Widget created" will not, 
> because the app will crash when the ViewWidget instance is created. The 
> presence of Q_OBJECT seems to make no difference.
>
> This has the feeling of a C++ ABI incompatibility, as if the C++ OSG DLLs 
> were built with a different C++ compiler. However I know that this is not the 
> case, because I built everything myself, with the same C++ compiler (except 
> Qt Creator itself of course).
>
> I have tried rebuilding Qt and OSG a few times over the weekend, and I have 
> been over the CMake setup until the wee hours at night. I don’t seem to be 
> missing anything obvious. With Dependency Walker, I can verify that my app is 
> properly linked to the OSG and Qt DLLs.
>
> I am at my wits’ end...
>
> Does anybody have any advice on how to fix this problem?
>
> Many thanks in advance,
> Markus Svilans
> [/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=47084#47084
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to