gpt4 book ai didi

c - 安装 portmidi 时出现此链接错误是什么意思?

转载 作者:太空宇宙 更新时间:2023-11-04 03:16:02 25 4
gpt4 key购买 nike

我在为portmidi配置好cmake文件后,继续使用make制作必要的文件,在编译过程中遇到了这个错误:

- Build files have been written to: /home/mycomputername

/Desktop/portmedia/portmidi
[ 2%] Linking C shared library /Release/libpmjni.so
/usr/bin/x86_64-linux-gnu-ld: cannot open output file /Release/libpmjni.so: No such file or directory
collect2: error: ld returned 1 exit status
pm_common/CMakeFiles/pmjni.dir/build.make:251: recipe for target '/Release/libpmjni.so' failed
make[2]: *** [/Release/libpmjni.so] Error 1
CMakeFiles/Makefile2:87: recipe for target 'pm_common/CMakeFiles/pmjni.dir/all' failed
make[1]: *** [pm_common/CMakeFiles/pmjni.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

我很困惑。我试图在 ccmake 的 cxx-flags 部分插入标志 -fpic 并更改默认的 java 安装路径无济于事。坦率地说,我认为这与执行顺序的困惑有关,但我不知道在哪里。

任何帮助将不胜感激。

最佳答案

显然,在 ccmake 配置中 CMake 指向的目录中有一些配置要做。我刚刚重新下载文件并将其解压缩到新创建的 portmedia 目录中。此外,为确保您在设置 pm_defaults 时不会遇到任何问题,请参阅 Nate's answer .引用:

Apparently, one of the Makefiles generated by ccmake is broken. I was able to fix the issue by running

sed -i 's/pm_java\/pm_java/pm_java/' build.make

in the pm_java/CMakeFiles/pmdefaults_target.dir/ subdirectory of the project after running ccmake . (on Ubuntu, though). (The sed command replaces all occurrences of pm_java/pm_java by pm_java.)

Everything compiles, and I can even run pmdefaults from the Release directory using

java -Djava.library.path=. -jar pmdefaults.jar

关于c - 安装 portmidi 时出现此链接错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51748782/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com