osx - Undefined symbols for architecture x86_64: "_glBegin" -
i'm trying build source code , after passing/fixing ton of errors, i'm stuck @ point have no idea how fix. i'm novice in building sources tried search error , none of them worked me although i'm not sure if implemented them correctly. i'm on osx 10.8.5 xcode 5.1.1
i'm striving make cmake file @ 75% i'm getting error (brief form):
undefined symbols architecture x86_64: "_glbegin", referenced from: alembicholderoverride::draw(mhwrender::mdrawcontext const&, muserdata const*) in alembicholderoverride.cpp.o
and portion of cmakelist have:
# fix stop crash on osx < 10.9 set(cmake_osx_deployment_target 10.8) # compiler flags if (${cmake_system_name} matches "windows") # disable of bullshit warnings msvc wants barf add_definitions( "-w3 -mp -d_crt_secure_no_warnings -wd4005 -wd4996 -wd4305 -wd4244 -nologo" ) set(cmake_cxx_flags "${cmake_cxx_flags} /mp") endif() if( "${cmake_system_name}" matches "darwin" ) set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++03 -stdlib=libstdc++ -framework opengl") endif() if( "${cmake_system_name}" matches "linux" ) add_definitions(-d_linux) set(cmake_cxx_flags "${cmake_cxx_flags} -o3 -fvisibility=hidden -fpic") endif()
i appreciate on in advance, , please don't hesitate let me know if part of cmakelist build flags wrong since i'm not experienced in this.
you need link opengl:
find_package(opengl required) ... add_(library|executable)(<your-target> ...) ... target_include_directories(<your-target> private ${opengl_include_dir}) target_link_libraries(<your-target> private ${opengl_libraries})
(you may need public
linking if it's library public headers using opengl)
or traditional way:
find_package(opengl required) include_directories(${opengl_include_dir}) link_libraries(${opengl_libraries}) ... add_(library|executable)(<your-target> ...)
Comments
Post a Comment