Giter Club home page Giter Club logo

Comments (4)

RainerKuemmerle avatar RainerKuemmerle commented on August 16, 2024

Thanks for spotting the issues.

They should be fixed by the commits
31c4437
2565cf0

Cheers,
Rainer

On 03.04.2012 17:37, Sunglok Choi wrote:

Hi. I finally compiled and tested 'g2o' in my Windows native development environment, MSVC 2008 with Qt SDK and libQGLViewer.

I found the following problems in the current version for Windows. Since I cannot access 'g2o' repository, I cannot apply my solutions to work 'g2o' correctly in Windows. Even though the problems and solutions are trivial, please apply solutions to 'g2o' for further Windows users' convenience.

[Compile Error 1] 'usleep()' functions in 'g2o/examples/slam2d/slam2d_g2o.cpp' and 'g2o/apps/g2o_viewer/g2o_viewer.cpp'
Solution:
#ifdef _WINDOWS

include<windows.h>

#else

include<unistd.h>

#endif

#ifdef _WINDOWS
Sleep(10); // [msec]
#else
usleep(10000); // [usec]
#endif

[Compile Error 2] Missing GLU-related definitions in 'g2o/examples/slam2d/draw_helper.cpp'
Solution:
#ifdef _WINDOWS
#include<gl/GLU.h>
#endif

[Compile Error 3] Missing 'M_PI' definitions in 'g2o/examples/slam2d/draw_helper.cpp'
Solutions:
#define _USE_MATH_DEFINES
#include

Finally, I found more bugs especially in 'examples', and I will report them later.


Reply to this email directly or view it on GitHub:
#1

from g2o.

sunglok avatar sunglok commented on August 16, 2024

Thank you for your rapid respond! I believe that 'g2o' will be one of the most important tool in robotics and computer vision.

In the header file "cmath" in MSVC, mathematical constants such as 'M_PI' and 'M_E' are disabled initially. Therefore, to avoid the above [Compile Error 3] in MSVC, I recommend that add "#define _USE_MATH_DEFINES" before including "cmath".

Please refer the below webpage for further information.
http://binglongx.wordpress.com/2011/03/21/_use_math_defines-m_pi-undeclared-identifier-and-math-constants-in-cc/
http://stackoverflow.com/questions/806145/how-do-i-access-math-constants-eg-m-pi-in-visual-c-2008

from g2o.

RainerKuemmerle avatar RainerKuemmerle commented on August 16, 2024

We added _USE_MATH_DEFINES to the top-level CMakeLists.txt such that it should be defined.
Currently, I do not have MSVC available for testing.

from g2o.

sunglok avatar sunglok commented on August 16, 2024

I perform the test in MSVC. It works well! Thanks.

from g2o.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.