- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在交叉编译一款针对 ARM Cortex A8 的软件,并使用 CMAKE 工具生成 Makefile。
我的CMakeLists.txt文件如下
cmake_minimum_required(VERSION 2.8)
PROJECT(sierra-software)
include_directories($ENV{PREFIX}/include/sierra)
include_directories($ENV{PREFIX}/include/glib-2.0)
include_directories($ENV{PREFIX}/lib/glib-2.0/include)
include_directories($ENV{PREFIX}/include)
include_directories($ENV{PREFIX}/include/dbus-1.0)
include_directories($ENV{PREFIX}/lib/dbus-1.0/include)
find_package(PkgConfig)
# target_include_directories(sierra PUBLIC $<BUILD_INTERFACE:$ENV{PREFIX}/include>
# use, i.e. don't skip the full RPATH for the build tree
# SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
# SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
# SET(CMAKE_INSTALL_RPATH "/home/deep/projects/code/build/lib")
IF(CMAKE_CROSSCOMPILING)
set(CMAKE_INSTALL_PREFIX $ENV{PREFIX})
# add_definitions(-g)
# SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
# add_definitions(-O3 -Wall -c -fmessage-length=0)
ELSE(CMAKE_CROSSCOMPILING)
add_definitions(-DSIMULATE_FIFOS -O3 -g)
set(CMAKE_INSTALL_PREFIX /home/host/satsys/usr)
ENDIF(CMAKE_CROSSCOMPILING)
include_directories(${GTHREAD_INCLUDE_DIRS} ${DBUS_GLIB_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS})
link_directories(${GTHREAD_LIBRARY_DIRS} ${DBUS_GLIB_LIBRARY_DIRS} ${GLIB2_LIBRARY_DIRS})
include_directories(NetSerSel/src TrackingData/src ClientExternalGPS/src AlsaSierraConf/src Discretes/src alsa_relay/src smsHandle/src DBUSBaseConnection/src ClientModemsCommunication/src)
add_subdirectory(NetSerSel)
add_subdirectory(Discretes)
add_subdirectory(TrackingData)
add_subdirectory(ClientExternalGPS)
add_subdirectory(AlsaSierraConf)
add_subdirectory(alsa_relay)
add_subdirectory(smsHandle)
add_subdirectory(ModemsManagement)
add_subdirectory(TrackingManagement)
add_subdirectory(serveur_sierra)
add_subdirectory(ModemTalk)
add_subdirectory(DspicTalk)
add_subdirectory(send_msg)
add_subdirectory(get_data)
使用以下命令生成 Makefile
[linux-devkit]:~/projects/code/src/sierra-software> cmake -DCMAKE_TOOLCHAIN_FILE=./arm.cmake
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /home/deep/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /home/deep/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working CXX compiler: /home/deep/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /home/deep/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Found PkgConfig: /home/deep/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/pkg-config (found version "0.25")
-- checking for module 'alsa'
-- found alsa, version 1.0.26
-- checking for module 'dbus-1'
-- found dbus-1, version 1.6.8
-- checking for module 'glib-2.0'
-- found glib-2.0, version 2.34.3
-- checking for module 'dbus-glib-1'
-- found dbus-glib-1, version 0.100.2
-- checking for module 'gthread-2.0'
-- found gthread-2.0, version 2.34.3
-- checking for module 'glib-2.0'
-- found glib-2.0, version 2.34.3
-- Configuring done
-- Generating done
-- Build files have been written to: /home/deep/projects/code/src/sierra-software
当我使用 make 命令编译项目时,出现以下错误[
linux-devkit]:~/projects/code/src/sierra-software> make
Scanning dependencies of target NetSerSel
[ 2%] Building C object NetSerSel/CMakeFiles/NetSerSel.dir/src/libNetSerSel.c.o
Linking C static library libNetSerSel.a
[ 2%] Built target NetSerSel
Scanning dependencies of target Discretes
[ 5%] Building C object Discretes/CMakeFiles/Discretes.dir/src/libDiscretes.c.o
Linking C static library libDiscretes.a
[ 5%] Built target Discretes
Scanning dependencies of target TrackingData
[ 7%] Building C object TrackingData/CMakeFiles/TrackingData.dir/src/libTrackingData.c.o
Linking C static library libTrackingData.a
[ 7%] Built target TrackingData
Scanning dependencies of target ClientExternalGPS
[ 10%] Building C object ClientExternalGPS/CMakeFiles/ClientExternalGPS.dir/src/libClientSharedExtGPSInfo.c.o
Linking C static library libClientExternalGPS.a
[ 10%] Built target ClientExternalGPS
Scanning dependencies of target AlsaSierraConf
[ 12%] Building C object AlsaSierraConf/CMakeFiles/AlsaSierraConf.dir/src/AlsaSierraConf.c.o
Linking C static library libAlsaSierraConf.a
[ 12%] Built target AlsaSierraConf
Scanning dependencies of target alsa_relay
[ 15%] Building C object alsa_relay/CMakeFiles/alsa_relay.dir/src/alsa_relay.c.o
Linking C static library libalsa_relay.a
[ 15%] Built target alsa_relay
Scanning dependencies of target smsHandle
[ 17%] Building C object smsHandle/CMakeFiles/smsHandle.dir/src/smsHandle.c.o
Linking C static library libsmsHandle.a
[ 17%] Built target smsHandle
Scanning dependencies of target ModemsManagement
[ 20%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/marshaller.c.o
[ 22%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libGSM.c.o
[ 25%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libIridium.c.o
[ 27%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/Tools.c.o
[ 30%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libsms.c.o
[ 32%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libDspic.c.o
[ 35%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libGC864.c.o
[ 37%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/main.c.o
[ 40%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libSharedDevicesInfo.c.o
[ 42%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libSharedModemsInfo.c.o
[ 45%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libDBusModemsManagement.c.o
/home/deep/projects/code/src/sierra-software/ModemsManagement/src/libDBusModemsManagement.c: In function ‘InitDbus’:
/home/deep/projects/code/src/sierra-software/ModemsManagement/src/libDBusModemsManagement.c:149:2: warning: ‘g_type_init’ is deprecated (declared at /home/deep/projects/code/build/include/glib-2.0/gobject/gtype.h:681) [-Wdeprecated-declarations]
/home/deep/projects/code/src/sierra-software/ModemsManagement/src/libDBusModemsManagement.c:150:2: warning: ‘g_thread_init’ is deprecated (declared at /home/deep/projects/code/build/include/glib-2.0/glib/deprecated/gthread.h:265) [-Wdeprecated-declarations]
[ 47%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libSMSmanagement.c.o
[ 50%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libSBD960x.c.o
[ 52%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libModem.c.o
[ 55%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/DList.c.o
[ 57%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/SFifo.c.o
[ 60%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/libThuraya.c.o
[ 62%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/DiscretesFifo.c.o
[ 65%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/MList.c.o
[ 67%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/pduconv.c.o
[ 70%] Building C object ModemsManagement/CMakeFiles/ModemsManagement.dir/src/KList.c.o
Linking C executable ModemsManagement
CMakeFiles/ModemsManagement.dir/src/libDBusModemsManagement.c.o: In function `InitDbus':
libDBusModemsManagement.c:(.text+0x162c): undefined reference to `g_thread_init'
libDBusModemsManagement.c:(.text+0x17b0): undefined reference to `org_freedesktop_DBus_request_name'
collect2: error: ld returned 1 exit status
ModemsManagement/CMakeFiles/ModemsManagement.dir/build.make:590: recipe for target 'ModemsManagement/ModemsManagement' failed
make[2]: *** [ModemsManagement/ModemsManagement] Error 1
CMakeFiles/Makefile2:429: recipe for target 'ModemsManagement/CMakeFiles/ModemsManagement.dir/all' failed
make[1]: *** [ModemsManagement/CMakeFiles/ModemsManagement.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
错误清楚地表明问题与链接有关我已检查 libgthread.so 工具链 lib 文件夹的路径以及 libgib-2.0.so 库是否正确包含。</p>
请建议如何解决此未定义的引用问题。
最佳答案
我在项目中做了一些工作,只是注释从该文件中出现错误的地方调用该函数
//g_thread_init(NULL);
`并且代码使用 zlib 和 libffi 的依赖项进行编译。
关于linux 交叉编译链接器问题, undefined reference `g_thread_init' 和 `org_freedesktop_DBus_request_name',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36426049/
我想在 java 中声明一个对象,就像在 C++ 中指向指针的指针,让我给你看一个例子: //*** At the application startup //Initialize a setting
考虑这段代码, struct A {}; struct B { B(const A&) {} }; void f(B) { cout << "f()"<
我正在尝试将一个C程序翻译成Rust。。C程序具有以下结构(归结为MRE):。在一个函数中,我将执行以下指针魔术:。不,我的问题是:我将如何在铁锈中实现同样的目标?。到目前为止,我在《铁锈》中尝试过的
我目前正在尝试将一个C程序翻译成Rust。。C程序具有以下结构(归结为MRE):。在一个函数中,我将执行以下指针魔术:。不,我的问题是:我将如何在铁锈中实现同样的目标?。到目前为止,我在《铁锈》中尝试
这个问题在这里已经有了答案: Add managed DLL dependencied to unmanaged C++ project (1 个回答) 关闭 6 年前。 我有这样一个场景: 使用
这是一个常见问答的集合,这也是一个社区维基,所以每个人都被邀请参与维护它。。正则表达式正在遭受给我ZE代码类型的问题和没有解释的糟糕答案。此参考旨在提供指向质量问答的链接。。此参考适用于以下语言:PH
我正在尝试在方案中模拟堆栈。我正在使用 DrScheme 并选择语言 R5RS。我需要创建 pop、push 和 peek 的函数。但我无法弄清楚如何通过引用传递。我已经阅读了一些关于盒子的信息,但是
我陷入了这个错误。我将代码部署在生产服务器上,它在端口 80 上运行。当我尝试登录管理页面时。如图所示,它给了我 403 错误。 可能是什么原因?我的 Django 代码或 nginx 配置有问题吗?
这是一段简单的 C++ 代码: A foo(){ A a; // create a local A object return a; } void bar(const A & a_r){ }
我正在使用从 torrenteditor 获取的 php 脚本来创建 torrent 文件,但是当我使用指定的方法创建新的 torrent 文件时,torrent 文件被创建但我收到很多通知。,就像这
MySQL: REFERENCES vs FOREIGN KEY + REFERENCES 我认为 REFERENCES 是更冗长的 FOREIGN KEY REFERENCES 语法的某种速记语法。
我想使用基于另一个方法引用的方法引用。这有点难以解释,所以我给你举个例子: Person.java public class Person{ Person sibling; int a
Java/C# 语言律师喜欢说他们的语言通过值传递引用。这意味着“引用”是在调用函数时复制的对象指针。 同时,在 C++ 中(以及在 Perl 和 PHP 中更动态的形式),引用是某个其他名称(或动态
当我需要实现递归 lambda 时,通常我这样做: auto factorial = [](auto& self, int n) -> int { return n == 0 ? 1 : n
我目前正在研究 DDD ,需要一些启发。 我有两个实体 Temple TempleVariant Temple(听筒)包含基本信息(名称,描述等),并具有n个变体,它们具有技术描述(CAD绘图,尺寸,
在 Grails 中 belongsTo允许一个域类与另一个域类建立级联关系。使用belongsTo时有两种类型的关系:引用和无引用。 Reference 在拥有的对象上创建属性,而 No Refer
我正在使用 AWS 和 Django Rest Framework 开发 Web 应用程序。(Django:v1.8,DRF:v3) 我一直在为 POST 多部分表单请求获取 django.reque
我按照下面的定义公开了 WCF 端点, 当我在 .NET 3.5 中添加“服务引用”时,我们在代理中获得了以下类,这非常好: [Syst
我在玩 constexpr 引用时产生了这种感觉。但问题本身与 constexpr 无关,只是被它揭示。 我们知道有“指向const的指针”,也有“const指针”。顺便说一句,由于后者的使用比前者少
我有 2 种类型的 refences,它们中的每一种都可以正常工作。 我尝试使用每一个并在 project build 中得到相同的结果。 请向我解释 COM 引用和引用之间的区别。 谢谢你。 最佳答
我是一名优秀的程序员,十分优秀!