www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - How to build a set of toolchains for cross-compiling for LDC?

reply "Majestio" <majestio ya.ru> writes:
Hi all!

I apologize in advance for my English, I use Google Translator :-\

I became interested in the D programming language recently. I 
want build a comfortable environment for cross-compilation. In my 
Linux Funtoo already has a similar environment for C/C++ based 
http://mxe.cc:

i686-w64-mingw32.shared
i686-w64-mingw32.static
x86_64-w64-mingw32.shared
x86_64-w64-mingw32.static

... and more libs, including Qt 5.4.2 for each toolchain.

So far I have built native LDC, and native "Hello world" is 
compiled and linked successfully.

Actually, the question is how to build step by step for the 
environment LDC for  cross-compile, similar MXE?

Just in case, my directory structure:

/home/majestio/dev/cross/mxe - C/C++ cross-compile env
/home/majestio/dev/cross/llvm - LLVM,Clang,LDC

WBR
Jun 28 2015
parent reply "Kai Nacke" <kai redstar.de> writes:
On Sunday, 28 June 2015 at 14:03:15 UTC, Majestio wrote:
 Hi all!

 I apologize in advance for my English, I use Google Translator 
 :-\

 I became interested in the D programming language recently. I 
 want build a comfortable environment for cross-compilation. In 
 my Linux Funtoo already has a similar environment for C/C++ 
 based http://mxe.cc:

 i686-w64-mingw32.shared
 i686-w64-mingw32.static
 x86_64-w64-mingw32.shared
 x86_64-w64-mingw32.static

 ... and more libs, including Qt 5.4.2 for each toolchain.

 So far I have built native LDC, and native "Hello world" is 
 compiled and linked successfully.

 Actually, the question is how to build step by step for the 
 environment LDC for  cross-compile, similar MXE?

 Just in case, my directory structure:

 /home/majestio/dev/cross/mxe - C/C++ cross-compile env
 /home/majestio/dev/cross/llvm - LLVM,Clang,LDC

 WBR
Hi Majestio! You need to compile LLVM for the targets you want. With USE flag multitarget, LLVM is build for all available targets. Then rebuild LDC with this LLVM. I described cross-compiling for AArch64 here: http://forum.dlang.org/post/fhwvxatxezkafnalwhqr forum.dlang.org Regards, Kai
Jun 28 2015
parent reply "Majestio" <majestio ya.ru> writes:
Hi,Kai!

On Sunday, 28 June 2015 at 18:14:13 UTC, Kai Nacke wrote:
 I described cross-compiling for AArch64 here: 
 http://forum.dlang.org/post/fhwvxatxezkafnalwhqr forum.dlang.org
I did as you wrote. But the problem with linking. I tried to build HelloWorld (with link error): ====================================================================== #!/bin/sh export MXE="/home/majestio/Dev/cross/mxe/usr" export TARGET="i686-w64-mingw32.static" export PATH="$MXE/$TARGET/bin:$MXE/bin:$PATH" $MXE/$TARGET/bin/ldc2 -v \ -mtriple=i686-w32-mingw32.static \ -gcc=i686-w64-mingw32.static-gcc \ -L=-L$MXE/$TARGET/lib \ hello_d.d ====================================================================== Trying to run the linker separately (with link error): ====================================================================== #!/bin/sh export MXE="/home/majestio/Dev/cross/mxe/usr" export TARGET="i686-w64-mingw32.static" export PATH="$MXE/$TARGET/bin:$MXE/bin:$PATH" $MXE/bin/$TARGET-ld -v \ hello_d.obj \ -o hello.exe \ -L$MXE/$TARGET/lib \ -lphobos2-ldc \ -lcurl \ -ldruntime-ldc \ -lws2_32 \ -lshell32 ====================================================================== Output linker: ====================================================================== GNU ld (GNU Binutils) 2.25 hello_d.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x1a): undefined reference to `_D3std5stdio6stdoutS3std5stdio4File' hello_d.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x3a): undefined reference to `__mingw_fprintf' hello_d.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x6c): undefined reference to `_D3std9exception14__T7enforceTbZ7enforceFNaNfbLAxaAyakZb' hello_d.obj:(.text[__D7hello_d16__moduleinfoCtorZ]+0x8): undefined reference to `_Dmodule_ref' hello_d.obj:(.text[__D7hello_d16__moduleinfoCtorZ]+0x13): undefined reference to `_Dmodule_ref' hello_d.obj:(.text[_main]+0x7): undefined reference to `__main' hello_d.obj:(.text[_main]+0x2f): undefined reference to `_d_run_main' hello_d.obj:(.rdata[__D12TypeInfo_xAk6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D12TypeInfo_Axk6__initZ]+0x0): undefined reference to `_D14TypeInfo_Array6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xk6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xk6__initZ]+0x8): undefined reference to `_D10TypeInfo_k6__initZ' hello_d.obj:(.rdata[__D11TypeInfo_ya6__initZ]+0x0): undefined reference to `_D18TypeInfo_Invariant6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_ya6__initZ]+0x8): undefined reference to `_D10TypeInfo_a6__initZ' hello_d.obj:(.rdata[__D12TypeInfo_xAa6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D12TypeInfo_xAa6__initZ]+0x8): undefined reference to `_D12TypeInfo_Axa6__initZ' hello_d.obj:(.rdata[__D11TypeInfo_xb6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xb6__initZ]+0x8): undefined reference to `_D10TypeInfo_b6__initZ' hello_d.obj:(.rdata[__D11TypeInfo_xi6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xi6__initZ]+0x8): undefined reference to `_D10TypeInfo_i6__initZ' hello_d.obj:(.rdata[__D11TypeInfo_xa6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xa6__initZ]+0x8): undefined reference to `_D10TypeInfo_a6__initZ' hello_d.obj:(.rdata[__D11TypeInfo_xh6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D11TypeInfo_xh6__initZ]+0x8): undefined reference to `_D10TypeInfo_h6__initZ' hello_d.obj:(.rdata[__D13TypeInfo_xAya6__initZ]+0x0): undefined reference to `_D14TypeInfo_Const6__vtblZ' hello_d.obj:(.rdata[__D13TypeInfo_xAya6__initZ]+0x8): undefined reference to `_D12TypeInfo_Aya6__initZ' hello_d.obj:(.data[__D7hello_d12__ModuleInfoZ]+0xc): undefined reference to `_D3std5stdio12__ModuleInfoZ' ====================================================================== Inside .obj (i686-w64-mingw32.static-nm hello_d.obj): ====================================================================== 00000000 b .bss 00000000 d .ctors 00000000 d .data 00000000 d .data 00000000 d .data 00000000 i .drectve 00000000 d .eh_frame 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 r .rdata 00000000 t .text 00000000 t .text 00000000 t .text 00000000 t .text 00000000 t .text 00000000 t .text 00000001 a feat.00 U __D10TypeInfo_a6__initZ U __D10TypeInfo_b6__initZ U __D10TypeInfo_h6__initZ U __D10TypeInfo_i6__initZ U __D10TypeInfo_k6__initZ 00000000 R __D11TypeInfo_xa6__initZ 00000000 R __D11TypeInfo_xb6__initZ 00000000 R __D11TypeInfo_xh6__initZ 00000000 R __D11TypeInfo_xi6__initZ 00000000 R __D11TypeInfo_xk6__initZ 00000000 R __D11TypeInfo_ya6__initZ U __D12TypeInfo_Axa6__initZ 00000000 R __D12TypeInfo_Axk6__initZ U __D12TypeInfo_Aya6__initZ 00000000 R __D12TypeInfo_xAa6__initZ 00000000 R __D12TypeInfo_xAk6__initZ 00000000 R __D13TypeInfo_xAya6__initZ U __D14TypeInfo_Array6__vtblZ U __D14TypeInfo_Const6__vtblZ U __D18TypeInfo_Invariant6__vtblZ U __D3std5stdio12__ModuleInfoZ 00000000 T __D3std5stdio16__T7writelnTAyaZ7writelnFAyaZ12__dgliteral3MFNaNbNiNfZAxa 00000000 T __D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv U __D3std5stdio6stdoutS3std5stdio4File U __D3std9exception14__T7enforceTbZ7enforceFNaNfbLAxaAyakZb 00000000 d __D7hello_d11__moduleRefZ 00000000 D __D7hello_d12__ModuleInfoZ 00000000 t __D7hello_d16__moduleinfoCtorZ 00000000 T __Dmain U __Dmodule_ref U ___main U ___mingw_fprintf U __d_run_main 00000000 T _main What can be done?
Jul 14 2015
parent reply "Kai Nacke" <kai redstar.de> writes:
On Tuesday, 14 July 2015 at 12:26:53 UTC, Majestio wrote:
 Hi,Kai!

 On Sunday, 28 June 2015 at 18:14:13 UTC, Kai Nacke wrote:
 I described cross-compiling for AArch64 here: 
 http://forum.dlang.org/post/fhwvxatxezkafnalwhqr forum.dlang.org
I did as you wrote. But the problem with linking.
 What can be done?
Hi Majestio! First, your link command is definitively incomplete. At least libc and libpthread are missing. You are using ld so I miss the crt*.o files, too. I would recommend to use the cross-gcc for linking. Symptons for this are:
 hello_d.obj:(.text[_main]+0x7): undefined reference to `__main'
 hello_d.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x3a):
undefined reference to `__mingw_fprintf'
These are symbols from the MingW C library. BTW: Can you cross-compile a C hello world without problems? Did you compile druntime and phobos for the mingw target? If yes where did you place the libraries? The other missing symbols are from druntime and phobos. This indicates that these libraries are not found. Did you also cross-compile the curl library? You can use the -v command line option with ldc2 to see the call to gcc. This is useful for debugging. Regards, Kai
Jul 14 2015
next sibling parent "Majestio" <majestio ya.ru> writes:
Hi, Kai!

I rebuilt the whole system of cross-compile again, and recorded 
all of his actions step by step. I note, in my opinion, the main 
points.

First part: make from .c source
========================================================
#!/bin/sh

export TARGET="i686-w64-mingw32.static"
export MXE="/home/majestio/Dev/cross/mxe/usr"
export PATH="$MXE/bin:$PATH"

# Step 1
$MXE/bin/$TARGET-gcc -c hello.c

# Step 2
$MXE/bin/$TARGET-gcc hello.o -o hello.exe
------------------------------------------------------------------------------
Result: ok
hello.exe was successfully launched on the Windows host

then ...

Secont part: make from .d source
------------------------------------------------------------------------------
#!/bin/sh

export TARGET="i686-w64-mingw32.static"
export MXE="/home/majestio/Dev/cross/mxe/usr"
export LLVM="/home/majestio/Dev/cross/llvm"
export DLANG="/home/majestio/Dev/cross/dlang/$TARGET"
export PATH="$MXE/bin:$LLVM/bin:$DLANG/bin:$PATH"

# Step 1
$TARGET-ldc2 -c -gcc=$TARGET-gcc -mtriple=$TARGET hello.d

# Step 2
$TARGET-gcc hello.obj \
-L$LLVM/lib \
-L$DLANG/lib \
-lphobos2-ldc \
-lcurl \
-ldruntime-ldc \
-v \
-o hello.exe

# Step debug
echo "Find libraries ..."
find $DLANG -type f | xargs grep -l "D14TypeInfo_Const6"
echo "For comparison with the specified path ..."
echo "$DLANG/lib"
------------------------------------------------------------------------------
Result: only produced .obj file

Output:
------------------------------------------------------------------------------
majestio funtoo ~/Dev/projects/hello-d $ ./hello_d-1.sh
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32.static-gcc
COLLECT_LTO_WRAPPER=/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.static/5.1.0/lto-wrapper
Target: i686-w64-mingw32.static
Configured with: 
/home/majestio/Dev/cross/mxe/tmp-gcc-i686-w64-mingw32.static
gcc-5.1.0/configure --target=i686-w64-mingw32.static
--build=x86_64-pc-linux-gnu --prefix=/home/majestio/Dev/cross/mxe/usr
--libdir=/home/majestio/Dev/cross/mxe/usr/lib --enable-shared=libstdc++
--enable-languages=c,c++,objc,fortran --enable-version-specific-runtime-libs
--with-gcc --with-gnu-ld --with-gnu-as --disable-nls --disable-shared
--disable-multilib --without-x --disable-win32-registry --enable-threads=posix
--disable-libgomp --with-gmp=/home/majestio/Dev/cross/mxe/usr
--with-isl=/home/majestio/Dev/cross/mxe/usr
--with-mpc=/home/majestio/Dev/cross/mxe/usr
--with-mpfr=/home/majestio/Dev/cross/mxe/usr
--with-as=/home/majestio/Dev/cross/mxe/usr/bin/i686-w64-mingw32.static-as
--with-ld=/home/majestio/Dev/cross/mxe/usr/bin/i686-w64-mingw32.static-ld
--with-nm=/home/majestio/Dev/cross/mxe/usr/bin/i686-w64-mingw32.static-nm
Thread model: posix
gcc version 5.1.0 (GCC)
COMPILER_PATH=/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.static/5.1.0/:/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.static/5.1.0/:/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.static/:/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/:/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/:/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w64-mingw32.static/bin/
LIBRARY_PATH=/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/:/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w64-mingw32.static/lib/../lib/:/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w64-mingw32.static/lib/
COLLECT_GCC_OPTIONS='-L/home/majestio/Dev/cross/llvm/lib' 
'-L/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib' 
'-v' '-o' 'hello.exe' '-mtune=generic' '-march=pentiumpro'
  
/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.s
atic/5.1.0/collect2 -plugin
/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.static/5.
.0/liblto_plugin.so -plugin-opt=/home/majestio/Dev/cross/mxe/usr/libexec/gcc/i686-w64-mingw32.stat
c/5.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccbzqvbz.res
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -m i386pe -Bdynamic -o hello.exe
/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w64-mingw32.stat
c/lib/../lib/crt2.o /home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.sta
ic/5.1.0/crtbegin.o -L/home/majestio/Dev/cross/llvm/lib
-L/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib
-L/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0
-L/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w64-mingw
2.static/lib/../lib -L/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/../../../../i686-w6
-mingw32.static/lib hello.obj -lphobos2-ldc -lcurl -ldruntime-ldc -lmingw32
-lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32
-lkernel32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
/home/majestio/Dev/cross/mxe/usr/lib/gcc/i686-w64-mingw32.static/5.1.0/crtend.o
hello.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x1a):
undefined reference to `_D3std5stdio6stdoutS3std5stdio4File'
hello.obj:(.text[__D3std5stdio16__T7writelnTAyaZ7writelnFAyaZv]+0x6c):
undefined reference to
`_D3std9exception14__T7enforceTbZ7enforceFNaNfbLAxaAyakZb'
hello.obj:(.text[__D5hello16__moduleinfoCtorZ]+0x8): undefined 
reference to `_Dmodule_ref'
hello.obj:(.text[__D5hello16__moduleinfoCtorZ]+0x13): undefined 
reference to `_Dmodule_ref'
hello.obj:(.text[_main]+0x2f): undefined reference to 
`_d_run_main'
hello.obj:(.rdata[__D12TypeInfo_xAk6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D12TypeInfo_Axk6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Array6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xk6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xk6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_k6__initZ'
hello.obj:(.rdata[__D11TypeInfo_ya6__initZ]+0x0): undefined 
reference to `_D18TypeInfo_Invariant6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_ya6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_a6__initZ'
hello.obj:(.rdata[__D12TypeInfo_xAa6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D12TypeInfo_xAa6__initZ]+0x8): undefined 
reference to `_D12TypeInfo_Axa6__initZ'
hello.obj:(.rdata[__D11TypeInfo_xb6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xb6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_b6__initZ'
hello.obj:(.rdata[__D11TypeInfo_xi6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xi6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_i6__initZ'
hello.obj:(.rdata[__D11TypeInfo_xa6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xa6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_a6__initZ'
hello.obj:(.rdata[__D11TypeInfo_xh6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D11TypeInfo_xh6__initZ]+0x8): undefined 
reference to `_D10TypeInfo_h6__initZ'
hello.obj:(.rdata[__D13TypeInfo_xAya6__initZ]+0x0): undefined 
reference to `_D14TypeInfo_Const6__vtblZ'
hello.obj:(.rdata[__D13TypeInfo_xAya6__initZ]+0x8): undefined 
reference to `_D12TypeInfo_Aya6__initZ'
hello.obj:(.data[__D5hello12__ModuleInfoZ]+0xc): undefined 
reference to `_D3std5stdio12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
Find libraries ...
/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib/libphobos2-ldc-debug.a
/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib/libdruntime-ldc.a
/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib/libphobos2-ldc.a
/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib/libdruntime-ldc-debug.a
For comparison with the specified path ...
/home/majestio/Dev/cross/dlang/i686-w64-mingw32.static/lib
------------------------------------------------------------------------------

On Tuesday, 14 July 2015 at 16:38:52 UTC, Kai Nacke wrote:
 BTW: Can you cross-compile a C hello world without problems?
Yes.
 Did you compile druntime and phobos for the mingw target? If 
 yes where did you place the libraries?
Yes. When I built the library, I inserted for your advice in ruttime/CMakeLists.txt: set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_C_COMPILER i686-w64-mingw32.static-gcc) set(CMAKE_CXX_COMPILER i686-w64-mingw32.static-g++)
 The other missing symbols are from druntime and phobos. This 
 indicates that these libraries are not found. Did you also 
 cross-compile the curl library?
Curl is present.
 You can use the -v command line option with ldc2 to see the 
 call to gcc. This is useful for debugging.
I used it. ... In general, do not grow coconuts :(( Regards, Majestio
Jul 17 2015
prev sibling parent reply "Majestio" <majestio ya.ru> writes:
Just in case the attached file: https//yadi.sk/d/bdD44pMYhvEG8
Jul 17 2015
parent "Kai Nacke" <kai redstar.de> writes:
On Friday, 17 July 2015 at 07:54:03 UTC, Majestio wrote:
 Just in case the attached file: https//yadi.sk/d/bdD44pMYhvEG8
Hi Majestio! The files were helpful. You need to add -mtriple=i686-w64-mingw32.static to D_FLAGS variable in runtime/CMakeLists.txt and recompile the libraries. What happened is that the object files in the library are ELF-64 (compiled for x86-64 Linux) but hello.o is 80386 COFF. Therefore the unresolved references. What I miss is the error message from the linker, complaining about the architecture mismatch... Regards, Kai
Jul 19 2015