Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: problem with compiling  (Read 2886 times)

0 Members and 1 Guest are viewing this topic.

Nikolay

  • Newbie
  • *
  • Posts: 1
    • View Profile
problem with compiling
« on: May 17, 2014, 12:54:45 pm »

g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
i pick SFML in "includes" in main.cpp



g++ "/main.cpp" -o  "main"   -lglut -lGL -lGLU -lGLEW
In file included from ./SFML-2.1/include/SFML/Window.hpp:36,
                 from ./main.cpp:3:
/usr/include/SFML/Window/Joystick.hpp:40: error: variable ‘sf::SFML_API_IMPORT sf::Joystick’ has initializer but incomplete type
/usr/include/SFML/Window/Joystick.hpp:42: error: expected primary-expression before ‘public’
/usr/include/SFML/Window/Joystick.hpp:42: error: expected ‘}’ before ‘public’
/usr/include/SFML/Window/Joystick.hpp:42: error: expected ‘,’ or ‘;’ before ‘public’
/usr/include/SFML/Window/Joystick.hpp:144: error: expected declaration before ‘}’ token





if i comment in library //include Joystick.hpp
i get this:




g++ "/main.cpp" -o  "/main"   -lglut -lGL -lGLU -lGLEW
In file included from ./SFML-2.1/include/SFML/Window.hpp:37,
                 from ./main.cpp:3:
/usr/include/SFML/Window/Keyboard.hpp:40: error: variable ‘sf::SFML_API_IMPORT sf::Keyboard’ has initializer but incomplete type
/usr/include/SFML/Window/Keyboard.hpp:42: error: expected primary-expression before ‘public’
/usr/include/SFML/Window/Keyboard.hpp:42: error: expected ‘}’ before ‘public’
/usr/include/SFML/Window/Keyboard.hpp:42: error: expected ‘,’ or ‘;’ before ‘public’
/usr/include/SFML/Window/Keyboard.hpp:164: error: expected primary-expression before ‘key’
/usr/include/SFML/Window/Keyboard.hpp:167: error: expected declaration before ‘}’ token





i think problem is here
Config.hpp
/////////////




   #else // Linux, FreeBSD, Mac OS X

        #if __GNUC__ >= 4

            // GCC 4 has special keywords for showing/hidding symbols,
            // the same keyword is used for both importing and exporting
            #define SFML_API_EXPORT __attribute__ ((__visibility__ ("default")))
            #define SFML_API_IMPORT __attribute__ ((__visibility__ ("default")))

        #else

            // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
            #define SFML_API_EXPORT
            #define SFML_API_IMPORT

        #endif

    #endif




but how to fix it?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: problem with compiling
« Reply #1 on: May 22, 2014, 05:40:18 pm »
How/where do you link the SFML library? Are you trying to include the SFML files directly?

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: problem with compiling
« Reply #2 on: May 23, 2014, 08:29:29 am »
Your system already have sfml installed,you're mixing old Sfml header with the new ones.