hovatterz / light

Let There Be Light - SFML Lighting System
21 stars 7 forks source link

Build fails on Linux (Manjaro Linux) #7

Closed feroldi closed 9 years ago

feroldi commented 9 years ago

Some C++ errors appears in LTBL/QuadTreeNode.h, LTBL/LightSystem.h, some namespace's errors, syntax errors and so on.

I tried to compile the sample (which I needed to place the data folder to its directory) and these errors just exploded in my face.

Here's the complete output:

    In file included from /usr/include/c++/4.9.2/unordered_set:35:0,
                 from /usr/local/include/LTBL/QuadTreeNode.h:5,
                 from /usr/local/include/LTBL/QuadTree.h:14,
                 from /usr/local/include/LTBL/Light.h:6,
                 from /usr/local/include/LTBL/LightSystem.h:4,
                 from /home/thelost/Programming/light-master/sample/main.cpp:1:
/usr/include/c++/4.9.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^
In file included from /usr/local/include/LTBL/QuadTree.h:14:0,
                 from /usr/local/include/LTBL/Light.h:6,
                 from /usr/local/include/LTBL/LightSystem.h:4,
                 from /home/thelost/Programming/light-master/sample/main.cpp:1:
/usr/local/include/LTBL/QuadTreeNode.h:26:8: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
   std::unordered_set<QuadTreeOccupant*> occupants;
        ^
/usr/local/include/LTBL/QuadTreeNode.h:40:26: error: ‘std::unordered_set’ has not been declared
   void getOccupants(std::unordered_set<QuadTreeOccupant*> &upperOccupants, QuadTreeNode* newNode);
                          ^
/usr/local/include/LTBL/QuadTreeNode.h:40:39: error: expected ‘,’ or ‘...’ before ‘<’ token
   void getOccupants(std::unordered_set<QuadTreeOccupant*> &upperOccupants, QuadTreeNode* newNode);
                                       ^
In file included from /usr/local/include/LTBL/Light.h:6:0,
                 from /usr/local/include/LTBL/LightSystem.h:4,
                 from /home/thelost/Programming/light-master/sample/main.cpp:1:
/usr/local/include/LTBL/QuadTree.h:23:8: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
   std::unordered_set<QuadTreeOccupant*> outsideRoot;
        ^
In file included from /home/thelost/Programming/light-master/sample/main.cpp:1:0:
/usr/local/include/LTBL/LightSystem.h:50:8: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
   std::unordered_set<Light*> lights;
        ^
/usr/local/include/LTBL/LightSystem.h:51:8: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
   std::unordered_set<EmissiveLight*> emissiveLights;
        ^
/usr/local/include/LTBL/LightSystem.h:52:8: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
   std::unordered_set<ConvexHull*> convexHulls;
        ^
/usr/local/include/LTBL/LightSystem.h:56:8: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   std::unique_ptr<qdt::QuadTree> lightTree;
        ^
/usr/local/include/LTBL/LightSystem.h:57:8: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   std::unique_ptr<qdt::QuadTree> hullTree;
        ^
/usr/local/include/LTBL/LightSystem.h:58:8: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   std::unique_ptr<qdt::QuadTree> emissiveTree;
        ^
/home/thelost/Programming/light-master/sample/main.cpp: In function ‘int main(int, char**)’:
/home/thelost/Programming/light-master/sample/main.cpp:139:51: error: ‘snprintf’ was not declared in this scope
     snprintf(buffer, sizeof(buffer), "%d FPS", fps);
eXpl0it3r commented 9 years ago

Did you even look at the errors?

error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

You're not enabling C++11 and thus the C++11 features std::unordered_set and std::unique_ptr do not exist. :wink:

feroldi commented 9 years ago

I expected it to be in the makefile. Anyway, thanks.

hovatterz commented 9 years ago

This is in the CMakeListst.txt as

# light uses C++11 features
if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

I suppose this could be modified to better support what you're using if you'd like.

hovatterz commented 9 years ago

Also I fixed the data directory being copied to the wrong path issue. Thanks for pointing that out!

feroldi commented 9 years ago

No problem!