gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.47k stars 772 forks source link

Build problem with osgEarth #2585

Closed yunusyurtturk closed 1 month ago

yunusyurtturk commented 1 month ago

osgEarth Version (required): osgearth-3.6

Hello, I'm new to osgEarth and trying to get into it. I've followed getting started/install tutorials from here: https://docs.osgearth.org/en/latest/build.html

I have several problems during build & run process, so I will list one by one what I did and problematic steps. But as a summary here are the problems:

1) Building with vcpkg

I already have a vcpkg installation so I'm using it. I only modified path\to\vcpkg\triplets\x64-windows.cmake for GL3 profile: set(osg_OPENGL_PROFILE GL3)

2) Cloning Repository

Used the command: git clone --recurse-submodules https://github.com/gwaldron/osgearth.git osgearth First time I used this command to clone & build osgEarth, I get some 'BLContext::resetMatrix' errors and found out that they are in fact renamed with a PR. So I thought I should use a 'Release' version instead of master, hence I issued:

git reset --hard osgearth-3.6

If using a 'release' version is the way to go, then I suggest updating the documentation with this info. (I also get same BLContext::resetMatrix not found problem even with osgearth-3.6 version, when building osgEarth project at least)

3) Configure CMake

I use this modfied command becase I was getting the generator not found error when using the one mentioned in tutorial. (Instead of -G "Visual Studio 17 2022 Win64", I used -G "Visual Studio 17 2022" -A x64)

cmake -S osgearth -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=.\install -DCMAKE_TOOLCHAIN_FILE="D:\vcpkg\vcpkg\scripts\buildsystems\vcpkg.cmake"

Here configuration successfully finished with the following message:

... -- Generating done (1.1s) CMake Warning: Manually-specified variables were not used by the project:

WIN32_USE_MP

-- Build files have been written to: E:/Projeler/GIS/osgearth/build

4) Build and install step

cmake --build build --target INSTALL --config RelWithDebInfo

5) Set up your runtime environment

This step is problematic because I don't have any \vcpkg_installed directory created inside the \build directory. I have those directories inside my vcpkg installation directory, D:\vcpkg\vcpkg\installed\x64-windows

So I modified my user path variable with those:

D:\vcpkg\vcpkg\installed\x64-windows\bin D:\vcpkg\vcpkg\installed\x64-windows\tools [installroot] I don't have \install directory created

So the problems are: Either the tutorial is not up to date(or missing some important tips) or I'm doing something wrong. Is there a problem with osgEarth-3.6 version? Which version is stable so I can try it?

There are some other problems that I want to mention but it will be a long issue. I will create another issue for them

yunusyurtturk commented 1 month ago

Here is the PR about reset matrix: https://github.com/gwaldron/osgearth/pull/2579

gwaldron commented 1 month ago

Merged the PR. Thanks all