Это, наверное, тривиально. Я использую Qt с API таблиц C ++, и у меня плохое время, когда я пытаюсь найти подходящие ссылки.
У меня есть следующая структура каталогов.
allenh1@localhost ~/CS/tableau-api/tableau-qt
$ ls
bin include lib64 share src tableau-qt.pro ui
Вот файл .pro
QT += core gui widgets
CONFIG += c++14
TARGET = qt-tableau-demo
TEMPLATE = app
# Link with the Tableau SDK library files
QMAKE_RPATHDIR += lib64/tableausdk
SOURCES += src/main.cpp \
src/TableauTable.cpp
HEADERS += include/TableauTable.hpp
Примечание: пользовательский интерфейс еще не реализован, но будет после того, как я получу его для компиляции.
Когда я пытаюсь построить его, я получаю следующее:
allenh1@localhost ~/CS/tableau-api/tableau-qt
$ make
g++ -c -pipe -O2 -std=gnu++1y -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../../../Qt/5.6/gcc_64/include -I../../../../Qt/5.6/gcc_64/include/QtWidgets -I../../../../Qt/5.6/gcc_64/include/QtGui -I../../../../Qt/5.6/gcc_64/include/QtCore -I. -I../../../../Qt/5.6/gcc_64/mkspecs/linux-g++ -o main.o src/main.cpp
In file included from src/../include/tableau-sdk/TableauExtract.hpp:18:0,
from src/../include/TableauTable.hpp:3,
from src/main.cpp:2:
src/../include/tableau-sdk/TableauCommon.hpp:144:38: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
const TAB_RESULT GetResultCode() const { return m_result; }
^
src/main.cpp:14:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char *argv[])
^
src/main.cpp:14:31: warning: unused parameter 'argv' [-Wunused-parameter]
int main(int argc, char *argv[])
^
g++ -c -pipe -O2 -std=gnu++1y -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../../../Qt/5.6/gcc_64/include -I../../../../Qt/5.6/gcc_64/include/QtWidgets -I../../../../Qt/5.6/gcc_64/include/QtGui -I../../../../Qt/5.6/gcc_64/include/QtCore -I. -I../../../../Qt/5.6/gcc_64/mkspecs/linux-g++ -o TableauTable.o src/TableauTable.cpp
In file included from src/../include/tableau-sdk/TableauExtract.hpp:18:0,
from src/../include/TableauTable.hpp:3,
from src/TableauTable.cpp:1:
src/../include/tableau-sdk/TableauCommon.hpp:144:38: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
const TAB_RESULT GetResultCode() const { return m_result; }
^
g++ -Wl,-O1 -Wl,-z,origin -Wl,-rpath,\$ORIGIN/lib64/tableausdk -Wl,-rpath,/home/allenh1/Qt/5.6/gcc_64/lib -o perscio-tableau-demo main.o TableauTable.o -L/home/allenh1/Qt/5.6/gcc_64/lib -lQt5Widgets -L/usr/lib64 -lQt5Gui -lQt5Core -lGL -lpthread
main.o: In function `fill_table(TableauTable*&)':
main.cpp:(.text+0x88): undefined reference to `bool TableauTable::add_column<std::type_info const&>(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::type_info const&)'
main.cpp:(.text+0xc6): undefined reference to `bool TableauTable::add_column<std::type_info const&>(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::type_info const&)'
main.cpp:(.text+0xfd): undefined reference to `bool TableauTable::add_column<std::type_info const&>(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::type_info const&)'
TableauTable.o: In function `Tableau::(anonymous namespace)::MakeTableauString(wchar_t const*)':
TableauTable.cpp:(.text+0x48): undefined reference to `ToTableauString'
TableauTable.o: In function `TableauTable::TableauTable()':
TableauTable.cpp:(.text+0x1b0): undefined reference to `TabTableDefinitionCreate'
TableauTable.cpp:(.text+0x1ba): undefined reference to `TAB_RESULT_Success'
TableauTable.cpp:(.text+0x1ef): undefined reference to `TabTableDefinitionSetDefaultCollation'
TableauTable.cpp:(.text+0x22d): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0x2a7): undefined reference to `TabGetLastErrorMessage'
TableauTable.o: In function `TableauTable::init(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >)':
TableauTable.cpp:(.text+0x42b): undefined reference to `TabExtractAPIInitialize'
TableauTable.cpp:(.text+0x434): undefined reference to `TAB_RESULT_Success'
TableauTable.cpp:(.text+0x47f): undefined reference to `TabExtractCreate'
TableauTable.cpp:(.text+0x509): undefined reference to `TabExtractHasTable'
TableauTable.cpp:(.text+0x5ff): undefined reference to `TabTableDefinitionCreate'
TableauTable.cpp:(.text+0x65f): undefined reference to `TabExtractAddTable'
TableauTable.cpp:(.text+0x721): undefined reference to `TabTableDefinitionClose'
TableauTable.cpp:(.text+0x74b): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0x7f7): undefined reference to `TabExtractOpenTable'
TableauTable.cpp:(.text+0x8b9): undefined reference to `TabTableGetTableDefinition'
TableauTable.cpp:(.text+0x8c2): undefined reference to `TAB_RESULT_Success'
TableauTable.cpp:(.text+0x8df): undefined reference to `TabTableDefinitionCreate'
TableauTable.cpp:(.text+0xd0e): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0xe09): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0xe78): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0xef7): undefined reference to `TabGetLastErrorMessage'
TableauTable.cpp:(.text+0xf97): undefined reference to `TabGetLastErrorMessage'
TableauTable.o:TableauTable.cpp:(.text+0xffa): more undefined references to `TabGetLastErrorMessage' follow
TableauTable.o: In function `std::_Sp_counted_ptr<Tableau::TableDefinition*, (__gnu_cxx::_Lock_policy)2>::_M_dispose()':
TableauTable.cpp:(.text._ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x2a): undefined reference to `TabTableDefinitionClose'
TableauTable.cpp:(.text._ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x33): undefined reference to `TAB_RESULT_Success'
TableauTable.cpp:(.text._ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt15_Sp_counted_ptrIPN7Tableau15TableDefinitionELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x76): undefined reference to `TabGetLastErrorMessage'
TableauTable.o: In function `Tableau::TableDefinition::Close()':
TableauTable.cpp:(.text._ZN7Tableau15TableDefinition5CloseEv[_ZN7Tableau15TableDefinition5CloseEv]+0x24): undefined reference to `TabTableDefinitionClose'
TableauTable.cpp:(.text._ZN7Tableau15TableDefinition5CloseEv[_ZN7Tableau15TableDefinition5CloseEv]+0x2d): undefined reference to `TAB_RESULT_Success'
TableauTable.cpp:(.text._ZN7Tableau15TableDefinition5CloseEv[_ZN7Tableau15TableDefinition5CloseEv]+0x68): undefined reference to `TabGetLastErrorMessage'
collect2: error: ld returned 1 exit status
Makefile:200: recipe for target 'qt-tableau-demo' failed
make: *** [qt-tableau-demo] Error 1
Необходимые файлы .so (по крайней мере, насколько я понимаю) находятся в каталоге lib64.
allenh1@localhost ~/CS/tableau-api/tableau-qt
$ ls lib64/tableausdk
Java libboost_thread.so libicuuc.so.44
libQt5Core.so.5 libboost_thread.so.1.56.0 libicuuc.so.44.0
libQt5Core.so.5.4.1 libcurl.so libmetrics2.so
libQt5Network.so.5 libcurl.so.4 libtabcrypto.so
libQt5Network.so.5.4.1 libcurl.so.4.4.0 libtabcrypto.so.1.0.0
libTableauCommon.so libexpat.so libtabssl.so
libTableauExtract.so libexpat.so.1 libtabssl.so.1.0.0
libTableauServer.so libexpat.so.1.6.0 libtabsys.so
libboost_chrono.so libicudata.so.44 libtabz.so
libboost_chrono.so.1.56.0 libicudata.so.44.0 libtabz.so.1
libboost_date_time.so libicui18n.so.44 libtabz.so.1.2.8
libboost_date_time.so.1.56.0 libicui18n.so.44.0 libtbb.so.2
libboost_system.so libicuio.so.44 libtbbmalloc.so.2
libboost_system.so.1.56.0 libicuio.so.44.0
Задача ещё не решена.
Других решений пока нет …