Hi, I’m new to the forums and Urho3D and am posting this as I am struggling to get Urho3D working with a new project.
I have never used CMake but have managed to get the samples to build and have been through and had a quick look at them all.
I want to start a new project with so that I can get up and running with Urho3D and start developing right away! I have tried building Urho3D through CMake without the samples but when I open the Urho3D solution in visual studio I am faced with about 25 different projects, sdl and bullet etc etc…!! should these be here?
I have tried to use Urho3D as an external library, but get all sorts of errors (PATH variables have been set correctly, i believe)
Have you considered to install the Ruby/Rake in your Windows host system? If you have that prerequisite also installed then you can build the Urho3D library as so, without even launching VS (of course you can also do that by opening the generated solution file).
rake cmake vs2017 URHO3D_64BIT=1 URHO3D_LUAJIT=1 build_tree=/path/to/your/urho3d/build-tree
rake make build_tree=/path/to/your/urho3d/build-tree
rake cmake vs2017 URHO3D_64BIT=1 URHO3D_HOME=/path/to/your/urho3d/build-tree build_tree=/path/to/your/project/build-tree
rake make build_tree=/path/to/your/project/build-tree
You can leave the “build_tree” to the default, which is “…/native-Build” for normal desktop native build configuration, instead of passing it explicitly. Passing URHO3D_HOME though is mandatory but only for the very first time you generate your own build tree.
Notice the similarity in building the Urho3D project and your own project. That’s because the scaffolding rake task reuse the same build fixtures from Urho3D project.
Thanks again everyone, Im flat out for the next couple of days so I will let you know how I go when I get the chance. It does look like there was a bit of a mismatch between x86 and x64 versions along the way somewhere. I will definitely give rake a go!
Ok, thanks all for your help, if it weren’t for you all I would never have egged on to get this working. I now have a blank Visual Studio project with the mainloop example compiling and running! (did not want to deal with 64 bit anything so i just disabled all of that for 32 bit).
For anyone else who is interested, but mainly for my own future reference , here is the process I used:
download latest Urho3D from github and extract to directory (…\Urho-master)
run cmake, source directory = build directory = …\Urho-master
navigate to that directory in command prompt and run the following command: cmake_vs2017.bat D:\Urho3D-master -DURHO3D_64BIT=0 -DURHO3DLUA=0 -DURHO3D_SAMPLES=0
add (…\Urho-master) directory to environment variable: URHO3D_HOME (I dont know if this is actually needed, but hey)
open the Urho3D.sln file in visual studio and ALL_BUILD as both ‘release’ and ‘debug’
Set up personal project directory as follows:
bin folder and subfolders are empty
copy and paste CMake folder from (…\Urho-master) with modules and toolchains and their contents
CMakeLists.txt from urho documentation (_using_library). set project name and executable name.
add a .cpp file (Main.cpp) with code from ‘Engine initialisation and main loop’ documentation page
Open CMake gui. Source directory = build directory = <PROJECT_ROOT>/
Make sure URHO3D_HOME is the correct directory (…\Urho-master), and select any functions that you want/need
Make sure Urho3D_DIR is the correct directory (…\Urho-master) (maybe, i dunno, but it works!)
Go to <PROJECT_ROOT>/ and open projectname.sln
You can now build and run your project in debug/release mode!!!
I get a heap of output in the following format: 'Project_Ares_Executable_d.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
’Project_Ares_Executable_d.exe’ (Win32): Loaded ‘C:\Windows\System32\DriverStore\FileRepository\c0318486.inf_amd64_11ba0b4b7cc81d52\aticfx32.dll’. Cannot find or open the PDB file.
Is this a concern?
I have my Visual Studio Solution, I have MyProject as well as 3 others, ALL_BUILD, INSTALL, and ZERO_CHECK
ALL_BUILD is self explanatory
INSTALL does this produce an installer for MyProject?