linking to compile libndef example with gcc

55 views
Skip to first unread message

Alejandro V

unread,
Jul 2, 2014, 7:48:36 PM7/2/14
to nfc-too...@googlegroups.com
Hello All,

[note, I am still learning to write software, use linux, and sometimes even type]

I wasn't sure where to post this, but I am at the end of my wits trying to get a simple NFC exchange to happen between a raspberry pi with the Adafruit PN532 nfc board to happen. 

I have installed all of the libraries, (libnfc, libnfc-llcp, libndef, QtCore (qt4-dev-tools)) but when I try to compile the most basic example "Create & serialize a NDEF message" I get an error linking the "QtCore/qglobal.h" which is included by the ndefmessage.h header file.

Since I imagine everyone here is regularly compiling code with ndefmessage.h (hopefully with gcc), I was hoping that someone could help me understand why the library flags I've put still result in this error?

for reference, I am calling gcc as follows

gcc -lnfc -lndef -lQtCore test.c

where test.c is simply the example code, reproduced below

#include <ndefmessage.h>

// First we create a valid NDEF message object...
NDEFMessage msg;
msg
.appendRecord(NDEFRecord::createUriRecord("http://code.google.com/p/libndef"));
msg
.appendRecord(NDEFRecord::createTextRecord("Hello, world!", "en-US"));

// ...and then we can serialize it and send everywhere.
QByteArray output = msg.toByteArray();

Any help would be greatly appreciated.

regards,

Alejandro
Reply all
Reply to author
Forward
0 new messages