当前位置: 首页 > 工具软件 > libserialport > 使用案例 >

UnsatisfiedLinkError libSerialPort

米楚青
2023-12-01

解决办法:
在Android.mk文件中加入:LOCAL_LDFLAGS += -fPIC,重新编译Google开源库的源码,生成.so库

#
# Copyright 2009 Cedric Priscal

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. 
#
 
LOCAL_PATH := $(call my-dir)
 
include $(CLEAR_VARS)
 
TARGET_PLATFORM := android-3
LOCAL_MODULE    := serial_port
LOCAL_SRC_FILES := SerialPort.c
LOCAL_LDLIBS    := -llog
 
#加入如下信息
LOCAL_LDFLAGS += -fPIC
 
include $(BUILD_SHARED_LIBRARY)

重新build

 类似资料:

相关阅读

相关文章

相关问答