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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vlad12

Pages: [1]
1
General / Re: SFML on Win32 with Cmake, cannot link to glew
« on: November 30, 2013, 07:47:07 pm »
In on win7 x64, using Visual Studio 2013 compiler (VC120). SFML version is 2.1. Here are a few errors:

   120   IntelliSense: identifier "glVertexAttribPointer" is undefined   
   114   IntelliSense: identifier "glUseProgram" is undefined   
   117   IntelliSense: identifier "glUniform1i" is undefined   
   112   IntelliSense: identifier "glGetUniformLocation" is undefined   
   113   IntelliSense: identifier "glGetAttribLocation" is undefined   
   121   IntelliSense: identifier "glEnableVertexAttribArray" is undefined   
Error   38   error C2065: 'GL_VERTEX_SHADER' : undeclared identifier
Error   94   error C2065: 'GL_VERTEX_SHADER' : undeclared identifier   
Error   15   error C2065: 'GL_ARRAY_BUFFER' : undeclared identifier   
Error   69   error C2065: 'GLchar' : undeclared identifier

And a lot more like these... so basically it doesn't recognizer the usual non-windows opengl, which is usually resolved by using GLEW.

And my headers:
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Graphics.hpp>

2
General / SFML on Win32 with Cmake, cannot link to glew
« on: November 30, 2013, 06:13:25 am »
Hi there,

It seems like a really simple thing, but i just can't manage to get it working. The error is that the my generated vc project doesn't recognize GL_ARRAY_BUFFER and other stuff which is usually resolved by linking to GLEW. I understand that GLEW is already included in SFML as long as we declare static linking true. Here is the CMake code:

#other stuff

# OpenGL
find_package(OpenGL)

# SFML
if(WIN32)
   set(SFML_STATIC_LIBRARIES TRUE)
endif(WIN32)

set(SFML_INCLUDE_DIR "${SharedDependencies}/Shared")

find_package(SFML COMPONENTS  system window graphics)
include_directories(${SFML_INCLUDE_DIR})

add_executable(App main.cpp)
target_link_libraries(App Core)
target_link_libraries(App Graphics)
target_link_libraries(App ${OPENGL_LIBRARIES})
target_link_libraries(App  ${SFML_LIBRARIES})

#other stuff

I also tried adding  add_definitions(-DSFML_STATIC -DGLEW_STATIC) with no success.
My apologies if this is a redundant question, but I really searched online and none of the solutions worked.

Thanks

Pages: [1]
anything