gwaldron / osgearth

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

OSGEarth Viewer is not working #2413

Closed nitinsdg closed 9 months ago

nitinsdg commented 10 months ago

Hello all,

After lot of struggle I am able to install osgearth, but now I am getting below message for simple.earth Please let me know what to do? Earth file

<map>
    <GDALImage name="World GeoTIFF">
        <url>world.tif</url>
    </GDALImage>
</map>

Error Message: FindFileInPath() : USING G:\vcpkg\installed\x64-windows\tools\osg\osgPlugins-3.6.5\osgdb_osg.dll Opened DynamicLibrary osgPlugins-3.6.5/osgdb_osg.dll [osgEarth]* [MapNodeHelper] No valid earth file loaded - aborting [osgEarth] Usage: osgearth_viewer file.earth --sky : add a sky model --kml : load a KML or KMZ file --kmlui : display a UI for toggling nodes loaded with --kml --coords : display map coords under mouse --ortho : use an orthographic camera --logdepth : activates the logarithmic depth buffer --logdepth2 : activates logarithmic depth buffer with per-fragment interpolation --shadows : activates model layer shadows --out-earth [file] : write the loaded map to an earth file --uniform [name] [min] [max] : create a uniform controller with min/max values --define [name] : install a shader #define --path [file] : load and playback an animation path --extension [name] : loads a named extension --ocean : add a simple ocean model (requires bathymetry)

plevy commented 10 months ago

This might be a path issue on Windows. I'd start by including the paths to where vcpkg is installing dlls and plugins to your PATH env variable

path\vcpkg_installed\x64-windows\bin path\vcpkg_installed\x64-windows\plugins\osgPlugins-3.6.5

vcpkg is great for the build but you need to deal with finding all the files and making sure they are in your path

nitinsdg commented 10 months ago

This might be a path issue on Windows. I'd start by including the paths to where vcpkg is installing dlls and plugins to your PATH env variable

path\vcpkg_installed\x64-windows\bin path\vcpkg_installed\x64-windows\plugins\osgPlugins-3.6.5

vcpkg is great for the build but you need to deal with finding all the files and making sure they are in your path

No it is not path issue, path is set, same I tried on ubuntu22 as well same error is coming, it is not proceeding ahead. :(

plevy commented 10 months ago

On Ubuntu, you wouldn't need vcpkg, just apt-get dependencies such as: 1 Build essentials sudo apt update && sudo apt install build-essential

2 GDAL: sudo apt-get install libgdal-dev

3 GLEW sudo apt-get install libglew-dev

4 Build Openscenegraph git clone https://github.com/openscenegraph/OpenSceneGraph.git cd osg mkdir build && cd build cmake .. make -j8 sudo make install

6 Build osgEarth git clone https://github.com/gwaldron/osgearth.git cd osgEarth mkdir build && cd build cmake .. make -j8 sudo make install

Are running "osgearth_viewer simple.earth" ?

plevy commented 10 months ago

I just tested it again and I would be surprised if the build was successful and the path was not an issue. As I said, make sure you are specifying a valid .earth file from the tests folder on the command line

nitinsdg commented 9 months ago

i have added libopengl.so while linking, and now it is working. thanks plevy :)

haisheer commented 4 months ago

Hello, I have also encountered such a problem, may I ask what specific documents you have added to solve this problem

plevy commented 4 months ago

The previous problem was linking to libopengl. What is your specific problem? When you run "osgearth_viewer simple.earth" does it exit immediately which is probably a dll not in your path problem or if there is output from the command, post it here

haisheer commented 4 months ago

I tried to copy the files in this path(\osgearth\osgearth-osgearth-3.2\src\applications\osgearth_viewer) to run in VS, but the following error occurred [osgEarth]* [MapNodeHelper] No valid earth file loaded - aborting [osgEarth] Usage: D:\Code\VS Code\osgearth\osgearth\x64\Release\osgearth.exe file.earth --sky : add a sky model --kml <file.kml> : load a KML or KMZ file --kmlui : display a UI for toggling nodes loaded with --kml --coords : display map coords under mouse --ortho : use an orthographic camera --logdepth : activates the logarithmic depth buffer --logdepth2 : activates logarithmic depth buffer with per-fragment interpolation --shadows : activates model layer shadows --out-earth [file] : write the loaded map to an earth file --uniform [name] [min] [max] : create a uniform controller with min/max values --define [name] : install a shader #define --path [file] : load and playback an animation path --extension [name] : loads a named extension --ocean : add a simple ocean model (requires bathymetry)