Ubuntu 16.04安装Omnet++报错:无法找到osgEarth
./configure Hey there, let's work through this issue where your ./configure script can't find osgEarth 2.7 or later. Here are some actionable steps to fix this:
1. Verify Your osgEarth Version
First, make sure you actually have a compatible version installed:
- Run the version check tool if available:
osgEarthVersion - Or check the version header directly (adjust the path if you installed to a non-default location):
grep OSGEARTH_VERSION /usr/include/osgEarth/Version.h
If the version is older than 2.7, you'll need to upgrade to a supported release of osgEarth.
2. Ensure osgEarth is in System Search Paths
If osgEarth is installed in a non-standard directory (like /usr/local or a custom path), the configure script might not locate it automatically. Try these fixes:
- Set the pkg-config path (this helps configure find library metadata):
Replaceexport PKG_CONFIG_PATH=/path/to/osgEarth/lib/pkgconfig:$PKG_CONFIG_PATH ./configure/path/to/osgEarthwith your actual installation directory. - Explicitly specify include and library paths in the configure command:
./configure CFLAGS="-I/path/to/osgEarth/include" LIBS="-L/path/to/osgEarth/lib -losgEarth -losgEarthUtil"
3. Diagnose with config.log Details
Looking at your config.log, the test compilation for osgEarth failed. Check for these common issues in the log:
- Missing header files: Look for lines like
fatal error: osgEarth/Version.h: No such file or directory– this means the include path isn't set correctly. - Linker errors: Lines like
undefined reference to osgEarth::...indicate the linker can't find the osgEarth libraries, so the library path is wrong.
4. Disable osgEarth (If You Don't Need It)
If you don't require osgEarth functionality for your build, follow the error message's suggestion:
- Open the
configure.userfile and add or modify this line:WITH_OSGEARTH=no - Then re-run
./configureto skip the osgEarth check.
内容的提问来源于stack exchange,提问作者PARTH SURESH

