marcus905 / libnfc

Automatically exported from code.google.com/p/libnfc
GNU Lesser General Public License v3.0
0 stars 0 forks source link

mingw-cross-configure.sh not working #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Cross compiling for windows with the SVN's script mingw-cross-configure.sh does 
not work for two reasons:
1. `--with-drivers` is started with (now) unknown drivers. changing it to 
`--with-drivers=all` fixes this problem
2. `winscard.h` is missing for mingw32. copying `winscard.h` from mingw-w64 
results in compilation errors...

Original issue reported on code.google.com by frankmor...@googlemail.com on 8 Apr 2012 at 12:36

GoogleCodeExporter commented 9 years ago
I fixed mingw-cross-configure.sh. However, there are still some linker errors 
that i cannot resolve (see attached files).

Original comment by frankmor...@googlemail.com on 10 Apr 2012 at 6:16

Attachments:

GoogleCodeExporter commented 9 years ago
I fixed my previous patch. Libnfc now builds with pure MinGW-w64. Executables 
cannot be currently built however. Limitations are documented in 
mingw-cross-configure.sh.

Note that my patch also fixes some compiler warnings.

Original comment by frankmor...@googlemail.com on 13 Apr 2012 at 10:46

Attachments:

GoogleCodeExporter commented 9 years ago
In r484dd5dfa513ef1bc948ef90d441a99c6197e252, the mingw script have been 
updated following your provided patch, thank you Frank for this patch!

Nevertheless, I did not push the "#ifdef _WIN32" introduction, since it can be 
done cleanly using the generated config.h instead of add theses lines to many 
files.
Additionnally, we can't add e#define nfc_EXPORTSe directly in all files since 
it will cause trouble to CMake users when they will want to compile against 
libnfc.

I suggest add this "#define nfc_EXPORTS" at config.h too, as you already done 
in the mingw script.

Many thanks for your efforts, I hope you will be able to cross compile using 
this script one day :)

Please note that current version can not be built under Windows: see Issue 215.

Original comment by romu...@libnfc.org on 5 Dec 2012 at 5:37

GoogleCodeExporter commented 9 years ago
Hi everyone, I attempted to build git commit 
0203ade66c4168cbb7bf835e2c35b3d35e86d84a (latest) with 
'mingw-cross-configure.sh' on Windows. Configure ends without any error. But 
with 'make' I am getting the following error.

----
make  all-recursive
make[1]: Entering directory `/c/Users/Babil/Desktop/libnfc'
Making all in libnfc
make[2]: Entering directory `/c/Users/Babil/Desktop/libnfc/libnfc'
Making all in chips
make[3]: Entering directory `/c/Users/Babil/Desktop/libnfc/libnfc/chips'
  CC     libnfcchips_la-pn53x.lo
In file included from pn53x.c:37:0:
../../libnfc/nfc-internal.h:30:17: fatal error: err.h: No such file or directory
compilation terminated.
make[3]: *** [libnfcchips_la-pn53x.lo] Error 1
make[3]: Leaving directory `/c/Users/Babil/Desktop/libnfc/libnfc/chips'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/c/Users/Babil/Desktop/libnfc/libnfc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/Users/Babil/Desktop/libnfc'
make: *** [all] Error 2
----

I wrapped around 'err.h' with 'ifndef _WIN32' but it gives me more error in 
winscard_clnt.c. Please have a look.

Original comment by gsbabil on 10 Feb 2013 at 6:26

GoogleCodeExporter commented 9 years ago
> I wrapped around 'err.h' with 'ifndef _WIN32' but it gives me more error in 
winscard_clnt.c. Please have a look.

Where do you get the file winscard_clnt.c from libnfc?

Original comment by ludovic....@gmail.com on 10 Feb 2013 at 9:28

GoogleCodeExporter commented 9 years ago
You may want to have a look at this patch
http://vsmartcard.git.sourceforge.net/git/gitweb.cgi?p=vsmartcard/vsmartcard;a=b
lob_plain;f=pcsc-relay/win32/libnfc_mingw.patch
although I haven't tested it for a while

I used mingw-w64 for cross compiling, which provides -lwinscard

Original comment by frankmor...@googlemail.com on 10 Feb 2013 at 10:32