Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown type name 'uint16_t' when cross-compiling #80

Open
himslm01 opened this issue Feb 6, 2021 · 1 comment
Open

unknown type name 'uint16_t' when cross-compiling #80

himslm01 opened this issue Feb 6, 2021 · 1 comment

Comments

@himslm01
Copy link

himslm01 commented Feb 6, 2021

I have a build environment on Linux cross-compiling for macOS.
I have built and installed Ogg.
I have checked out tags/v1.3.7 from a clean git clone of https://github.com/xiph/vorbis.git.
I have run ./autogen.sh and ./configure.

./autogen.sh && ./configure --build=x86_64-pc-linux-gnu --host=x86_64-apple-darwin15 --prefix=/opt/ffbuild --disable-shared --enable-static

When I make I get the following errors:

In file included from analysis.c:20:
In file included from /opt/ffbuild/include/ogg/ogg.h:24:
/opt/ffbuild/include/ogg/os_types.h:75:12: error: unknown type name 'uint16_t'
   typedef uint16_t ogg_uint16_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:77:12: error: unknown type name 'uint32_t'
   typedef uint32_t ogg_uint32_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:79:12: error: unknown type name 'uint64_t'
   typedef uint64_t ogg_uint64_t;
           ^
3 errors generated.

Full output of ./configure and make is below:

Updating build configuration files for vorbis, please wait....
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:60: installing './compile'
configure.ac:14: installing './config.guess'
configure.ac:14: installing './config.sub'
configure.ac:16: installing './install-sh'
configure.ac:16: installing './missing'
examples/Makefile.am: installing './depcomp'
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-apple-darwin15
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-apple-darwin15-strip... /opt/osxcross/target/bin/x86_64-apple-darwin15-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for x86_64-apple-darwin15-gcc... /opt/osxcross/target/bin/x86_64-apple-darwin15-cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /opt/osxcross/target/bin/x86_64-apple-darwin15-cc accepts -g... yes
checking for /opt/osxcross/target/bin/x86_64-apple-darwin15-cc option to accept ISO C89... none needed
checking whether /opt/osxcross/target/bin/x86_64-apple-darwin15-cc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /opt/osxcross/target/bin/x86_64-apple-darwin15-cc... gcc3
checking how to run the C preprocessor... /opt/osxcross/target/bin/x86_64-apple-darwin15-cc -E
checking for inline... inline
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /opt/osxcross/target/bin/x86_64-apple-darwin15-cc... /opt/osxcross/target/bin/x86_64-apple-darwin15-ld
checking if the linker (/opt/osxcross/target/bin/x86_64-apple-darwin15-ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /opt/osxcross/target/bin/x86_64-apple-darwin15-nm
checking the name lister (/opt/osxcross/target/bin/x86_64-apple-darwin15-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-apple-darwin15 format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/osxcross/target/bin/x86_64-apple-darwin15-ld option to reload object files... -r
checking for x86_64-apple-darwin15-objdump... /opt/osxcross/target/bin/x86_64-apple-darwin15-ObjectDump
checking how to recognize dependent libraries... pass_all
checking for x86_64-apple-darwin15-dlltool... /opt/osxcross/target/bin/x86_64-apple-darwin15-dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-apple-darwin15-ar... /opt/osxcross/target/bin/x86_64-apple-darwin15-ar
checking for archiver @FILE support... no
checking for x86_64-apple-darwin15-strip... (cached) /opt/osxcross/target/bin/x86_64-apple-darwin15-strip
checking for x86_64-apple-darwin15-ranlib... /opt/osxcross/target/bin/x86_64-apple-darwin15-ranlib
checking command to parse /opt/osxcross/target/bin/x86_64-apple-darwin15-nm output from /opt/osxcross/target/bin/x86_64-apple-darwin15-cc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for x86_64-apple-darwin15-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking for x86_64-apple-darwin15-dsymutil... x86_64-apple-darwin15-dsymutil
checking for x86_64-apple-darwin15-nmedit... x86_64-apple-darwin15-nmedit
checking for x86_64-apple-darwin15-lipo... x86_64-apple-darwin15-lipo
checking for x86_64-apple-darwin15-otool... x86_64-apple-darwin15-otool
checking for x86_64-apple-darwin15-otool64... no
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc supports -fno-rtti -fno-exceptions... yes
checking for /opt/osxcross/target/bin/x86_64-apple-darwin15-cc option to produce PIC... -fno-common -DPIC
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc PIC flag -fno-common -DPIC works... yes
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc static flag -static works... no
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc supports -c -o file.o... yes
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc supports -c -o file.o... (cached) yes
checking whether the /opt/osxcross/target/bin/x86_64-apple-darwin15-cc linker (/opt/osxcross/target/bin/x86_64-apple-darwin15-ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking GCC version... 4.2.1
checking if /opt/osxcross/target/bin/x86_64-apple-darwin15-cc accepts -Wdeclaration-after-statement... yes
checking for memory.h... (cached) yes
checking for cos in -lm... yes
checking for pthread_create in -lpthread... yes
checking pkg-config is at least version 0.9.0... yes
checking for OGG... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for working memcmp... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating m4/Makefile
config.status: creating lib/Makefile
config.status: creating lib/modes/Makefile
config.status: creating lib/books/Makefile
config.status: creating lib/books/coupled/Makefile
config.status: creating lib/books/uncoupled/Makefile
config.status: creating lib/books/floor/Makefile
config.status: creating doc/Makefile
config.status: creating doc/vorbisfile/Makefile
config.status: creating doc/vorbisenc/Makefile
config.status: creating doc/libvorbis/Makefile
config.status: creating doc/Doxyfile
config.status: creating include/Makefile
config.status: creating include/vorbis/Makefile
config.status: creating examples/Makefile
config.status: creating test/Makefile
config.status: creating vq/Makefile
config.status: creating libvorbis.spec
config.status: creating vorbis.pc
config.status: creating vorbisenc.pc
config.status: creating vorbisfile.pc
config.status: creating vorbis-uninstalled.pc
config.status: creating vorbisenc-uninstalled.pc
config.status: creating vorbisfile-uninstalled.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make  all-recursive
make[1]: Entering directory '/opt/ffbuild/src/vorbis'
Making all in m4
make[2]: Entering directory '/opt/ffbuild/src/vorbis/m4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/opt/ffbuild/src/vorbis/m4'
Making all in include
make[2]: Entering directory '/opt/ffbuild/src/vorbis/include'
Making all in vorbis
make[3]: Entering directory '/opt/ffbuild/src/vorbis/include/vorbis'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/opt/ffbuild/src/vorbis/include/vorbis'
make[3]: Entering directory '/opt/ffbuild/src/vorbis/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/opt/ffbuild/src/vorbis/include'
make[2]: Leaving directory '/opt/ffbuild/src/vorbis/include'
Making all in vq
make[2]: Entering directory '/opt/ffbuild/src/vorbis/vq'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/opt/ffbuild/src/vorbis/vq'
Making all in lib
make[2]: Entering directory '/opt/ffbuild/src/vorbis/lib'
Making all in modes
make[3]: Entering directory '/opt/ffbuild/src/vorbis/lib/modes'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/opt/ffbuild/src/vorbis/lib/modes'
Making all in books
make[3]: Entering directory '/opt/ffbuild/src/vorbis/lib/books'
Making all in coupled
make[4]: Entering directory '/opt/ffbuild/src/vorbis/lib/books/coupled'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/opt/ffbuild/src/vorbis/lib/books/coupled'
Making all in uncoupled
make[4]: Entering directory '/opt/ffbuild/src/vorbis/lib/books/uncoupled'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/opt/ffbuild/src/vorbis/lib/books/uncoupled'
Making all in floor
make[4]: Entering directory '/opt/ffbuild/src/vorbis/lib/books/floor'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/opt/ffbuild/src/vorbis/lib/books/floor'
make[4]: Entering directory '/opt/ffbuild/src/vorbis/lib/books'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/opt/ffbuild/src/vorbis/lib/books'
make[3]: Leaving directory '/opt/ffbuild/src/vorbis/lib/books'
make[3]: Entering directory '/opt/ffbuild/src/vorbis/lib'
  CC       mdct.lo
  CC       smallft.lo
  CC       block.lo
  CC       envelope.lo
  CC       window.lo
  CC       lsp.lo
  CC       lpc.lo
  CC       analysis.lo
  CC       synthesis.lo
In file included from analysis.c:20:
In file included from /opt/ffbuild/include/ogg/ogg.h:24:
/opt/ffbuild/include/ogg/os_types.h:75:12: error: unknown type name 'uint16_t'
   typedef uint16_t ogg_uint16_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:77:12: error: unknown type name 'uint32_t'
   typedef uint32_t ogg_uint32_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:79:12: error: unknown type name 'uint64_t'
   typedef uint64_t ogg_uint64_t;
           ^
3 errors generated.
Makefile:623: recipe for target 'analysis.lo' failed
make[3]: *** [analysis.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from synthesis.c:18:
In file included from /opt/ffbuild/include/ogg/ogg.h:24:
/opt/ffbuild/include/ogg/os_types.h:75:12: error: unknown type name 'uint16_t'
   typedef uint16_t ogg_uint16_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:77:12: error: unknown type name 'uint32_t'
   typedef uint32_t ogg_uint32_t;
           ^
/opt/ffbuild/include/ogg/os_types.h:79:12: error: unknown type name 'uint64_t'
   typedef uint64_t ogg_uint64_t;
           ^
3 errors generated.
Makefile:623: recipe for target 'synthesis.lo' failed
make[3]: *** [synthesis.lo] Error 1
make[3]: Leaving directory '/opt/ffbuild/src/vorbis/lib'
make[2]: *** [all-recursive] Error 1
Makefile:656: recipe for target 'all-recursive' failed
make[2]: Leaving directory '/opt/ffbuild/src/vorbis/lib'
make[1]: *** [all-recursive] Error 1
Makefile:530: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/opt/ffbuild/src/vorbis'
Makefile:406: recipe for target 'all' failed
make: *** [all] Error 2
@himslm01
Copy link
Author

himslm01 commented Feb 7, 2021

I think this is a "bug" with Ogg when compiling Vorbis or Theora when using the OSX Cross tool chain. https://github.com/tpoechtrager/osxcross

I have had to patch Ogg with

diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h
index eb8a322..6f73b72 100644
--- a/include/ogg/os_types.h
+++ b/include/ogg/os_types.h
@@ -71,6 +71,7 @@
 #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
 
 #  include <sys/types.h>
+#  include <stdint.h>
    typedef int16_t ogg_int16_t;
    typedef uint16_t ogg_uint16_t;
    typedef int32_t ogg_int32_t;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant