Board index FlightGear Support Compiling

OSG Superbuild freetype Error  Topic is solved

Building FlightGear from source, and in the need for help?

OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 5:14 am

Using Visual Studios Express 2013/Windows Desktop Edition

Does the same thing in Visual Studios Express 2010.

Code: Select all
Error   1   error C1083: Cannot open include file: 'freetype.h': No such file or directory [F:\fgdev\fgfs\metabuild\osgbuild\src\osgPlugins\freetype\osgdb_freetype.vcxproj]   f:\fgdev\fgfs\metabuild\src\osg\src\osgplugins\freetype\FreeTypeFont.h   20   1   OSG

I get 6 of these compiling OSG. All the other projects are compiling fine. I checked VC++ Directories\Include Directories and it appears to have the correct path to "F:\fgdev\fgfs\metabuild\3rdParty\include"

Any suggestions, thank you in advance for any direction.

Little more info...

I think this crept in after a git pull.
I also got FlightGear build errors but fixed it with
https://gitorious.org/fg/flightgear/commit/6d6e45274f75dd55a5b15bcf08b9750cb07549c5
However I couldn't find anything on the freetype error.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby F-JJTH » Mon May 12, 2014 8:16 am

Thanks you for the report, please pull the last CMakeLists.txt it should be fixed with: https://gitorious.org/fg/fgmeta/commit/ ... d070e13400

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 9:11 am

Clément, thank you for the fix.

A typo (") and some incorrect escape sequences (\ instead of /) in the fix.though.

Should be
Code: Select all
SET(OSG_CMAKE_ARGS
      -DBUILD_OSG_APPLICATIONS:BOOL=ON
      -DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF
      -DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}
      -DCURL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include
      -DTIFF_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include
      -DGDAL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include
      -DGDAL_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/lib/gdal_i.lib
      -DTIFF_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/lib/libtiff.lib
      -DCURL_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/lib/libcurl_imp.lib
      -DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/lib/freetype.lib
    )


not
Code: Select all
SET(OSG_CMAKE_ARGS
     -DBUILD_OSG_APPLICATIONS:BOOL=ON
     -DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF
     -DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}
     -DCURL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\include -\+/
     -DTIFF_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\include -\+/
     -DGDAL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\include -\+/
     -DGDAL_LIBRARY:FILEPATH="${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\lib\gdal_i.lib -"-\-\+/+/
     -DTIFF_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\lib\libtiff.lib -\-\+/+/
     -DCURL_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\lib\libcurl_imp.lib -\-\+/+/
     -DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}\lib\freetype.lib -\-\+/+/
)


I'm "rebuilding" entire solution now because a quick build of just OSG looked like it still had the error. I'll let you know when finished.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 9:26 am

Still showing
Code: Select all
Error   1   error C1083: Cannot open include file: 'freetype.h': No such file or directory [F:\fgdev\fgfs\metabuild\osgbuild\src\osgPlugins\freetype\osgdb_freetype.vcxproj]   f:\fgdev\fgfs\metabuild\src\osg\src\osgplugins\freetype\FreeTypeFont.h   20   1   OSG
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby F-JJTH » Mon May 12, 2014 10:38 am

Oops, I forgot 1 line: https://gitorious.org/fg/fgmeta/commit/ ... cb69f860ff
And typo is fixed too: https://gitorious.org/fg/fgmeta/commit/ ... 1e065e2867

If it still fails, please show me (pastebin.com) the entire log

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 6:13 pm

Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby F-JJTH » Mon May 12, 2014 7:46 pm

Well I don't know what happend :/ Everything looks OK.
Jenkins (MSVC2010) is able to build it without problem.
Here (MSVC2010) i'm able to build it without problem.

Your log looks correct, you are able to find "ft2build.h" (in 3rdParty.x64/include/freetype/ft2build.h) this file include config/ftheader.h who defines " #define FT_FREETYPE_H <freetype.h> " and finally your compiler is able to resolve the "#include FT_FREETYPE_H" (in osg/src/osgPlugins/freetype/FreeTypeFont.h) but for some mysterious things he is not able to find it.

ft2build.h and freetype.h are in the same folder, it's really incredible that "#include <ft2build.h>" is OK but #include <freetype.h>" is NOT OK, freetype.h is just beside ft2build.h :/

So I'm really sorry but I can't help you more.

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 8:30 pm

OK, let me try it in 2010 and see if that works any better.
I did read somewhere that using <> instead of " for freetype caused some problems on some systems.
Thanks for your effort!

One other note worth mentioning, I had already installed the freetype lib for another project long before I did the superbuild. Maybe that is causing some trouble.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 10:03 pm

Clément,

I can't find where the macro FT_FREETYPE_H as in "#include FT_FREETYPE_H" is defined.
Where should that definition be?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby wlbragg » Mon May 12, 2014 10:18 pm

I can't find where the macro FT_FREETYPE_H as in "#include FT_FREETYPE_H" is defined.


Never mind I found it. The reason I was asking is because usually when you mouse over a type define the IDE will give you its definition. However in this case it isn't. Does this shed any light on it?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby langsam » Mon May 19, 2014 4:44 am

I'm building flightgear first time VS2010 Win7 64.
I met the same error wlbragg did.

I'm still buiding, but osg building is successed.
I recovered this error copying freetype includes in (BUILDING DIRECTORY)\3rdParty.x64\include\freetype\* to (BUILDING DIRECTORY)\3rdParty.x64\include\
(copy to upper directory)

f2build.h is included in FreeTypeFont.h.
but OSG sources have dual include path for their header files.

This error seems designation of CmakeLists.txt causes:
Code: Select all
        -DFREETYPE_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include;${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include/freetype

The second path in the latest changed CmakeList.txt does not seems available.
I missed the building log error causes, but second path was not affected in CL command line.

Revision: 036899c6203ac8842f9e52485d5e7ccb69f860ff
Author: Clément de l'Hamaide <clemaez@hotmail.fr>
Date: 2014/05/12 19:35:06
Message:
CMakeLists.txt: help CMake to find FreeType include dirs
----
Modified: CMakeLists.txt


I do not understand CMake system very well.
If OSG sources is not changable, this designation must be changed.

oh, Now all build is success!
langsam
 
Posts: 6
Joined: Mon May 19, 2014 4:16 am
Location: Kanoya, Kagoshima, NIPPON(JAPAN)

Re: OSG Superbuild freetype Error

Postby rreiter » Mon May 19, 2014 8:33 pm

I'm building a clean VS2010 Windows x64 Superbuild of FlightGear-Meta.sln and have encountered the same error as both wlbragg and langsam .

I wonder if the problem is now the ";" between the paths in fgMeta/CmakeLists.txt here:
Code: Select all
-DFREETYPE_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include;${CMAKE_BINARY_DIR}/${RDPARTY_DIR}/include/freetype


While building the solution I get the error. Next I look at the generated file metabuild/OSG.vcxproj and search for the cmake.exe lines with "freetype".
Note the semi-colon in the path is gone (I'm not sure if the missing semicolon here now is a problem or is still ok?)
Code: Select all
if %errorlevel% neq 0 goto :cmEnd
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_OSG_APPLICATIONS:BOOL=ON -DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF -DACTUAL_3RDPARTY_DIR:PATH=W:/homevs/metabuild/3rdParty.x64 -DCURL_INCLUDE_DIR:PATH=W:/homevs/metabuild/3rdParty.x64/include -DTIFF_INCLUDE_DIR:PATH=W:/homevs/metabuild/3rdParty.x64/include -DGDAL_INCLUDE_DIR:PATH=W:/homevs/metabuild/3rdParty.x64/include -DGDAL_LIBRARY:FILEPATH=W:/homevs/metabuild/3rdParty.x64/lib/gdal_i.lib -DTIFF_LIBRARY:FILEPATH=W:/homevs/metabuild/3rdParty.x64/lib/libtiff.lib -DCURL_LIBRARY:FILEPATH=W:/homevs/metabuild/3rdParty.x64/lib/libcurl_imp.lib -DFREETYPE_LIBRARY:FILEPATH=W:/homevs/metabuild/3rdParty.x64/lib/freetype.lib -DFREETYPE_INCLUDE_DIR:PATH=W:/homevs/metabuild/3rdParty.x64/include W:/homevs/metabuild/3rdParty.x64/include/freetype -DCMAKE_INSTALL_PREFIX=W:/homevs/metabuild/install/msvc100-64/OpenSceneGraph "-GVisual Studio 10 Win64" W:/homevs/metabuild/src/OSG


and, next, in metabuild/osgbuild/CMakelists.txt the path to include/freetype is missing:
Code: Select all
//No help, variable specified on the command line.
FREETYPE_INCLUDE_DIR:PATH=W:/homevs/metabuild/3rdParty.x64/include

FREETYPE_INCLUDE_DIR_freetype2:PATH=W:/homevs/metabuild/3rdParty.x64/include

FREETYPE_INCLUDE_DIR_ft2build:PATH=W:/homevs/metabuild/3rdParty.x64/include

//No help, variable specified on the command line.
FREETYPE_LIBRARY:FILEPATH=W:/homevs/metabuild/3rdParty.x64/lib/freetype.lib

//Path to a library.
FREETYPE_LIBRARY_DEBUG:FILEPATH=FREETYPE_LIBRARY_DEBUG-NOTFOUND


I also don't know enough about cmake to correct it in fgMeta.
One workaround is the same as described above by langsam: copy the contents of include/freetype up on level so it can be found in /include.
rreiter
 
Posts: 35
Joined: Thu Jan 16, 2014 4:33 am
Location: Newmarket, Ontario Canada
OS: Windows

Re: OSG Superbuild freetype Error

Postby wlbragg » Wed May 21, 2014 8:43 pm

Thanks guys, the workaround worked for me too. I noticed quite by accident though that you still need Freetype ftoutln.h in its normal path or it errors. Can't figure that one out but I guess it doesn't matter.
I also had tried adding both Freetype paths to vcinclude but that didn't work either.
I think the missing semi-colon might be the problem.
It appears that the meta build does so on the fly and recreates "itself", for lack of better words, and that is why changes don't correct things or stick. I guess Clément needs to fix it in source so when it recreates itself it has the correct changes. The only thing is, it looks like the semi-colon is there in the original.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby wlbragg » Wed May 21, 2014 10:34 pm

Clément,

I think I steered you wrong.

The correct fix for the Freetype error is to escape "\" the semicolon.
Code: Select all
-DFREETYPE_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include\;${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include\\freetype


Where I mislead you was to suggest you use / for all the path statements. For Windows it should be \\ which is escape+\.

So the correct set args statement should be..

Code: Select all
SET(OSG_CMAKE_ARGS
      -DBUILD_OSG_APPLICATIONS:BOOL=ON
      -DOSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS:BOOL=OFF
      -DACTUAL_3RDPARTY_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}
      -DCURL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include
      -DTIFF_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include
      -DGDAL_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include
      -DGDAL_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\lib\\gdal_i.lib
      -DTIFF_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\lib\\libtiff.lib
      -DCURL_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\lib\\libcurl_imp.lib
      -DFREETYPE_LIBRARY:FILEPATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\lib\\freetype.lib
      -DFREETYPE_INCLUDE_DIR:PATH=${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include\;${CMAKE_BINARY_DIR}\\${RDPARTY_DIR}\\include\\freetype
    )
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5765
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: OSG Superbuild freetype Error

Postby F-JJTH » Thu May 22, 2014 5:51 am

Hi,

I will look at that this weekend, currently I haven't a Windows machine

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests