Skip to content

Instantly share code, notes, and snippets.

@xarragon
Created August 12, 2020 20:39
Show Gist options
  • Save xarragon/dbc501cd9214b8d0929a704df3912543 to your computer and use it in GitHub Desktop.
Save xarragon/dbc501cd9214b8d0929a704df3912543 to your computer and use it in GitHub Desktop.
Test 32-bit build on 64-bit Debian host
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
int main(int argc, char *argv[])
{
int error;
puts("hello");
FT_Library ft_inst;
if ((error = FT_Init_FreeType(&ft_inst)) != 0)
{
fprintf(stderr, "unable to initalize FreeType library");
exit(1);
}
return 0;
}
CFLAGS=`pkg-config --cflags freetype2` -m32
LDFLAGS=`pkg-config --libs freetype2` -m32
@xarragon
Copy link
Author

xarragon commented Aug 13, 2020

$ file /usr/lib/i386-linux-gnu/libfreetype.so.6.12.3
/usr/lib/i386-linux-gnu/libfreetype.so.6.12.3: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=4a970c51f96f402b3011312348936f4f4c1c4f49, stripped

@xarragon
Copy link
Author

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential gcc-multilib libfreetype6-dev:i386

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment