How am I supposed to do dependencies for Ogre 1.11.5?
Posted: Wed Feb 06, 2019 3:43 am
Ogre Version: 1.11.5
Operating System: Windows 10
Render System: DirectX?
I tried doing the Setting Up an OGRE Project tutorial, and it says nothing about adding any dependencies. I assumed CMake would handle that or something, since the tutorial only mentions putting some lines into your CMakeLists.txt file before it gets into the actual code for the test application. When I went to compile, I got all of these errors telling me it can't open any of the includes, so CMake definitely didn't do anything to add dependencies. I didn't get any errors with my CMakeLists.txt, so I assumed there was nothing wrong with that. Unless I'm wrong, this is telling me that CMake doesn't do anything related to dependencies so I just manually added every folder inside of the sdk folder's "includes" directory (and the subdirectories). This made the header errors go away, but then I got all of these linker errors like these:
I tried looking this problem up, but there is a disturbing lack of anyone else having this problem, and I know people are using Ogre 1.11.5 right now with no issues so I know setting Ogre up isn't supposed to be this painful. It feels like the answer is just right in front of my face, but I can't see it. What is with the dependencies with Ogre 11? I used a really old version of ogre a while back, and all I had to do was just add a couple of include folders and libraries to my project's settings and that was that. I'm not saying it was better that way or anything, but the simplicity that CMake promises just makes troubleshooting harder for me to follow when something goes wrong. For example: I tried generating with Visual Studio 15 2017 x64 once and ran into problems with that until I realized using the regular Visual Studio 15 generator was the one that worked. I'm chalking that one up to just not knowing about CMake very well, but this new problem is perplexing since I know I followed the tutorials to the letter, and CMake hasn't given any errors or anything. I feel like I'm just doing this all backwards but I'm trying to follow the documentation as closely as I can. From the way it's written, it feels like setting this up should be a lot smoother and simpler than it has been for me.
If this problem is because I messed up something in my CMakeLists.txt, here it is just in case:
Operating System: Windows 10
Render System: DirectX?
I tried doing the Setting Up an OGRE Project tutorial, and it says nothing about adding any dependencies. I assumed CMake would handle that or something, since the tutorial only mentions putting some lines into your CMakeLists.txt file before it gets into the actual code for the test application. When I went to compile, I got all of these errors telling me it can't open any of the includes, so CMake definitely didn't do anything to add dependencies. I didn't get any errors with my CMakeLists.txt, so I assumed there was nothing wrong with that. Unless I'm wrong, this is telling me that CMake doesn't do anything related to dependencies so I just manually added every folder inside of the sdk folder's "includes" directory (and the subdirectories). This made the header errors go away, but then I got all of these linker errors like these:
Code: Select all
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::VectorBase<3,float>::VectorBase<3,float>(float,float,float)" (__imp_??0?$VectorBase@$02M@Ogre@@QAE@MMM@Z) referenced in function "public: __thiscall Ogre::Vector<3,float>::Vector<3,float>(float,float,float)" (??0?$Vector@$02M@Ogre@@QAE@MMM@Z) ogreproj C:\coding\OgrePlayground\ogreproj\ogreproj.obj 1
If this problem is because I messed up something in my CMakeLists.txt, here it is just in case:
Code: Select all
cmake_minimum_required (VERSION 2.8)
project (ogreproj)
add_executable(ogreproj ogreproj.cpp)
set(OGRE_DIR C:/coding/OgrePlayground/deps/ogre3d/builds/ogre-1.11.5/sdk/CMake)
# specify which version and components you need
find_package(OGRE 1.11 REQUIRED COMPONENTS Bites RTShaderSystem)
# copy resource.cfg next to our binaries where OGRE looks for it
file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_BINARY_DIR})