libnfcを正常にコンパイルしましたが、例はすべて機能しています。今、私はそれらの例の1つを自分でコンパイルして、その方法を見つけようとしています。
コンパイルしたいファイルは、libnfcselfとは別のフォルダーにあります。コンパイルすると、次のエラー(および警告)が表示されます。
C:\thesis\libnfc\dev>gcc -m32 test.c -o test -L"C:\thesis\libnfc\libnfc-build\libnfc" -lnfc
In file included from test.c:48:0:
utils/nfc-utils.h:97:14: warning: 'str_nfc_baud_rate' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
C:\Users\xxxx\AppData\Local\Temp\cc2LqPG1.o:test.c:(.text+0x2e): undefined reference to `print_hex_bits'
C:\Users\xxxx\AppData\Local\Temp\cc2LqPG1.o:test.c:(.text+0xaf): undefined reference to `print_hex_bits'
C:\Users\xxxx\AppData\Local\Temp\cc2LqPG1.o:test.c:(.text+0xe8): undefined reference to `print_hex'
C:\Users\xxxx\AppData\Local\Temp\cc2LqPG1.o:test.c:(.text+0x15a): undefined reference to `print_hex'
C:\Users\xxxx\AppData\Local\Temp\cc2LqPG1.o:test.c:(.text+0xa87): undefined reference to `print_hex'
collect2.exe: error: ld returned 1 exit status
これらの関数はnfc-utilsで定義されています。これらもdllにコンパイルされていると思いますか?nfc-utils.cと.hの内容のutilsフォルダーを同じフォルダーに配置しましたが、これも役に立ちません。
test.cファイルの内容はnfc-anticol.cファイルと同じです。
助言がありますか?