Cross compile mingw 64 bit windows/64 bit linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello again,

After figuring out how aconfigure sets PJ_BLOCKING_CONNECT_ERROR_VAL,
which should be WSAEWOULDBLOCK on Windows, not EINPROGRESS, it looks
like I messed up the --target argument to configure.  I changed that to
--target=x86_64-mingw-windows and it got past the initial error.

Then I hit another one:

In file included
from /home/clamey/src/core_nativeclient/usr/local/include/pj/string.h:29:0,                 from /home/clamey/src/core_nativeclient/usr/local/include/pjsip/sip_transport_tls.h:30,
from /home/clamey/src/core_nativeclient/usr/local/include/pjsip.h:45,
from /home/clamey/src/core_nativeclient/usr/local/include/pjsua-lib/pjsua.h:30,
from src/cpp/voip/rt_voip.cpp:5:
/home/clamey/src/core_nativeclient/usr/local/include/pj/compat/string.h:59:3: error: #error "Implement Unicode string functions"

It looks like _MSC_VER is being used for Windows detection in some cases
rather than PJ_WIN32, but I think that only works with the MSVC
compilers.  As you might have guessed, Windows development is not my
forte, so please feel free to correct me.  From what I can tell,
non-Microsoft Windows compilers, like MinGW, don't define that symbol.

So in my config_site.h, I added this:

#if defined(PJ_WIN32) 
  #define _MSC_VER 1
#endif

Which got me past the compile errors, but I'm pretty sure isn't the
right thing to do.

Past compile problems, I get a runtime assert in sock_bsd.c, line 478:

    PJ_ASSERT_RETURN((unsigned)PJ_INVALID_SOCKET==INVALID_SOCKET,
                     (*sock=PJ_INVALID_SOCKET, PJ_EINVAL));

The runtime expression looks like this:

(unsigned)(-1)==(SOCKET)(~0)

I'm going to keep working on this, but any advice or suggestions would
be certainly appreciated.

Thanks,
topher

On Wed, 2012-01-04 at 13:12 -0700, Topher Lamey wrote:
> Hi all,
> 
> I'm trying to cross compile pjsip on 64bit linux for 64bit windows but
> am hitting a problem.  It looks like maybe it's picking the wrong ioctl,
> but I'm not that familiar with this stuff.  Any advice/pointers would be
> greatly appreciated.
> 
> Here are my build commands:
> 
> #!/bin/sh -x
> CC=x86_64-w64-mingw32-gcc
> CXX=x86_64-w64-mingw32-g++
> MINGWFLAGS="-mwin32 -mconsole"
> CFLAGS="$MINGWFLAGS"
> CXXFLAGS="$MINGWFLAGS"
> make realclean && \
> ./configure CC=$CC CXX=$CXX --target=x86_64-pc-windows --prefix=
> $HOME/src/core_nativeclient/usr/local --host=x86_64-linux
> 
> Attached is the output from configure.  I run 'make dep' ok (output
> attached as well), but then make fails:
> 
> clamey at clamey:~/src/core_nativeclient/pjproject-1.12 (softphone)$ make
> for dir in pjlib/build pjlib-util/build pjnath/build third_party/build
> pjmedia/build pjsip/build pjsip-apps/build ; do \
> 		if make  -C $dir all; then \
> 		    true; \
> 		else \
> 		    exit 1; \
> 		fi; \
> 	done
> make[1]: Entering directory
> `/home/clamey/src/core_nativeclient/pjproject-1.12/pjlib/build'
> make
> -f /home/clamey/src/core_nativeclient/pjproject-1.12/build/rules.mak
> APP=PJLIB app=pjlib ../lib/libpj-x86_64-pc-windows.a
> make[2]: Entering directory
> `/home/clamey/src/core_nativeclient/pjproject-1.12/pjlib/build'
> x86_64-w64-mingw32-gcc -c -Wall -DPJ_AUTOCONF=1 -O2 -DPJ_IS_BIG_ENDIAN=0
> -DPJ_IS_LITTLE_ENDIAN=1    -I../include \
> 		-o output/pjlib-x86_64-pc-windows/ioqueue_select.o \
> 		../src/pj/ioqueue_select.c 
> In file included from ../src/pj/ioqueue_select.c:136:0:
> ../src/pj/ioqueue_common_abs.c: In function ?pj_ioqueue_sendto?:
> ../src/pj/ioqueue_common_abs.c:948:1: warning: label ?retry_on_restart?
> defined but not used
> ../src/pj/ioqueue_common_abs.c: In function ?pj_ioqueue_connect?:
> ../src/pj/ioqueue_common_abs.c:1170:16: error: ?EINPROGRESS? undeclared
> (first use in this function)
> ../src/pj/ioqueue_common_abs.c:1170:16: note: each undeclared identifier
> is reported only once for each function it appears in
> ../src/pj/ioqueue_select.c: In function ?pj_ioqueue_register_sock?:
> ../src/pj/ioqueue_select.c:373:5: warning: implicit declaration of
> function ?ioctl?
> ../src/pj/ioqueue_select.c: In function ?pj_ioqueue_connect?:
> ../src/pj/ioqueue_common_abs.c:1190:1: warning: control reaches end of
> non-void function
> make[2]: *** [output/pjlib-x86_64-pc-windows/ioqueue_select.o] Error 1
> make[2]: Leaving directory
> `/home/clamey/src/core_nativeclient/pjproject-1.12/pjlib/build'
> make[1]: *** [pjlib] Error 2
> make[1]: Leaving directory
> `/home/clamey/src/core_nativeclient/pjproject-1.12/pjlib/build'
> make: *** [all] Error 1
> 
> Thanks,
> topher
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org





[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux