title: compiling ROPTLIB example, a C++ lib for convert Manopt to C++
body: <p>I'm tring to conform a part of matlab source to C++. The matlab source calls a matlab lib named Manopt for params optimizing, So I found a lib in C++ named ROPTLIB(<a href="http://www.math.fsu.edu/ROPTLIB/" rel="nofollow">http://www.math.fsu.edu/ROPTLIB/</a>) to realize the same optimization as Manopt. </p>
  
  <p>The problem occured when I download ROPTLIB and try to run the example demo in ROPTLIB user manual. I wrote a CMakeLists.txt(as follow) to compile the lib source code, for there is no compiling tools in lib diretory(except matlab script, but I want the lib run in pure C++ environment in my ubuntu 14.04LTS). The package of lapack and blas are also link to project as you can see in CMakelists.txt.</p>
  
  <p>I try to search the Problem both in google and other forums, but no one can help me. If you have any experience for debug locale_facets_nonio.tcc:918:22: error: expected unqualified-id before or ROPTLIB, printing it blow mat help me.  </p>
  
  <p>CmakeLists.txt:</p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
  SET(ProjectName TestProductExample)
  PROJECT(${ProjectName})
  
  FILE(GLOB_RECURSE all_files
          "${CMAKE_CURRENT_SOURCE_DIR}/Solvers/*.cpp"
          "${CMAKE_CURRENT_SOURCE_DIR}/Problems/*.cpp"
          "${CMAKE_CURRENT_SOURCE_DIR}/Others/*.cpp"
          "${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/*.cpp"
      )
  
  INCLUDE_DIRECTORIES(
          "${CMAKE_CURRENT_SOURCE_DIR}/Solvers/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Problems/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Problems/StieSumBrockett/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Others/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/Stiefel/"
          "${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/Euclidean/"
          "${CMAKE_CURRENT_SOURCE_DIR}/blas/"
          "${CMAKE_CURRENT_SOURCE_DIR}/lapack/"
      )
  
  
  
  message(STATUS "add include_directories " ${INCLUDE_DIRECTORIES})
  if(${CMAKE_COMPILER_IS_GNUCC})
      message (STATUS "add c++11 flags")
      add_definitions(-Wall -s -std=c++11 )
  endif()
  
  set(LIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/;${LIB}")
  message (STATUS "blas and lapack lib is in ${LIB}")
  add_executable(${ProjectName} ${CMAKE_CURRENT_SOURCE_DIR}/test/TestProductExample.cpp ${all_files})
  link_directories({${LIB}})
  target_link_libraries(${ProjectName} lapack_LINUX.a blas_LINUX.a tmglib_LINUX.a)
  message (STATUS "CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}, CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
  message (STATUS "CMAKE_COMPILER_IS_GNUCC is ${CMAKE_COMPILER_IS_GNUCC}")`
  </code></pre>
  
  <p>error log:</p>
  
  <pre><code>  [  1%] Building CXX object CMakeFiles/TestProductExample.dir/test/TestProductExample.cpp.o
      In file included from /usr/include/c++/4.7/bits/locale_facets_nonio.h:1903:0,
                       from /usr/include/c++/4.7/locale:43,
                       from /usr/include/c++/4.7/iomanip:45,
                       from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Manifolds/Manifold.h:23,
                       from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Problems/Problem.h:16,
                       from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/test/TestProductExample.cpp:20:
      /usr/include/c++/4.7/bits/locale_facets_nonio.tcc: In member function ‘_InIter std::time_get&lt;_CharT, _InIter&gt;::_M_extract_name(std::time_get&lt;_CharT, _InIter&gt;::iter_type, std::time_get&lt;_CharT, _InIter&gt;::iter_type, int&amp;, const _CharT**, std::size_t, std::ios_base&amp;, std::ios_base::iostate&amp;) const’:
      /usr/include/c++/4.7/bits/locale_facets_nonio.tcc:918:22: error: expected unqualified-id before ‘(’ token
      In file included from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/test/TestProductExample.cpp:15:0:
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h: At global scope:
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:69:13: warning: ‘void next_state()’ declared ‘static’ but never defined [-Wunused-function]
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:64:22: warning: ‘randgen::state’ defined but not used [-Wunused-variable]
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:65:12: warning: ‘randgen::left’ defined but not used [-Wunused-variable]
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:66:12: warning: ‘randgen::initf’ defined but not used [-Wunused-variable]
      /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:67:23: warning: ‘randgen::next’ defined but not used [-Wunused-variable]
      make[2]: *** [CMakeFiles/TestProductExample.dir/test/TestProductExample.cpp.o] Error 1
      make[1]: *** [CMakeFiles/TestProductExample.dir/all] Error 2
      make: *** [all] Error 2
  </code></pre>