I am migrating a huge project from Qt 4.x to 5, I am almost finished but Im having errors that I cannot locate, I think it has to do with the linkage of some libraries but I am somewhat lost here. I hope someone can throw some light on this matter.
Errors:
./release\addeditaton.o:addeditaton.cpp:(.text+0x6ac2): undefined reference to `_imp___ZN10HTTPClient5abortEv'
./release\addeditaton.o:addeditaton.cpp:(.text+0x98c5): undefined reference to `_imp___ZN10HTTPClient3getE7QStringbb'
./release\addeditaton.o:addeditaton.cpp:(.text+0x9f88): undefined reference to `_imp___ZN10HTTPClient3getE7QStringbb'
./release\addeditaton.o:addeditaton.cpp:(.text+0xa7a8): undefined reference to `_imp___ZN10HTTPClient3getE7QStringbb'
./release\addeditaton.o:addeditaton.cpp:(.text+0xa921): undefined reference to `_imp___ZN10RestClientC2E7QStringibS0_S0_S0_S0_'
./release\addeditaton.o:addeditaton.cpp:(.text+0xc91b): undefined reference to `_imp___ZN10HTTPClient3getE7QStringbb'
./release\addeditaton.o:addeditaton.cpp:(.text+0xcaa3): undefined reference to `_imp___ZN10RestClientC2E7QStringibS0_S0_S0_S0_'
./release\addeditaton.o:addeditaton.cpp:(.text+0xe49d): undefined reference to `_imp___ZN10HTTPClient4postE7QStringS0_b'
./release\addeditaton.o:addeditaton.cpp:(.text+0xfc55): undefined reference to `_imp___ZN10HTTPClient4postE7QStringS0_b'
Makefile.Release:922: recipe for target '..\Release\Swibz.exe' failed
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: ./release\addeditaton.o: bad reloc address 0x20 in section `.text$_ZN10QByteArrayD1Ev[__ZN10QByteArrayD1Ev]'
Project file:
# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------
TEMPLATE = app
TARGET = Swibz
include(Swibz.pri)
DESTDIR = ../Release
QT += widgets network xml webkit webkitwidgets opengl #core gui are by default
CONFIG += release
DEFINES += _WINDOWS QT_LARGEFILE_SUPPORT QT_XML_LIB QT_OPENGL_LIB QT_NETWORK_LIB QT_DLL QWT_DLL JSON_LIB_LIB
INCLUDEPATH += ../../../SprintLib \
./GeneratedFiles \
./GeneratedFiles/Release \
. \
#./../../Qwt/qwt-5.2.0/src \
../qwt/src \
#../../../QENC/QENC \
../qenc \
# ../../../zlib-1.2.5 \
../zlib-1.2.5 \
#../../../serial/qextserialport-1.2win-alpha \
../qextserialport-1.2win-alpha \
# ../../../qxmpp-0.3.0/src \
../qxmpp/build-qxmpp-Qt_4_8_5-Debug/src \
#../../../JSON \
../json/JSON \
# ../../../QtSerialPort/qtserialport/include
../QtSerialPort/qtserialport/include
LIBS += -L"../../../SprintLib/release" \
-L"../../../QENC/release" \
-L"../../../zlib-1.2.5/contrib/vstudio/vc9/x86/ZlibDllRelease" \
-L"../../../serial/qextserialport-1.2win-alpha/Release" \
-L"../../../qxmpp-0.3.0/lib" \
-L"../../../JSON/Release" \
-L"../../../QtSerialPort/qtserialport/src/serialport/release" \
-lopengl32 \
-lglu32 \
-lgdi32 \
-luser32 \
#-lHDP \
-L"./libHDP.a" \
#-l../../Qwt/qwt-5.2.0/lib/debug/qwt5 \
#-lqenc \
#-lzlibwapi \
-L"./zlib1.dll" \
#-lqextserialport \
-lsetupapi \
#-lqxmpp \
-L"./libqxmpp.a" \
#-ljson_lib \
#-lSerialPort1
-L"./libqextserialportd.a" \
#DEPENDPATH += .
#MOC_DIR += ./GeneratedFiles/release
#OBJECTS_DIR += release
#UI_DIR += ./GeneratedFiles
#eRCC_DIR += ./GeneratedFiles
#win32:RC_FILE = Swibz.rc
TRANSLATIONS = ln_en.ts
TRANSLATIONS = ln_lv.ts
TRANSLATIONS = ln_lt.ts
TRANSLATIONS = ln_es.ts
CODECFORTR = UTF-8
Includes of addeditaton.cpp (if the rest of the code is needed please tell, they are 930 lines and I dont think they are relevant to the issue(
#include "addeditaton.h"
#include "atonwidget.h"
#include "atoninfowidget.h"
#include "messagebox.h"
#include <QtDebug>
#include <QFileDialog>
./release\addeditaton.o:addeditaton.cpp:(.text+0x6ac2): undefined reference to `_imp___ZN10HTTPClient5abortEv'
Lines like that usually means at least either of the following issues:
You do not have the corresponding library installed.
You do not have the correct version installed with the symbols you rely on.
Your linkage options are not set up properly.
In this case, the complain is about the http client library, so let us check your project file first. You are using the -L and -l options correctly in the beginning, but not in the end, so let us clarify what they mean:
-L means the path to the library.
-l either means the library name or absolute path to the library.
Now, let us see what you write at the end where the issue is:
-L"./libHDP.a" \
#-l../../Qwt/qwt-5.2.0/lib/debug/qwt5 \
#-lqenc \
#-lzlibwapi \
-L"./zlib1.dll" \
#-lqextserialport \
-lsetupapi \
#-lqxmpp \
-L"./libqxmpp.a" \
#-ljson_lib \
#-lSerialPort1
-L"./libqextserialportd.a" \
Therefore, you should replace this with the following:
-lHDP
#-l../../Qwt/qwt-5.2.0/lib/debug/qwt5 \
#-lqenc \
#-lzlibwapi \
-lzlib1 \
#-lqextserialport \
-lsetupapi \
#-lqxmpp \
-lqxmpp.a \
#-ljson_lib \
#-lSerialPort1 \
-lqextserialportd
Alternatively, you could also specify the absolute path to the static libraries with the -l option as mentioned above.
Note that you should not mix up things like QtSerialPort and QextSerialPort in your project, however. It is better to use QtSerialPort.
You are using the -L option for the following libraries:
-L"./libHDP.a" \
-L"./zlib1.dll" \
-L"./libqxmpp.a" \
-L"./libqextserialportd.a" \
-L specifies a directory to search for libraries. Use the -l (lowercase) to specify a library. You may want to add a colon before the libarary name if you wnat to specify the exact name. For example,
-l :./libHDP.a \
-l :./zlib1.dll \
-l :./libqxmpp.a \
-l :./libqextserialportd.a \
See https://sourceware.org/binutils/docs/ld/Options.html#Options for details.
Related
I am trying to install headers of my library using QMake. These headers gave a hierarchical order that must be applied on installation target as well. My current solution for this is to add many targets (each for one subdirectory):
...
headers.path = /usr/include/foo/widgets
headers_base.path = /usr/include/foo/widgets
headers_data.path = /usr/include/foo/widgets/data
headers_editors.path = /usr/include/foo/widgets/editors
...
HEADERS_BASE += \
foo.hpp \
bar.hpp
HEADERS_DATA += \
data/foo.hpp \
data/bar.hpp
HEADERS_EDITORS += \
editors/foo.hpp \
editors/bar.hpp
...
HEADERS += $$HEADERS_BASE \
$$HEADERS_DATA \
$$HEADERS_EDITORS
This is tedius and error-prune. I would like to use something simple and straightforward like nobase in autotools. Something like this:
magic_HEADERS += \
foo.hpp \
bar.hpp
data/foo.hpp \
data/bar.hpp
editors/foo.hpp \
editors/bar.hpp
Note
Having
HEADERS += \
foo.hpp \
bar.hpp
data/foo.hpp \
data/bar.hpp
editors/foo.hpp \
editors/bar.hpp
Installs all headers in a single directory.
Headers will be installed if you change .pro file with example:
HEADERS += \
include/widgets/foo.hpp \
include/widgets/bar.hpp \
include/widgets/data/foo.hpp \
include/widgets/data/bar.hpp \
include/widgets/editors/foo.hpp \
include/widgets/editors/bar.hpp
unix {
headers.path = /usr/local/include
headers.files = $$PWD/include/*
target.path = /usr/local/lib
INSTALLS += target headers
}
I'm working with an Haptic Device (" Phantom Omni"), and i'm creating a GUI, this gui has some headers and source files from the haptic device. I've already included them, but I have also include the libraries. I've tried all the several ways that I found on internet, but when I try to build the project it returns me error about LNK 2019 and LNK 2001.
I've checked also the Makefile that the qMake generates, and into this file there are the paths and libraries that i would to add, but I don't know why, I have always the some error.
The .pro file:
#LIBS += -L"C:\\Folder\\Folder2\\LibFolder" -lextlib.lib
QT += core gui
CONFIG += console
QT += gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = GUI_TeleManipulation
TEMPLATE = app
SOURCES += main.cpp\
gui_telemanipulation.cpp \
debug/moc_gui_telemanipulation.cpp \
src/Client.cpp \
src/PHANToM.cpp \
src/HDU/src/hdu.cpp \
src/HDU/src/hduAfx.cpp \
src/HDU/src/hduDecompose.cpp \
src/HDU/src/hduError.cpp \
src/HDU/src/hduHapticDevice.cpp \
src/HDU/src/hduLine.cpp \
src/HDU/src/hduLineSegment.cpp \
src/HDU/src/hduMatrix.cpp \
src/HDU/src/hduPlane.cpp \
src/HDU/src/hduQuaternion.cpp \
src/HDU/src/hduRecord.cpp \
src/hd.cpp
HEADERS += gui_telemanipulation.h \
ui_gui_telemanipulation.h \
include/Client.hpp \
include/matrix.h \
include/Packet.hpp \
include/PHANToM.h \
include/HD/hd.h \
include/HD/hdCompilerConfig.h \
include/HD/hdDefines.h \
include/HD/hdDevice.h \
include/HD/hdExport.h \
include/HD/hdScheduler.h \
include/HDU/hdu.h \
include/HDU/hduBoundBox.h \
include/HDU/hduError.h \
include/HDU/hduGenericMatrix.h \
include/HDU/hduHapticDevice.h \
include/HDU/hduLine.h \
include/HDU/hduLineSegment.h \
include/HDU/hduMath.h \
include/HDU/hduMatrix.h \
include/HDU/hduPlane.h \
include/HDU/hduQuaternion.h \
include/HDU/hduRecord.h \
include/HDU/hduVector.h \
src/HDU/src/hduAfx.h \
src/HDU/src/hduDecompose.h
FORMS += gui_telemanipulation.ui
#LIBS += -L"C:\\Folder\\Folder2\\LibFolder" -lextlib.lib
LIBS += -L"lib/" -lhd
LIBS += -L"lib/" -lhdu
With static libraries, you should be able to use simply this:
LIBS += "C:/Folder/Folder2/LibFolder/extlib.lib"
This is assuming you are doing Windows-only project. Read the docs for more.
I am trying to write a softphone using qt. And many forums and resources, including stackoverflow, suggest to use pjsip libraries. So I decided to follow this advice and use it.
First, to be clear about my post here, my OS is linux (KUbuntu to be percise), and I am using Qt 5.4.1 and Qt Creator 3.3.2.
Also, I built pjsip static libraries using instructions on their website here: http://trac.pjsip.org/repos/wiki/Getting-Started/Autoconf.
And I have some troubles linking pjsip static libraries using qt. I've searched about this problem and didn't find the answer neither on this site nor anywhere. There are some topics on the forums but no one gives an answer to it.
Here is my qt .pro file:
TEMPLATE = app
QT += qml quick widgets
SOURCES += main.cpp
RESOURCES += qml.qrc
INCLUDEPATH += $$_PRO_FILE_PWD_/pjsip_headers
LIBS += -L$$_PRO_FILE_PWD_/pjsip_libs
linux-g++-64:LIBS += -lpjsua-x86_64-unknown-linux.gnu \
-lpjsip-ua-x86_64-unknown-linux.gnu\
-lpjsip-simple-x86_64-unknown-linux.gnu \
-lpjsip-x86_64-unknown-linux.gnu \
-lpjmedia-codec-x86_64-unknown-linux.gnu \
-lpjmedia-x86_64-unknown-linux.gnu \
-lpjmedia-codec-x86_64-unknown-linux.gnu \
-lpjmedia-audiodev-x86_64-unknown-linux.gnu \
-lpjmedia-videodev-x86_64-unknown-linux.gnu \
-lpjnath-x86_64-unknown-linux.gnu \
-lpjlib-util-x86_64-unknown-linux.gnu \
-lpj-x86_64-unknown-linux.gnu \
-lportaudio-x86_64-unknown-linux.gnu \
-lgsmcodec-x86_64-unknown-linux.gnu \
-lilbccodec-x86_64-unknown-linux.gnu \
-lspeex-x86_64-unknown-linux.gnu \
-lresample-x86_64-unknown-linux.gnu \
-lsrtp-x86_64-unknown-linux.gnu \
-lg7221codec-x86_64-unknown-linux.gnu \
-lopenh264 \
-lpjsua2-x86_64-unknown-linux.gnu
QML_IMPORT_PATH =
include(deployment.pri)
And here is the problem: when I try to build my project with this .pro file above, everything is OK until i try to use some function or an object of any class in this library. And if I do so, I get many undefined reference errors.
Pjsip manual says only about how to build your own application with this library by using GNU tools here: http://trac.pjsip.org/repos/wiki/Getting_Started_Using. But it involves editing Makefile, which is autogenerated by qmake in qt.
I just stuck with this problem and I don't know what else I can do about it. I read about linking order of this library while including it in your qt .pro file, but I tried many combinations and it didn't help.
Also, I read that it might be necessary to use QMAKE variables to set CFLAGS and LDFLAGS in qt .pro file according to pjsip instructions of how to build your own application using GNU tools.
And I even downloaded qt projects, which use pjsip libraries, for example, QjSimple, but I didn't find anything new in their qt .pro file settings.
Here is their qt .pro file:
DEFINES -= UNICODE
TEMPLATE = app
TARGET = QjSimple
QT += core \
gui \
xml \
network
HEADERS += buddy.h \
PjCallback.h \
accountdialog.h \
debugdialog.h \
addbuddydialog.h \
imwidget.h \
qjsimple.h
SOURCES += buddy.cpp \
PjCallback.cpp \
accountdialog.cpp \
debugdialog.cpp \
addbuddydialog.cpp \
imwidget.cpp \
main.cpp \
qjsimple.cpp
FORMS += accountdialog.ui \
debugdialog.ui \
addbuddydialog.ui \
imwidget.ui \
qjsimple.ui
RESOURCES += icons.qrc
win32-g++:RC_FILE = appicon.rc
INCLUDEPATH += ../pjproject-1.8.10/pjlib/include \
../pjproject-1.8.10/pjlib-util/include \
../pjproject-1.8.10/pjnath/include \
../pjproject-1.8.10/pjmedia/include \
../pjproject-1.8.10/pjsip/include
LIBS += -L../pjproject-1.8.10/pjlib/lib \
-L../pjproject-1.8.10/pjlib-util/lib \
-L../pjproject-1.8.10/pjnath/lib \
-L../pjproject-1.8.10/pjmedia/lib \
-L../pjproject-1.8.10/pjsip/lib \
-L../pjproject-1.8.10/third_party/lib
# INCLUDEPATH += ../pjproject-1.5.5/pjlib/include \
# ../pjproject-1.5.5/pjlib-util/include \
# ../pjproject-1.5.5/pjnath/include \
# ../pjproject-1.5.5/pjmedia/include \
# ../pjproject-1.5.5/pjsip/include
# LIBS += -L../pjproject-1.5.5/pjlib/lib \
# -L../pjproject-1.5.5/pjlib-util/lib \
# -L../pjproject-1.5.5/pjnath/lib \
# -L../pjproject-1.5.5/pjmedia/lib \
# -L../pjproject-1.5.5/pjsip/lib \
# -L../pjproject-1.5.5/third_party/lib
# INCLUDEPATH += ../pjproject-1.4/pjlib/include \
# ../pjproject-1.4/pjlib-util/include \
# ../pjproject-1.4/pjnath/include \
# ../pjproject-1.4/pjmedia/include \
# ../pjproject-1.4/pjsip/include
# LIBS += -L../pjproject-1.4/pjlib/lib \
# -L../pjproject-1.4/pjlib-util/lib \
# -L../pjproject-1.4/pjnath/lib \
# -L../pjproject-1.4/pjmedia/lib \
# -L../pjproject-1.4/pjsip/lib \
# -L../pjproject-1.4/third_party/lib
# win32-g++:LIBS += -L../openssl-0.9.8g
win32-g++:LIBS += -L../OpenSSL/lib/mingw
win32-g++:LIBS += -lpjsua-i686-pc-mingw32 \
-lpjsip-ua-i686-pc-mingw32 \
-lpjsip-simple-i686-pc-mingw32 \
-lpjsip-i686-pc-mingw32 \
-lpjmedia-codec-i686-pc-mingw32 \
-lpjmedia-i686-pc-mingw32 \
-lpjmedia-codec-i686-pc-mingw32 \
-lpjmedia-audiodev-i686-pc-mingw32 \
-lpjnath-i686-pc-mingw32 \
-lpjlib-util-i686-pc-mingw32 \
-lpj-i686-pc-mingw32 \
-lportaudio-i686-pc-mingw32 \
-lgsmcodec-i686-pc-mingw32 \
-lilbccodec-i686-pc-mingw32 \
-lspeex-i686-pc-mingw32 \
-lresample-i686-pc-mingw32 \
-lmilenage-i686-pc-mingw32 \
-lsrtp-i686-pc-mingw32 \
-lm \
-lwinmm \
-lole32 \
-lws2_32 \
-lwsock32 \
-lssl \
-lcrypto \
-lgdi32
linux-g++:LIBS += -lpjsua-i686-pc-linux-gnu \
-lpjsip-ua-i686-pc-linux-gnu \
-lpjsip-simple-i686-pc-linux-gnu \
-lpjsip-i686-pc-linux-gnu \
-lpjmedia-codec-i686-pc-linux-gnu \
-lpjmedia-i686-pc-linux-gnu \
-lpjmedia-codec-i686-pc-linux-gnu \
-lpjmedia-audiodev-i686-pc-linux-gnu \
-lpjnath-i686-pc-linux-gnu \
-lpjlib-util-i686-pc-linux-gnu \
-lpj-i686-pc-linux-gnu \
-lportaudio-i686-pc-linux-gnu \
-lgsmcodec-i686-pc-linux-gnu \
-lilbccodec-i686-pc-linux-gnu \
-lspeex-i686-pc-linux-gnu \
-lresample-i686-pc-linux-gnu \
-lmilenage-i686-pc-linux-gnu \
-lsrtp-i686-pc-linux-gnu \
-lm \
-lpthread \
-lssl \
-lasound \
-luuid
linux-g++-64:LIBS += -lpjsua-x86_64-unknown-linux-gnu \
-lpjsip-ua-x86_64-unknown-linux-gnu \
-lpjsip-simple-x86_64-unknown-linux-gnu \
-lpjsip-x86_64-unknown-linux-gnu \
-lpjmedia-codec-x86_64-unknown-linux-gnu \
-lpjmedia-x86_64-unknown-linux-gnu \
-lpjmedia-codec-x86_64-unknown-linux-gnu \
-lpjmedia-audiodev-x86_64-unknown-linux-gnu \
-lpjnath-x86_64-unknown-linux-gnu \
-lpjlib-util-x86_64-unknown-linux-gnu \
-lpj-x86_64-unknown-linux-gnu \
-lportaudio-x86_64-unknown-linux-gnu \
-lgsmcodec-x86_64-unknown-linux-gnu \
-lilbccodec-x86_64-unknown-linux-gnu \
-lspeex-x86_64-unknown-linux-gnu \
-lresample-x86_64-unknown-linux-gnu \
-lmilenage-x86_64-unknown-linux-gnu \
-lsrtp-x86_64-unknown-linux-gnu \
-lm \
-lpthread \
-lssl \
-lasound \
-luuid
macx-g++:LIBS += -lpjsua-i386-apple-darwin9.7.1 \
-lpjsip-ua-i386-apple-darwin9.7.1 \
-lpjsip-simple-i386-apple-darwin9.7.1 \
-lpjsip-i386-apple-darwin9.7.1 \
-lpjmedia-i386-apple-darwin9.7.1 \
-lpjmedia-i386-apple-darwin9.7.1 \
-lpjmedia-codec-i386-apple-darwin9.7.1 \
-lpjmedia-audiodev-i386-apple-darwin9.7.1 \
-lpjnath-i386-apple-darwin9.7.1 \
-lpjlib-util-i386-apple-darwin9.7.1 \
-lpj-i386-apple-darwin9.7.1 \
-lportaudio-i386-apple-darwin9.7.1 \
-lgsmcodec-i386-apple-darwin9.7.1 \
-lilbccodec-i386-apple-darwin9.7.1 \
-lspeex-i386-apple-darwin9.7.1 \
-lresample-i386-apple-darwin9.7.1 \
-lmilenage-i386-apple-darwin9.7.1 \
-lsrtp-i386-apple-darwin9.7.1 \
-lm \
-lpthread \
-lssl \
-lcrypto \
-framework \
CoreAudio \
-framework \
AudioToolbox \
-framework \
AudioUnit
OTHER_FILES += Changelog
There is nothing new in their .pro file.
So I just don't know where to find the solution. I hope I gave enough information. And as I mentioned above, I didn't find anyting useful about this problem.
Maybe there is another way to build a softphone by using qt, but as I found out pjsip library is one of the best decisions to do that. Any information would be appreciated.
I'm developing Qt application on Win 7 (using Windows Qt distro with MinGW included) and I need to use Google's protocol buffers. So I followed this How to build Google's protobuf in Windows using MinGW? and I have managed to build it.
But it was necessary for me to install separately MinGW and MSYS to achieve that.
Is there cleaner way how to built in protobufs in my app just using Qt and it's toolchain ?
We created new project and added files from protobuf. I can give you my .pro file.
Then we included this project to our common project (subdirs)
QT -= gui
TARGET = protobuf
TEMPLATE = lib
CONFIG += staticlib
# DESTDIR
win32 {
CONFIG(debug, debug|release): DESTDIR = ../bin/debug
CONFIG(release, debug|release): DESTDIR = ../bin/release
}
unix {
CONFIG(debug, debug|release): DESTDIR = ../bin_unix/debug
CONFIG(release, debug|release): DESTDIR = ../bin_unix/release
}
INCLUDEPATH += ../protobuf
SOURCES += \
google/protobuf/wire_format_lite.cc \
google/protobuf/wire_format.cc \
google/protobuf/unknown_field_set.cc \
google/protobuf/text_format.cc \
google/protobuf/service.cc \
google/protobuf/repeated_field.cc \
google/protobuf/reflection_ops.cc \
google/protobuf/message_lite.cc \
google/protobuf/message.cc \
google/protobuf/generated_message_util.cc \
google/protobuf/generated_message_reflection.cc \
google/protobuf/extension_set_heavy.cc \
google/protobuf/extension_set.cc \
google/protobuf/dynamic_message.cc \
google/protobuf/descriptor_database.cc \
google/protobuf/descriptor.pb.cc \
google/protobuf/descriptor.cc \
google/protobuf/compiler/parser.cc \
google/protobuf/compiler/importer.cc \
google/protobuf/io/zero_copy_stream_impl_lite.cc \
google/protobuf/io/zero_copy_stream_impl.cc \
google/protobuf/io/zero_copy_stream.cc \
google/protobuf/io/tokenizer.cc \
google/protobuf/io/printer.cc \
google/protobuf/io/gzip_stream.cc \
google/protobuf/io/coded_stream.cc \
google/protobuf/stubs/substitute.cc \
google/protobuf/stubs/strutil.cc \
google/protobuf/stubs/structurally_valid.cc \
google/protobuf/stubs/once.cc \
google/protobuf/stubs/common.cc
HEADERS += \
google/protobuf/wire_format_lite_inl.h \
google/protobuf/wire_format_lite.h \
google/protobuf/wire_format.h \
google/protobuf/unknown_field_set.h \
google/protobuf/text_format.h \
google/protobuf/service.h \
google/protobuf/repeated_field.h \
google/protobuf/reflection_ops.h \
google/protobuf/message_lite.h \
google/protobuf/message.h \
google/protobuf/generated_message_util.h \
google/protobuf/generated_message_reflection.h \
google/protobuf/extension_set.h \
google/protobuf/dynamic_message.h \
google/protobuf/descriptor_database.h \
google/protobuf/descriptor.pb.h \
google/protobuf/descriptor.h \
google/protobuf/compiler/parser.h \
google/protobuf/compiler/importer.h \
google/protobuf/io/zero_copy_stream_impl_lite.h \
google/protobuf/io/zero_copy_stream_impl.h \
google/protobuf/io/zero_copy_stream.h \
google/protobuf/io/tokenizer.h \
google/protobuf/io/printer.h \
google/protobuf/io/gzip_stream.h \
google/protobuf/io/coded_stream_inl.h \
google/protobuf/io/coded_stream.h \
google/protobuf/stubs/substitute.h \
google/protobuf/stubs/strutil.h \
google/protobuf/stubs/stl_util-inl.h \
google/protobuf/stubs/once.h \
google/protobuf/stubs/map-util.h \
google/protobuf/stubs/hash.h \
google/protobuf/stubs/common.h \
config.h
# Turn off ALL warning for the project
win32:CONFIG += warn_off
An alternative way to build is to use this project: https://github.com/cjh1/protobuf which does not require running ./configure but does require the CMake build system for Windows which can integrate with the MinGW toolchain that comes with Qt. It currently only builds a protobufs as static libraries (not dynamic/shared) and doesn't install header files but I hope eventually those features will be built in.
I am trying to build a shared library by editing Wireshark's Makefile.am to create a "libtshark" ... to do this, I am trying to build a tshark_lib.c which is the same as tshark.c with main() stripped out of it.
So I have edited Makefile.am to include include the following in an attempt to build the shared libtshark library:
lib_LTLIBRARIES = libtshark.la
libtshark_la_LDFLAGS = -version-info 0:1:0 -export-symbols libtshark.sym #LDFLAGS_SHAREDLIB#
libtshark_la_SOURCES = \
$(WIRESHARK_COMMON_SRC) \
$(SHARK_COMMON_CAPTURE_SRC) \
$(TSHARK_TAP_SRC) \
capture_opts.c \
capture_sync.c \
tempfile.c \
tshark-tap-register.c \
tshark_lib.c
# Libraries and plugin flags with which to link tshark.
libtshark_la_LIBADD = \
wiretap/libwiretap.la \
epan/libwireshark.la \
wsutil/libwsutil.la \
#SSL_LIBS# \
$(plugin_ldadd) \
#PCRE_LIBS# \
#GLIB_LIBS# -lm \
#PCAP_LIBS# \
#SOCKET_LIBS# \
#NSL_LIBS# \
#C_ARES_LIBS# \
#ADNS_LIBS# \
#KRB5_LIBS# \
#CORESERVICES_FRAMEWORKS# \
#LIBGCRYPT_LIBS# \
#LIBGNUTLS_LIBS# \
#LIBSMI_LDFLAGS#
#tshark_CFLAGS = $(AM_CLEAN_CFLAGS) $(py_dissectors_dir)
libtshark_la_DEPENDENCIES = \
${top_builddir}/epan/libwireshark.la \
${top_builddir}/wsutil/libwsutil.la \
${top_builddir}/wiretap/libwiretap.la \
libtshark.sym
However, when I try to build the code now, I get the following error:
make[2]: *** No rule to make target `libtshark.sym', needed by `libtshark.la'. Stop.
For some reason, it is not using my 'libtshark_la_LDFLAGS' which contains '-export-symbols libtshark.sym' ... does anyone know what I might be missing?
Here is the entire Makefile.am, which is too long for stackoverflow: Makefile.am
it turns out that the .sym file is pre-generated by wireshark scripts to determine which symbols to export.