Results 1 to 4 of 4

Thread: compiling ogre tutorials

  1. #1
    Join Date
    Nov 2005
    Location
    Taunton, England
    Beans
    931
    Distro
    Ubuntu 10.04 Lucid Lynx

    compiling ogre tutorials

    i have installed the ogre dev packages from the repos, and i would like to start programming some ogre apps in c++. i was going down the python-ogre route but i decided i may as well do c++ instead, as python-ogre support on linux is lacking, and c++ will be more efficient anyway.

    sooo...

    Code:
    #include "ExampleApplication.h"
    
    class TutorialApplication : public ExampleApplication
    {
    protected:
    public:
        TutorialApplication()
        {
        }
    
        ~TutorialApplication() 
        {
        }
    protected:
        void createScene(void)
        {
        }
    };
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #define WIN32_LEAN_AND_MEAN
    #include "windows.h"
    
    INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
    #else
    int main(int argc, char **argv)
    #endif
    {
        // Create application object
        TutorialApplication app;
    
        try {
            app.go();
        } catch( Exception& e ) {
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
            MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    #else
            fprintf(stderr, "An exception has occurred: %s\n",
                    e.getFullDescription().c_str());
    #endif
        }
    
        return 0;
    }
    Code:
    richard@richard-laptop:~/Desktop$ gcc ogre.cpp 
    ogre.cpp:1:32: error: ExampleApplication.h: No such file or directory
    ogre.cpp:22:21: error: windows.h: No such file or directory
    ogre.cpp:4: error: expected class-name before ‘{’ token
    ogre.cpp:24: error: ‘INT’ does not name a type
    obviously it can't find exampleApplication.h and the windows stuff, well i am not sure about that... i thought ogre was cross platform.

    Code:
    richard@richard-laptop:~/Desktop$ locate ExampleApplication
    /home/richard/src/ogrenew/Samples/Common/include/ExampleApplication.h
    richard@richard-laptop:~/Desktop$
    that is from when i was trying to compile it from source ages ago... i assume from this that the ubuntu ogre packages don't include the tutorial frameworks...

    any hints?
    sudo make me a sandwich

  2. #2
    Join Date
    Aug 2006
    Beans
    177
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Thumbs down Re: compiling ogre tutorials

    Those exampleApplication.h are inside the source files, dont remember exactly wher, but you should seek in some like Examples/Common

    Also I recommend http://www.ogre3d.org/phpBB2/viewtop...=232681#232681 Im tyoc there, thought I havent been in ogre3d from sometime now, my personal opinion about that way of install it that 1 suguested there is very prety, nice and cute (from my point of view, because you can hav more than 1 ogre version installed in that way and switc one or other... but I have never tryied that lol)


    Only a side note?? perhaps this also can be from help?
    Last edited by hecato; October 21st, 2007 at 06:58 PM.

  3. #3
    Join Date
    Aug 2006
    Beans
    177
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: compiling ogre tutorials

    A yea, havent seen the last part of your post, only watch the first part lol.

    Yea, when you do in source distribution make install, it will not "copy" the files needed for demos only the essential files for OGRE3D in fact, ExampleApplication.h Example...h and Example...h (there are 3 of them IIRC are only a "basic framework" that "hide" internal things of ogre like the listeners for frames and things like that, the overlay that shows the ogre logo and FPS info, etc...) they are in a folder inside the source distribution, you need to copy them, where you are compiling the code also because #include "some.h" first search the folder of the file that is compiling in the moment... or the other way, add the path of this files (if you dont want to copy and copy them again and again where you can search for *.h files.

    That was long explanation for say only that yes, they are not packaged in the "dev" because if you install like I suguest is a good way in the anterior post, you will see that this problem also raise, because install doesn't use, copy examples. With the suguested way, you will be able to compile the examples.

    --------------

    Only for be more clear, when you do configure and not dissable demos, they will be build when you do make (it also works like a test suit in some way, they are build IIRC in Examples/Common/bin or some like that), but they will not be copied (to the install location) even that they are build and there when you do make install (that is why they arent included in "dev" package of the distributions, they only include "direct things" of ogre and not samples and helpers like Examplexxxx.h 3 o them IIRC).
    Last edited by hecato; October 21st, 2007 at 07:09 PM.

  4. #4
    Join Date
    Apr 2009
    Location
    Ukraine, Kyiv
    Beans
    5
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: compiling ogre tutorials

    I am using Code::Blocks 8.02, and it's wizard creates project that can't be build.

    Quote Originally Posted by hecato View Post
    That was long explanation for say only that yes, they are not packaged in the "dev" because if you install like I suguest is a good way in the anterior post, you will see that this problem also raise, because install doesn't use, copy examples.
    So, solution is to download sources, and copy some files into some directories? I not know all system paths yet .

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •