I’m having trouble when building samples in debug using Eclipse on Linux. Here’s what I get with CrowdNavigation:
And here’s what a release build looks like:
I built and installed Urho in debug by following these steps:
./cmake_generic.sh build_debug/ -URHO3D_LUA=1 -URHO3D_SAMPLES=1 -URHO3D_EXTRAS=1 -URHO3D_DOCS_QUIET=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEBUG_POSTFIX=D
cd build_debug
make -j8
sudo make install
Then I created an Eclipse project using CrowdNavigation.cpp and CrowdNavigation.h from Urho’s “Source/Samples/39_CrowdNavigation” folder and Sample.inl and Sample.h from “Source/Samples” folder.
I set my project’s debug configuration to use these build and link settings:
-I (include paths)
[ul]/usr/include/bullet
/usr/include[/ul]
-L (library search paths)
[ul]/usr/local/lib/Urho3D[/ul]
-l (libraries)
[ul]Urho3DD
dl
pthread
GL[/ul]
I built the project’s debug config and got this ouput, which looks just fine:
[code]21:24:25 **** Build of configuration Debug for project UrhoDemo ****
make -j4 all
Building file: …/CrowdNavigation.cpp
Invoking: GCC C++ Compiler
g++ -I"WORKSPACE_LOCATION/UrhoDemo" -I/usr/include/bullet -I/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"CrowdNavigation.d" -MT"CrowdNavigation.o" -o “CrowdNavigation.o” “…/CrowdNavigation.cpp”
Finished building: …/CrowdNavigation.cpp
Building target: UrhoDemo
Invoking: GCC C++ Linker
g++ -L/usr/local/lib/Urho3D -o “UrhoDemo” ./CrowdNavigation.o -lUrho3D -ldl -lpthread -lGL
Finished building target: UrhoDemo[/code]
Finally, I copied “CoreData” and “Data” folders into my executable’s folder and ran it.
If I link Urho3D (release) instead of Urho3DD, it solves my problem. I thought that there might be a problem with my debug build of Urho3D. But, at the same time, the sample executables generated when building the debug library (located in build_debug/bin) work fine.
How did you generate the Makefile for your project in the first place? From the build output log it does not seem to be generated using our CMake build system. Just in case you don’t know, you can reuse Urho3D build system in your own project. However, if you already know that but still decided to generate the Makefile for your project using other means then you have to be prepared to take care a lot of things by your own. And even after you have done that correctly, it probably may only work for one platform or two. While using the latter gives you the potential to target all platforms with little effort on your own. Additionally, you will get better support simply because it has been used and tested by most of us so we already know what to expect and how to troubleshoot when/if it does not work. Back to your problem, I have never seen that myself before. I can only suspect that it has something to do with compiler defines not being defined at all.
As I said, I’m using Eclipse for my project, which generates the makefile I’m using.
I’m not sure I completely understand what you mean by “reuse Urho3D build system” in my project…
I’ve uploaded my complete Eclipse project. It includes the source code, Eclipse project files, and the generated makefiles for both build and release configurations. I also emptied “CoreData” and “Data” folders but left them in place.
Basically, we use CMake to generate the project file instead of using the IDE. This is true for both Urho3D project or your own project. In essense the downstream projects reuse the build system originally designed for Urho3D.
So in your case, after the project file is generated then simply import it into Eclipse workspace. HTH.