我的目标是从构建共享库--它们是用C语言编写的常微分方程的求解者。
我下载了源代码,并遵循了安装指南:
运行Cmake (使用GUI),选中选项"CVODE“(这是可用的解决器之一--我唯一想要的)、”构建共享库“和”使用通用(std-c)数学库“,并生成Makefile。
在Linux控制台中运行make && make install,我的共享库就生成了,完全没有错误消息。这是输出:
$ make
Scanning dependencies of target sundials_nvecserial_shared
[ 3%] Building C
我正在尝试用一组代码构建一个共享库,除了Makefile的这个问题之外,一切都正常。到目前为止,我的(简化的) Makefile如下:
OBJS = bar.o
libfoo.so: OS = LINUX # These don't seem to happen
libfoo.dll: OS = WINDOWS
# Linux
ifeq ($(OS), LINUX)
CC = gcc
...
# Windows
else ifeq ($(OS), WINDOWS)
CC = i686-pc-mingw32-gcc
...
endif
all: libfoo
创建最基本的程序:
int main(){ return 1; }
汇编:
g++ -std=c++17 test.c -o test.out
试着跑到地狱:
valgrind --tool=helgrind ./test.out
==5269== Helgrind, a thread error detector
==5269== Copyright (C) 2007-2017, and GNU GPL'd, by OpenWorks LLP et al.
==5269== Using Valgrind-3.13.0 and LibVEX; rerun with -h for co
通过下面的步骤成功地建立了ffmpeg
http://stackoverflow.com/questions/22471514/ffmpeg-build-output-is-not-showing
Now I have copy include and all .a file into my JNI folder. and my Android.mk
file is as:-
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpe
我需要在Java应用程序中调用一些本机C++代码,所以我使用'System.loadLibrary(String)‘来加载所需的.so文件,但是当我试图从Eclipse执行Java应用程序时,我得到了这个错误消息:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libdebug in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime
我想知道Linux2.6中是否启用了SO_REUSEPORT选项??
如果我尝试使用它并编译我的代码,我会得到以下错误
01.c:72: error: `SO_REUSEPORT' undeclared (first use in this function)
01.c:72: error: (Each undeclared identifier is reported only once
01.c:72: error: for each function it appears in.)
使用上面的选项,我想我可以将两个不同的套接字绑定到相同的IPADRESS和端口号