RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 1357826
Accepted
timob256
timob256
Asked:2022-05-06 22:56:17 +0000 UTC2022-05-06 22:56:17 +0000 UTC 2022-05-06 22:56:17 +0000 UTC

如何在 linux 上从源代码安装 ogre3d

  • 772

一般来说,我遇到了一个问题,如何在 Linux 中从源代码安装 ogre3d(在我的例子中是 Astra linux)。

linux
  • 1 1 个回答
  • 10 Views

1 个回答

  • Voted
  1. Best Answer
    timob256
    2022-05-06T22:56:17Z2022-05-06T22:56:17Z
    1. 你需要安装cmake和库

      sudo apt-get install libgles2-mesa-dev libvulkan-dev glslang-dev

      还希望

      sudo apt-get install libsdl2-dev libxt-dev libxaw7-dev doxygen

    2. 下载存档(因为我的 cmake ,我选择了相当旧的存档, ogre-1.12.13.zip )

    3. 解压缩,使用控制台构建转到解压缩的文件夹并输入命令:

      cd Home/ogre/ogre-1.12.13 mkdir build cd build cmake .. make sudo make install

      我创建一个构建文件夹,调用一个 kumeik,然后构建它,然后进行安装。

    之后,您可以运行最简单的示例(尽管我重新启动计算机以获得更高的可靠性)

    ogre_example1.pro

    #-------------------------------------------------
    #
    # Project created by QtCreator 2021-08-26T17:23:57
    #
    #-------------------------------------------------
    
    QT       += core gui widgets
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = ogre_example1
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    
    SOURCES += \
        BasicTutorial1.cpp \
    
    
    
    HEADERS += \
    
    FORMS += \
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    INCLUDEPATH += /usr/local/include/OGRE/ \
                    /home/dima/ogre/ogre-1.12.13/Components/Bites/include \
                    /home/dima/ogre/ogre-1.12.13/build/include            \
                    /usr/local/include/OGRE/RTShaderSystem                \
                    /usr/local/include/OGRE/Overlay
    
    
    
    # -- из папки сборки все библы
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreBites
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreBitesQt
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreGLSupport
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreMain
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreMeshLodGenerator
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreOverlay
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgrePaging
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreProperty
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreRTShaderSystem
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreTerrain
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/lib/ -lOgreVolume
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    ## - a
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/include
    
    #unix:!macx: PRE_TARGETDEPS += $$PWD/../../ogre/ogre-1.12.13/build/lib/libOgreGLSupport.a
    
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/OgreMain/ -lOgreMain_pch_dephelp
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/OgreMain
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/OgreMain
    
    #unix:!macx: PRE_TARGETDEPS += $$PWD/../../ogre/ogre-1.12.13/build/OgreMain/libOgreMain_pch_dephelp.a
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/ -lfreetype
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    
    #unix:!macx: PRE_TARGETDEPS += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/libfreetype.a
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/ -lpugixml
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    
    #unix:!macx: PRE_TARGETDEPS += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/libpugixml.a
    
    #unix:!macx: LIBS += -L$$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/ -lzzip
    
    #INCLUDEPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    #DEPENDPATH += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/include
    
    #unix:!macx: PRE_TARGETDEPS += $$PWD/../../ogre/ogre-1.12.13/build/Dependencies/lib/libzzip.a
    
    
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreBites
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreBitesQt
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreMain
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreMeshLodGenerator
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreOverlay
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgrePaging
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreProperty
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreRTShaderSystem
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreTerrain
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOgreVolume
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -lOpenThreads
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losg
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgAnimation
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgDB
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgFX
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgGA
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgManipulator
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgParticle
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgPresentation
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgShadow
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgSim
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgTerrain
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgText
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgUI
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgUtil
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgViewer
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgVolume
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    
    unix:!macx: LIBS += -L$$PWD/../../../../usr/local/lib/ -losgWidget
    
    INCLUDEPATH += $$PWD/../../../../usr/local/include
    DEPENDPATH += $$PWD/../../../../usr/local/include
    

    BasicTutorial1.cpp

    /*-------------------------------------------------------------------------
    This source file is a part of OGRE
    (Object-oriented Graphics Rendering Engine)
    For the latest info, see http://www.ogre3d.org/
    
    
    Copyright (c) 2000-2013 Torus Knot Software Ltd
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE
    -------------------------------------------------------------------------*/
    
    //! [fullsource]
    
    #include "Ogre.h"
    #include "OgreApplicationContext.h"
    #include "OgreInput.h"
    #include "OgreRTShaderSystem.h"
    #include <iostream>
    
    using namespace Ogre;
    using namespace OgreBites;
    
    class BasicTutorial1
            : public ApplicationContext
            , public InputListener
    {
    public:
        BasicTutorial1();
        virtual ~BasicTutorial1() {}
    
        void setup();
        bool keyPressed(const KeyboardEvent& evt);
    };
    
    
    BasicTutorial1::BasicTutorial1()
        : ApplicationContext("OgreTutorialApp")
    {
    }
    
    
    void BasicTutorial1::setup()
    {
        // do not forget to call the base first
        ApplicationContext::setup();
        addInputListener(this);
    
        // get a pointer to the already created root
        Root* root = getRoot();
        SceneManager* scnMgr = root->createSceneManager();
    
        // register our scene with the RTSS
        RTShader::ShaderGenerator* shadergen = RTShader::ShaderGenerator::getSingletonPtr();
        shadergen->addSceneManager(scnMgr);
    
        // -- tutorial section start --
        //! [turnlights]
        scnMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
        //! [turnlights]
    
        //! [newlight]
        Light* light = scnMgr->createLight("MainLight");
        SceneNode* lightNode = scnMgr->getRootSceneNode()->createChildSceneNode();
        lightNode->attachObject(light);
        //! [newlight]
    
        //! [lightpos]
        lightNode->setPosition(20, 80, 50);
        //! [lightpos]
    
        //! [camera]
        SceneNode* camNode = scnMgr->getRootSceneNode()->createChildSceneNode();
    
        // create the camera
        Camera* cam = scnMgr->createCamera("myCam");
        cam->setNearClipDistance(5); // specific to this sample
        cam->setAutoAspectRatio(true);
        camNode->attachObject(cam);
        camNode->setPosition(0, 0, 140);
    
        // and tell it to render into the main window
        getRenderWindow()->addViewport(cam);
        //! [camera]
    
        //! [entity1]
        Entity* ogreEntity = scnMgr->createEntity("ogrehead.mesh");
        //! [entity1]
    
        //! [entity1node]
        SceneNode* ogreNode = scnMgr->getRootSceneNode()->createChildSceneNode();
        //! [entity1node]
    
        //! [entity1nodeattach]
        ogreNode->attachObject(ogreEntity);
        //! [entity1nodeattach]
    
        //! [cameramove]
        camNode->setPosition(0, 47, 222);
        //! [cameramove]
    
        //! [entity2]
        Entity* ogreEntity2 = scnMgr->createEntity("ogrehead.mesh");
        SceneNode* ogreNode2 = scnMgr->getRootSceneNode()->createChildSceneNode(Vector3(84, 48, 0));
        ogreNode2->attachObject(ogreEntity2);
        //! [entity2]
    
        //! [entity3]
        Entity* ogreEntity3 = scnMgr->createEntity("ogrehead.mesh");
        SceneNode* ogreNode3 = scnMgr->getRootSceneNode()->createChildSceneNode();
        ogreNode3->setPosition(0, 104, 0);
        ogreNode3->setScale(2, 1.2, 1);
        ogreNode3->attachObject(ogreEntity3);
        //! [entity3]
    
        //! [entity4]
        Entity* ogreEntity4 = scnMgr->createEntity("ogrehead.mesh");
        SceneNode* ogreNode4 = scnMgr->getRootSceneNode()->createChildSceneNode();
        ogreNode4->setPosition(-84, 48, 0);
        ogreNode4->roll(Degree(-90));
        ogreNode4->attachObject(ogreEntity4);
        //! [entity4]
    
        // -- tutorial section end --
    }
    
    
    bool BasicTutorial1::keyPressed(const KeyboardEvent& evt)
    {
        if (evt.keysym.sym == SDLK_ESCAPE)
        {
            getRoot()->queueEndRendering();
        }
        return true;
    }
    
    
    int main(int argc, char **argv)
    {
        try
        {
            BasicTutorial1 app;
            app.initApp();
            app.getRoot()->startRendering();
            app.closeApp();
        }
        catch (const std::exception& e)
        {
            std::cerr << "Error occurred during execution: " << e.what() << '\n';
            return 1;
        }
    
        return 0;
    }
    
    //! [fullsource]
    

    在此处输入图像描述

    • -1

相关问题

  • 如果 fuser -k number/tcp 没有帮助,如何在 Debian 中释放端口?

  • Ubuntu。startx 不起作用。黑屏

  • --syn 在 iptables 中有什么作用?

  • 为什么需要iso格式?

  • C程序中没有密码的sudo

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    表格填充不起作用

    • 2 个回答
  • Marko Smith

    提示 50/50,有两个,其中一个是正确的

    • 1 个回答
  • Marko Smith

    在 PyQt5 中停止进程

    • 1 个回答
  • Marko Smith

    我的脚本不工作

    • 1 个回答
  • Marko Smith

    在文本文件中写入和读取列表

    • 2 个回答
  • Marko Smith

    如何像屏幕截图中那样并排排列这些块?

    • 1 个回答
  • Marko Smith

    确定文本文件中每一行的字符数

    • 2 个回答
  • Marko Smith

    将接口对象传递给 JAVA 构造函数

    • 1 个回答
  • Marko Smith

    正确更新数据库中的数据

    • 1 个回答
  • Marko Smith

    Python解析不是css

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5