poftwaresatent/stanford_wbc — Issue #4: ambiguous reference to "Window" in tutsim.cpp
Author: jackhall
Created: 2012-02-25 05:25:15+00:00
State: open

stanford_wbc fails to build on Fedora Linux. A Window class is defined in tutsim.cpp, but X11 already has a typedef by the same name in X.h.
I compiled with:

Fedora 16 on x86_64
gcc 4.6.2
cmake 2.8.7
boost 1.47.0
fltk 1.3.0
gtest 1.5.0

These are all up-to-date for this distro. The failed part of the build gave me:

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o
cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function ‘void {anonymous}::Simulator::tick()’:
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In static member function ‘static int tutsim::run(bool (*)(size_t, double, double, jspace::State&, jspace::Vector&))’:
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:3: error: reference to ‘Window’ is ambiguous
/usr/include/X11/X.h:96:13: error: candidates are: typedef XID Window
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:90:9: error: class {anonymous}::Window
/home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:10: error: expected ‘;’ before ‘win’
make[2]: *** [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1
make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build'
make[1]: *** [tutorials/CMakeFiles/tut.dir/all] Error 2
make[1]: Leaving directory `/home/jack/Code/stanford_wbc/build'
make: *** [all] Error 2