title: libnfc build issue on windows 7 64 bit while executing 'mingw32-make' command
body: <p>While trying to build libnfc-1.6.0-rc1 on 64 bit Windows 7 OS, I am getting undefined reference errors. </p>
  
  <p>I am using below dependencies:</p>
  
  <ol>
  <li>Windows 7 64 bit</li>
  <li>libusb-win32-bin-1.2.6.0</li>
  <li>cmake-2.8.10.2-win32-x86</li>
  <li>tdm64-gcc-4.7.1-3</li>
  </ol>
  
  <p>After successfully generating output from <code>cmake-gui</code> command, I get following errors while executing <code>mingw32-make VERBOSE=1</code> command:</p>
  
  <pre><code>D:\libNFC\libnfc-build 1&gt;mingw32-make VERBOSE=1
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -H"D:\libNFC\libnfc-1.6.0-rc1" -B"D:\libNFC\libnfc-build 1" --check-build-system CMakeFiles\Makefile.cmake 0
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_start "D:\libNFC\libnfc-build 1\CMakeFiles" "D:\libNFC\libnfc-build 1\CMakeFiles\progress.marks"
  mingw32-make -f CMakeFiles\Makefile2 all
  mingw32-make[1]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/depend
  mingw32-make[2]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_depends "MinGW Makefiles" "D:\libNFC\libnfc-1.6.0-rc1" "D:\libNFC\libnfc-1.6.0-rc1\libnfc" "D:\libNFC\libnfc-build 1" "D:\libNFC\libnfc-build 1\libnfc" "D:\libNFC\libnfc-build 1\libnfc\CMakeFiles\nfc.dir\DependInfo.cmake" --color=Dependee "D:\libNFC\libnfc-build 1\libnfc\CMakeFiles\nfc.dir\DependInfo.cmake" is newer than depender "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/nfc.dir/depend.internal".
  Dependee "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "D:/Software development/nfc/libnfc.org/libnfc-build 1/libnfc/CMakeFiles/nfc.dir/depend.internal".
  Scanning dependencies of target nfc
  mingw32-make[2]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  mingw32-make -f libnfc\CMakeFiles\nfc.dir\build.make libnfc/CMakeFiles/nfc.dir/build
  mingw32-make[2]: Entering directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 1
  [  3%] Building C object libnfc/CMakeFiles/nfc.dir/nfc.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc.c.obj
    -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\nfc.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 2
  [  6%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-device.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-device.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\nfc-device.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 3
  [ 10%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-emulation.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-emulation.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\nfc-emulation.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 4
  [ 13%] Building C object libnfc/CMakeFiles/nfc.dir/nfc-internal.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\nfc-internal.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\nfc-internal.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 5
  [ 16%] Building C object libnfc/CMakeFiles/nfc.dir/iso14443-subr.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\iso14443-subr.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\iso14443-subr.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 6
  [ 20%] Building C object libnfc/CMakeFiles/nfc.dir/mirror-subr.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\mirror-subr.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\mirror-subr.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 7
  [ 23%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/acr122.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\acr122.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\drivers\acr122.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 8
  [ 26%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/pn53x_usb.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\pn53x_usb.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\drivers\pn53x_usb.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 9
  [ 30%] Building C object libnfc/CMakeFiles/nfc.dir/drivers/arygon.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\drivers\arygon.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\drivers\arygon.c"
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 10
  [ 33%] Building C object libnfc/CMakeFiles/nfc.dir/buses/uart.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\buses\uart.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart.c"
  In file included from D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart.c:41:0:
  D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c: In function 'uart_receive':
  D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:159:87: warning: ISO C99 requires rest arguments to be used [enabled by default]
  D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:168:58: warning: ISO C99 requires rest arguments to be used [enabled by default]
  In file included from D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/contrib/windows.h:31:0,
                   from D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/config.h:1,
                   from D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart.c:27:
  D:/Software development/nfc/libnfc.org/libnfc-1.6.0-rc1/contrib/win32/err.h:17:13: warning: unused variable 'errx' [-Wunused-variable]
  In file included from D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart.c:41:0:
  D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c: In function 'uart_send':
  D:\libNFC\libnfc-1.6.0-rc1\libnfc\buses\uart_win32.c:209:87: warning: ISO C99 requires rest arguments to be used [enabled by default]
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report "D:\libNFC\libnfc-build 1\CMakeFiles" 11
  [ 36%] Building C object libnfc/CMakeFiles/nfc.dir/chips/pn53x.c.obj
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; c:\MinGW64\bin\gcc.exe  -DDRIVER_ACR122_ENABLED -DDRIVER_ARYGON_ENABLED -DDRIVER_PN53X_USB_ENABLED -DHAVE_CONFIG_H -Dnfc_EXPORTS -Du_int16_t=uint16_t -Du_int8_t=uint8_t @CMakeFiles/nfc.dir/includes_C.rsp   -Wall -pedantic -std=c99 -m32 -o CMakeFiles\nfc.dir\chips\pn53x.c.obj   -c "D:\libNFC\libnfc-1.6.0-rc1\libnfc\chips\pn53x.c"
  Linking C shared library libnfc.dll
  cd /d D:\SOFTWA~1\nfc\libnfc.org\LIBNFC~2\libnfc &amp;&amp; "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script CMakeFiles\nfc.dir\link.txt --verbose=1
  "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\nfc.dir/objects.a
  c:\MinGW64\bin\ar.exe cr CMakeFiles\nfc.dir/objects.a @CMakeFiles\nfc.dir\objects1.rsp
  c:\MinGW64\bin\gcc.exe   -m32 -shared -o libnfc.dll -Wl,--out-implib,libnfc.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\nfc.dir/objects.a -Wl,--no-whole-archive c:\MinGW64\x86_64-w64-mingw32\lib32\libwinscard.a "D:\Software development\usb\libusb\libusb-win32-bin-1.2.6.0\lib\msvc_x64\libusb.lib" -lwsock32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
  CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x31): undefined reference to `usb_bulk_read'
  CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x72): undefined reference to `usb_bulk_write'
  :::
  CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj):pn53x_usb.c:(.text+0x9f2): undefined reference to `usb_close'
  c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\nfc.dir/objects.a(pn53x_usb.c.obj): bad relocaddress 0x4c in section `.rdata'
  collect2.exe: error: ld returned 1 exit status
  mingw32-make[2]: *** [libnfc/libnfc.dll] Error 1
  mingw32-make[2]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  mingw32-make[1]: *** [libnfc/CMakeFiles/nfc.dir/all] Error 2
  mingw32-make[1]: Leaving directory `D:/Software development/nfc/libnfc.org/libnfc-build 1'
  mingw32-make: *** [all] Error 2
  </code></pre>
  
  <p>What could be the problem? Can anyone assist. I am new to NFC development and your timely assistance will be very helpful.</p>