libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Problems building or running the engine, queries about how to use features etc.
Post Reply
RisaStenr
Gnoblar
Posts: 6
Joined: Thu Jun 21, 2018 7:28 pm

libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by RisaStenr »

Ogre Version: :1.11:
Operating System: :Ubuntu:
Render System: :OpenGL 3+:

I am trying to run bootstrap.cpp from the samples/tutorial directory and I keep getting this warning (with a bunch of undefined reference errors):
:-1: warning: libfreetype.so.2.9, needed by /usr/local/lib/libOgreOverlay.so.1.11.2, not found (try using -rpath or -rpath-link)

I first got this error with the 1.11 linked from the main site, then I found this https://bugs.archlinux.org/task/53868 which said you needed to install to a fresh chroot so I reinstalled Ubuntu and tried it again, even turning off the build_dependencies variable they talked about. Then I went and found the freetype 2.9 bundle included in the v1.11 build and make installed it and it still didn't work. I then tried the latest pull and I still get this error. Anyone know what I need to do to fix? I'm out of ideas.
RisaStenr
Gnoblar
Posts: 6
Joined: Thu Jun 21, 2018 7:28 pm

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by RisaStenr »

OK nevermind I figured it out I needed

Code: Select all

link_directories(dir/to/libfreetype.so.2.9)

in my cmakelists.txt file. It was in the dependencies folder of where I built Ogre.

One thing I don't get is why if I did not select build dependencies why did it still do it? Or am I confused as to what the build_dependencies option does?
reb_cabin
Gnoblar
Posts: 12
Joined: Thu Jul 05, 2018 4:19 pm

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by reb_cabin »

I had similar problems, and fixed them by changing CMakeLists.txt in the Samples/Tutorials directory. This is a terrible workaround fix because it mentions absolute file paths, but it actually did get the samples to build and run. I tried using the https://cmake.org/cmake/help/latest/com ... ories.html command from cmake, but it didn't work at all. I admit I don't have the slightest understanding of the cmake strategy for the large Ogre build, but I am sharing this hack with you just because it unblocked me.

Code: Select all

cmake_minimum_required (VERSION 2.8)
project(OgreTutorialsSample)

## [discover_ogre]
# specify which version and components you need
find_package(OGRE 1.11 REQUIRED COMPONENTS Bites RTShaderSystem)

# copy resource.cfg next to our binaries where OGRE looks for it
file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_BINARY_DIR})
## [discover_ogre]

set(ZZLIB    "~/Documents/GitHub/ogre-1.11.1/build/Dependencies/lib/libzzip.so")
set(FREETYPE "~/Documents/GitHub/ogre-1.11.1/build/Dependencies/lib/libfreetype.so")

add_executable(0_Bootstrap Bootstrap.cpp)
target_link_libraries(0_Bootstrap ${ZZLIB} ${FREETYPE} ${OGRE_LIBRARIES})

add_executable(1_FirstScene BasicTutorial1.cpp)
target_link_libraries(1_FirstScene ${ZZLIB} ${FREETYPE} ${OGRE_LIBRARIES})

add_executable(2_CamerasAndShadows BasicTutorial2.cpp)
target_link_libraries(2_CamerasAndShadows ${ZZLIB} ${FREETYPE} ${OGRE_LIBRARIES})
RisaStenr
Gnoblar
Posts: 6
Joined: Thu Jun 21, 2018 7:28 pm

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by RisaStenr »

Thanks for your help. I guess since freetype 2.9 is a required dependency it needs that specific version. I built with all the other dependencies at latest release and they worked just fine. Oh well at least there is a fix. Would be nice if it were metioned in the tutorial API though.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by paroj »

you can make Ogre use the system libraries by "cmake -DOGRE_BUILD_DEPENDENCIES=OFF .." to avoid these problems. Note that you have to delete the cmake cache for any existing builds and this has be done via CLI.
reb_cabin
Gnoblar
Posts: 12
Joined: Thu Jul 05, 2018 4:19 pm

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by reb_cabin »

@RisaStenr I got your solution with link_directories to work and removed my disgusting hack. Probably a spelling error or a stray comma or quotes in the wrong place: CMake doesn't like commas.

btw, I have seen somewhere in the CMake documentation or in thrashing around blogs that link_directories is no longer considered a "best practice." Sorry I've lost the reference, but might be something to be-on-the-lookout for.

@paroj I will experiment later with your suggestion.
Zemtriz
Gnoblar
Posts: 9
Joined: Fri Jul 13, 2018 8:17 pm

Re: libfreetype.so.2.9, needed by libOgreOverlay.so.1.11.2, not found

Post by Zemtriz »

Hello,

I'm experiencing same error and ogre has been built without dependencies. All dependencies were installed to the system from official repositories.

System: Manjaro
Ogre: 1.11.1

Folder structure
Source: /.../OgreSDK/ogre-1.11.1
Build: /.../OgreSDK/ogre-1.11.1-build
Install: /.../OgreSDK/ogre-1.11.1-install

I have copied Tutorial folder to the OgreSDK, ran cmake-gui, set OGRE_DIR to /.../OgreSDK/ogre-1.11.1-install/lib/OGRE/cmake
Build folder was created and running make results in errors:

Code: Select all

[marek@marek-pc build]$ make
[ 16%] Linking CXX executable 2_CamerasAndShadows
/usr/bin/ld: warning: libfreetype.so.2.9, needed by /run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1, not found (try using -rpath or -rpath-link)
/run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1: undefined reference to `FT_New_Memory_Face'
/run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1: undefined reference to `FT_Load_Char'
/run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1: undefined reference to `FT_Init_FreeType'
/run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1: undefined reference to `FT_Done_FreeType'
/run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1: undefined reference to `FT_Set_Char_Size'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/2_CamerasAndShadows.dir/build.make:94: 2_CamerasAndShadows] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/2_CamerasAndShadows.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
[marek@marek-pc build]$ 
Another details:

Code: Select all

[marek@marek-pc OgreSDK]$ find ./ -name "libOgreOverlay*"
./ogre-1.11.1-install/lib/libOgreOverlay.so
./ogre-1.11.1-install/lib/libOgreOverlay.so.1.11.1
./ogre-1.11.1-build/lib/libOgreOverlay.so
./ogre-1.11.1-build/lib/libOgreOverlay.so.1.11.1
[marek@marek-pc OgreSDK]$ ldd ogre-1.11.1-install/lib/libOgreOverlay.so
        linux-vdso.so.1 (0x00007ffd3a5e0000)
        libOgreMain.so.1.11.1 => not found
        libfreetype.so.2.9 => not found
        libz.so.1 => /usr/lib/libz.so.1 (0x00007fb2ef63d000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fb2ef41f000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fb2ef096000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007fb2eed01000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fb2eeae9000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fb2ee72d000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007fb2efaab000)
[marek@marek-pc OgreSDK]$ ldd ogre-1.11.1-build/lib/libOgreOverlay.so
        linux-vdso.so.1 (0x00007ffe84b68000)
        libOgreMain.so.1.11.1 => /run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-build/lib/libOgreMain.so.1.11.1 (0x00007fb8d0493000)
        libfreetype.so.2.9 => /run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-build/Dependencies/lib/libfreetype.so.2.9 (0x00007fb8d01e5000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007fb8cffce000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fb8cfdb0000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fb8cfa27000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007fb8cf692000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fb8cf47a000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fb8cf0be000)
        libzzip.so => /run/media/marek/cd998326-6c5a-4cd3-b3ff-d425a0c06ae4/OgreSDK/ogre-1.11.1-build/Dependencies/lib/libzzip.so (0x00007fb8ceeb7000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fb8cecb3000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007fb8cea07000)
        libharfbuzz-icu.so.0 => /usr/lib/libharfbuzz-icu.so.0 (0x00007fb8ce804000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007fb8d0d7b000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007fb8ce4ed000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fb8ce224000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007fb8cdff8000)
        libicuuc.so.61 => /usr/lib/libicuuc.so.61 (0x00007fb8cdc3e000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fb8cd9cc000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007fb8cd7bc000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fb8cd586000)
        libicudata.so.61 => /usr/lib/libicudata.so.61 (0x00007fb8cb9e1000)
[marek@marek-pc OgreSDK]$ 
EDIT:
Fixed by rebuilding ogre with changed freetype parameters to point to the /usr/lib/freetype2 and usr/include/freetype2
Image
Before this it was pointing to the: /.../OgreSDK/ogre-1.11.1-build/Dependencies/include/freetype2/ and lib folder too.

But why I cannot install tutorials?

Code: Select all

[marek@marek-pc build]$ make install
make: *** No rule to make target 'install'.  Stop.
Post Reply