[osg-users] osg make error in mingw

Philip Lowman philip at yhbt.com
Tue Jul 29 02:36:08 PDT 2008


On Tue, Jul 29, 2008 at 1:00 AM, songbo_1220 <songbo_1220 at 163.com> wrote:

> hello everyone!
> sorry my english is poor.
> i working at the mingw, i make the osg, find below some error, can you tell
> me why and how to do?
> thanks!
> Administrator at 2F1ABC2403DE47B/f/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/build_msys
> $ make
> Scanning dependencies of target OpenThreads
> [  0%] Building CXX object
> src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/WIN32Condition.obj
> In file included from
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ConditionPrivateData.h:29,
>                  from
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/WIN32Condition.cpp:20:
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ThreadPrivateData.h:22:1:
> warning: "_WIN32_WINNT" redefined
> In file included from
> f:\mingw\build\bin\../lib/gcc/i386-pc-mingw32/4.3.0/../../../../include/windows.h:48,
>                  from
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ConditionPrivateData.h:24,
>                  from
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/WIN32Condition.cpp:20:
> f:\mingw\build\bin\../lib/gcc/i386-pc-mingw32/4.3.0/../../../../include/windef.h:20:1:
> warning: this is the location of the previous definition
> [  0%] Building CXX object
> src/OpenThreads/win32/CMakeFiles/OpenThreadsdir/Win32Mutex.obj
> [  0%] Building CXX object
> src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/Win32Thread.obj
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32Thread.cpp:
> In static member function 'static int
> OpenThreads::ThreadPrivateActions::SetThreadSchedulingParams(OpenThreads::Thread*)':
> f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32Thread.cpp:196:
> error: 'getenv' was not declared in this scope
> make[2]: ***
> [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/Win32Thread.obj] Error 1
> make[1]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/all] Error 2
> make: *** [all] Error 2


Songbo,

Looks like a bug.  To workaround the problem on your system, add the
following to Win32Thread.cpp, near the top:
#include <stdlib.h>


osg-submissions,

I can't reproduce the compilation error with my MinGW and the latest OSG
trunk but I'm attaching the fix anyways since <stdlib.h> should be #included
in this source file anyways.  I can reproduce the warning due to the
redefinition of _WIN32_WINNT and I've fixed it.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080729/bfddd8a7/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ot_mingw_fixes.zip
Type: application/zip
Size: 6273 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080729/bfddd8a7/attachment-0003.zip>


More information about the osg-users mailing list