Cross Compiling with Cmake #71
-
I have followed this GUIDE: I have added those to my cmake file. include_directories(${SYSROOT_PATH}/usr/include/arm-linux-gnueabihf)
link_directories(${SYSROOT_PATH}/usr/lib/arm-linux-gnueabihf) Have rasbian rootfs with correct linking. My Toolchain Cmake file. Is a bit different from the guide posted there. But that should not be an issue. if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
# Define the compiler
set(CMAKE_C_COMPILER ${TOOLCHAIN_CC})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_CXX})
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${SYSROOT_PATH}/usr/lib/${TOOLCHAIN_HOST}")
set(CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH};${CMAKE_SYSROOT}")
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) But when I want to compile it. It fails. Those are the errors/issues I am getting during complilation
This one comes at linking procedure
|
Beta Was this translation helpful? Give feedback.
Replies: 28 comments 52 replies
-
@rafal1137 Please remove |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Please test it and report back here, check if this fixes your issue. Good luck. |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 For more information on why |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix CMake Error at /usr/share/cmake-3.13/Modules/FindX11.cmake:429 (message):
Could not find X11
....
-- Configuring incomplete, errors occurred! |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Did you made following symlinks before syncing sysroot with RPi? sudo ln -sf -r /usr/include/arm-linux-gnueabihf/asm /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/gnu /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/bits /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/sys /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/openssl /usr/include
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crtn.o /usr/lib/crtn.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crt1.o /usr/lib/crt1.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib/crti.o Also, check this comment: #69 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Also, can you test without if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
# Define the compiler
set(CMAKE_C_COMPILER ${TOOLCHAIN_CC})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_CXX})
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) but keep |
Beta Was this translation helpful? Give feedback.
-
This may be tricky because I do not own RPI hardware. I did used 3rd Party sh script to download raspbian.iso and rsync. I can do only run rapsbian on docker. I have tried to ssh into it but I had no experience with docker before back then. PS: Or will it work when doing those symlinks in rootfs ?
Tried that one with no luck. |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Ok this was the actual problem. Yes, it won't work without these symlinks, see this comment #69 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Can you try these commands after setting correct sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/asm "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/gnu "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/bits "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/sys "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/openssl "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crtn.o "$RASPBIAN_ROOTFS"/usr/lib/crtn.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crt1.o "$RASPBIAN_ROOTFS"/usr/lib/crt1.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crti.o "$RASPBIAN_ROOTFS"/usr/lib/crti.o and see if it works? |
Beta Was this translation helpful? Give feedback.
-
Well I did went another way to make those symlinks. Now it started to compile again. /lib/ld-linux-armhf.so.3: No such file or directory
Exiting! |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix ^ |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Seems like your sysroot missing some important Rpi packages. Answer these queries:
Also, Did you tried any other toolchain beside this project? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@abhiTronix Also I did just ls that file. And it shows there with symlinking. ls -l /opt/rootfs/lib/ld*
lrwxrwxrwx 1 root root 30 May 14 2019 /opt/rootfs/lib/ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.28.so
lrwxrwxrwx 1 root root 24 Mar 4 22:48 /opt/rootfs/lib/ld-linux.so.3 -> /lib/ld-linux-armhf.so.3 |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Can you try compiling bare-minimum C++ Program with echo 'int main() { return 0; }' > foo.cpp
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ \
--sysroot=/opt/rootfs/ \
foo.cpp to ensure sysroot is working fine. Also set these environment variables before compiling: PATH=/opt/cross-pi-gcc/bin:$PATH
LD_LIBRARY_PATH=/opt/cross-pi-gcc/lib:$LD_LIBRARY_PATH |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix Just did it and this what happened
|
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Real problem is still hidden. Please, try with verbose parameter and link directories directly as follows: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -I/opt/rootfs/usr/include/arm-linux-gnueabihf foo.cpp -v and paste the complete output here. |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix This is entire output:
Wait what it can't find GLIBC_2.4 ? |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 IMO we are close to solution as /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs -v Thank you for helping in debugging this issue. |
Beta Was this translation helpful? Give feedback.
-
root@720bc2f03c8a:/# /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs foo.cpp -v
Using built-in specs.
COLLECT_GCC=/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../configure --prefix= --target=arm-linux-gnueabihf --enable-languages=c,c++,fortran --with-sysroot=/arm-linux-gnueabihf/libc --with-build-sysroot=/tmp/cross-pi-gcc-10.2.0-1/arm-linux-gnueabihf/libc --with-arch=armv7-a --with-fpu=neon-vfpv4 --with-float=hard --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/cc1plus -quiet -v -iprefix /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/ -isysroot /opt/rootfs -D_GNU_SOURCE foo.cpp -quiet -dumpbase foo.cpp -mfloat-abi=hard -mfpu=neon-vfpv4 -mtls-dialect=gnu -marm -march=armv7-a+neon-vfpv4 -auxbase foo -version -o /tmp/ccxFnr5P.s
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include
/opt/rootfs/usr/local/include
/opt/rootfs/usr/include
End of search list.
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fe3d46b46971cd3b57cc2f549fffafbf
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/as -v -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -meabi=5 -o /tmp/cclKUC93.o /tmp/ccxFnr5P.s
GNU assembler version 2.31 (arm-linux-gnueabihf) using BFD version (GNU Binutils) 2.31
COMPILER_PATH=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../libexec/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../lib/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/:/opt/rootfs/lib/:/opt/rootfs/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/collect2 -plugin /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/liblto_plugin.so -plugin-opt=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cchwMofi.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/opt/rootfs --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi /opt/rootfs/lib/crt1.o /opt/rootfs/lib/crti.o /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtbegin.o -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0 -L/opt/cross-pi-gcc/bin/../lib/gcc -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib -L/opt/rootfs/lib -L/opt/rootfs/usr/lib /tmp/cclKUC93.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtend.o /opt/rootfs/lib/crtn.o
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 again. Sorry for the inconvenience. Can you share how you setup sysroot, I'll try everything locally and share the final result here by tomorrow. OR if possible upload and share sysroot through mega or gdrive. |
Beta Was this translation helpful? Give feedback.
-
I will share the sysroot setup here since uploading entire rootfs could take too long since my upload is not good for such things. Steps I did inside a rpi_rootfs repo:
#!/bin/bash
apt update
apt full-upgrade -y
apt -y install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev \
libasound2-dev libjpeg8-dev libwebp-dev automake libgl1-mesa-glx libjpeg62-turbo libogg0 libopenal1 libvorbis0a \
libvorbisfile3 zlib1g libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libglew-dev libegl1-mesa-dev \
nasm autoconf git cmake zip gcc g++ libtool libxrandr-dev x11proto-randr-dev libgles-dev
./build_rootfs.sh create ./2021-03-04-raspios-buster-armhf-lite.img Note: I did downloaded earlier raspbian os lite version, then I did extracted it.
|
Beta Was this translation helpful? Give feedback.
-
@rafal1137 I made some changes to https://github.com/kclyu/rpi_rootfs sysroot and bare minimum example is seems to be working ok, but the real problem with sysroot within cmake is still as it is. I'll run more test and to find the root cause, will update you when it is ready. IMO, the toolchain itself might need some rework. In the mean time you can try linaro ARM toolchains instead, give them a try. |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 Here are your instructions for cross-compiling with Raspbian Image: https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Cross-Compiler-CMake-Usage-Guide-with-Raspbian-32-bit-Image#cross-compiler-cmake-usage-guide-with-raspbian-32-bit-image Hope this helps, Good luck! |
Beta Was this translation helpful? Give feedback.
-
@rafal1137 I'm opening this new thread for resolving new bugs. |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix I will write in new post here since it gets some issue sorted out. About OpenSSL as workaround I did exported
I have tried to force those with cmake file with no luck so workaround was way to go here. Next one about lua turns out it sets CC in its Makefile I did just commented it out diff --git a/lua/src/Makefile b/lua/src/Makefile
index 30a72a3..e51bff2 100644
--- a/lua/src/Makefile
+++ b/lua/src/Makefile
@@ -6,7 +6,7 @@
# Your platform. See PLATS for possible values.
PLAT= guess
-CC= gcc -std=gnu99
+#CC= gcc -std=gnu99
CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS) Readelf: ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: ARM
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 17776 (bytes into file)
Flags: 0x5000000, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 13
Section header string table index: 12 Here is entire build log It turns out curl need some attention too. checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc
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... configure: error: in `/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/etlegacy/build/downloads/src/curl':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
make[2]: *** [CMakeFiles/bundled_curl.dir/build.make:111: libs/curl/src/bundled_curl-stamp/bundled_curl-configure] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:299: CMakeFiles/bundled_curl.dir/all] Błąd 2
make: *** [Makefile:152: all] Błąd 2
Exiting! |
Beta Was this translation helpful? Give feedback.
-
@abhiTronix
As it can be seen it always complains about ld-linux-armhf.so |
Beta Was this translation helpful? Give feedback.
@rafal1137 Please remove
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
andset(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
lines from your Toolchain Cmake file and try again. Make sure you clean up build directory before trying again.