Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the build by adding missing includes to ndef-decode.cpp. #5

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

travisgoodspeed
Copy link
Contributor

As documented four years ago in #3, G++ fails to build ndef-decode.cpp because of missing header files.

make[2]: Entering directory '/home/travis/svn/libndef/tools'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I../include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o ndef-decode.o ndef-decode.cpp
ndef-decode.cpp: In function ‘void decodeNDEFMessage(QByteArray, int)’:
ndef-decode.cpp:92:44: error: variable ‘QDataStream stream’ has initializer but incomplete type
                         QDataStream stream(record.payload());
                                            ^~~~~~
ndef-decode.cpp:107:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
                     if (output.isOpen())
                     ^~
ndef-decode.cpp:112:17: note: here
                 default:
                 ^~~~~~~

This PR simply adds the missing headers.

diff --git a/tools/ndef-decode.cpp b/tools/ndef-decode.cpp
index 68c0d9a..9235512 100644
--- a/tools/ndef-decode.cpp
+++ b/tools/ndef-decode.cpp
@@ -17,6 +17,10 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>
  */
 
+#include <QTextStream>
+#include <QFile>
+#include <QDataStream>
+
 #include <QtCore/QCoreApplication>
 #include <QDebug>
 #include <QStringList>

I've changed nothing else, so this should be clean to merge.

@travisgoodspeed travisgoodspeed mentioned this pull request Jul 20, 2019
@iceman1001
Copy link

indeed, one year later and not merged :)
Your fix sorts out the error for me, but the warning is still there.
Anyway, this can be merged.

@doegox doegox merged commit e7e9c49 into nfc-tools:master Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants