how to use coin3d with cmake

178 views
Skip to first unread message

Osman Tursun

unread,
Mar 23, 2015, 6:40:14 AM3/23/15
to coin3d-...@googlegroups.com
Hi everyone, I am quite new to cmake and coin3d. So please don't blame me ask so a dump question.

I have successfully tested coin3d code with "soqt-config --build main main.cpp" command, it works fine. After that I  created a non-QT project (C++) with cmake. After that I build them with build tab in tools. But I have got the following error:

/usr/include/Inventor/Qt/SoQt.h:48: error: qobject.h: No such file or directory
 #include <qobject.h>
                     ^

And my code is:

#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoCube.h>
#include <qobject>

int main(int argc, char ** argv)
{
    QWidget * mainwin = SoQt::init(argc, argv, argv[0]); // pass the app name
    // if unsucessful, exit.
    if (mainwin == NULL)
    {
        exit(1); //
    }
    // make a scene
    SoSeparator * root = new SoSeparator; //
    root->ref();
    SoCube *cube = new SoCube;
    root->addChild(cube);
    SoQtExaminerViewer * eviewer = new
    SoQtExaminerViewer(mainwin);
    eviewer->setSceneGraph(root);
    eviewer->show();
    SoQt::show(mainwin);
    SoQt::mainLoop();
    root->unref();
    delete eviewer;
    return 0;
}

I know I miss some steps, but I can't find any tutorial for help.  Hope you help me.

Thank you all in advance.

roy.wa...@googlemail.com

unread,
Mar 23, 2015, 2:16:14 PM3/23/15
to coin3d-...@googlegroups.com

Osman,

At the moment the best I can do is to suggest some questions for you to think about.

Have you got a file named qobject.h? If so, where is it, relative to the file you have listed? Have you set up the path to the file? Or is the name correct? Should it be qtobject.h, for example?

Roy

Osman Tursun

unread,
Mar 24, 2015, 7:59:27 AM3/24/15
to coin3d-...@googlegroups.com
I have not created a successful Cmake file, but I have edited the make file offered by open-inventor website. I have changed it little bit, because original version did not work.

# =========== Make file =================

SHELL=/bin/sh

PROGRAM=ConeAndViewer

CXX=g++
LD=g++

CFLAGS=-DDEBUG -g -ggdb
CXXFLAGS=$(CFLAGS) `soqt-config --cppflags`
LDFLAGS=-g `soqt-config --cppflags` `soqt-config --ldflags` `soqt-config --libs`


all: $(PROGRAM)


.SUFFIXES: .cpp .o

$(PROGRAM): ConeAndViewer.o
#    $(LD)  $(LDFLAGS) $^ -o $(PROGRAM)
    $(LD)  $(LDFLAGS) -o $(PROGRAM) $^ $(LDFLAGS)

.cpp.o:
    $(CXX) $(CXXFLAGS) -o $@ -c $<


clean:
    rm -f $(PROGRAM)
    rm -f *.o
    rm -f *~

# ==============================================

--
You received this message because you are subscribed to a topic in the Google Groups "coin3d-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coin3d-discuss/bLZmkRVP1YU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coin3d-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages