- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 Cygwin 中为 linux 编译一个名为 minimodem 的程序,因为我希望能够在 Windows 中运行它。这是一个简单的命令行程序,我安装了 Cygwin,基本上包含了编译它所需的所有库。
一些库是:所有的音频、视频、数学、编译、开发、api,以及系统和基础都安装了。
我遇到的第一个问题是 ./configure。从github中项目的源代码来看,没有配置文件或文件夹。我决定放弃它,而是直接使用 make 并引用文件夹中的所有文件。
首先发生的是这个错误:
minimodem.c: In function ‘main’: minimodem.c:556:4: error: #error At least one of {USE_PULSEAUDIO,USE_ALSA,USE_SNDFILE} must be enabled! # error At least one of {USE_PULSEAUDIO,USE_ALSA,USE_SNDFILE} must be enabled! ^~~~~
所以我进入代码并删除了检查音频驱动程序的部分(即使 Cygwin 具有所有可用的音频库),然后我再次尝试:
gcc -o minimodem.c
然后编译器走得更远了一点然后给出了这个错误:
/tmp/cc5sSG5R.o: In function `fsk_transmit_frame':
/home/8bit_coder/minimodem-master/src/minimodem.c:95: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:95:(.text+0xb9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:106: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:106:(.text+0xf2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/tmp/cc5sSG5R.o: In function `tx_stop_transmit_sighandler':
/home/8bit_coder/minimodem-master/src/minimodem.c:65: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:65:(.text+0x27f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:68: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:68:(.text+0x2ec): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/tmp/cc5sSG5R.o: In function `generate_test_tones':
/home/8bit_coder/minimodem-master/src/minimodem.c:295: undefined reference to `simpleaudio_get_rate'
/home/8bit_coder/minimodem-master/src/minimodem.c:295:(.text+0x59d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_get_rate'
/home/8bit_coder/minimodem-master/src/minimodem.c:299: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:299:(.text+0x5dd): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:300: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:300:(.text+0x5eb): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/tmp/cc5sSG5R.o: In function `fsk_transmit_frame':
/home/8bit_coder/minimodem-master/src/minimodem.c:109: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:109:(.text+0x170): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `simpleaudio_tone'
/tmp/cc5sSG5R.o: In function `main':
/home/8bit_coder/minimodem-master/src/minimodem.c:751: undefined reference to `databits_decode_ascii8'
/home/8bit_coder/minimodem-master/src/minimodem.c:751:(.text.startup+0xa6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `databits_decode_ascii8'
/home/8bit_coder/minimodem-master/src/minimodem.c:751: undefined reference to `databits_encode_ascii8'
/home/8bit_coder/minimodem-master/src/minimodem.c:751:(.text.startup+0xc6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `databits_encode_ascii8'
/tmp/cc5sSG5R.o: In function `benchmarks':
/home/8bit_coder/minimodem-master/src/minimodem.c:324: undefined reference to `simpleaudio_tone_init'
/home/8bit_coder/minimodem-master/src/minimodem.c:324:(.text.startup+0x2b3): additional relocation overflows omitted from the output
/home/8bit_coder/minimodem-master/src/minimodem.c:326: undefined reference to `simpleaudio_open_stream'
/home/8bit_coder/minimodem-master/src/minimodem.c:332: undefined reference to `simpleaudio_close'
/home/8bit_coder/minimodem-master/src/minimodem.c:334: undefined reference to `simpleaudio_open_stream'
/home/8bit_coder/minimodem-master/src/minimodem.c:340: undefined reference to `simpleaudio_close'
/home/8bit_coder/minimodem-master/src/minimodem.c:344: undefined reference to `simpleaudio_tone_init'
/home/8bit_coder/minimodem-master/src/minimodem.c:346: undefined reference to `simpleaudio_open_stream'
/home/8bit_coder/minimodem-master/src/minimodem.c:352: undefined reference to `simpleaudio_close'
/home/8bit_coder/minimodem-master/src/minimodem.c:354: undefined reference to `simpleaudio_open_stream'
/home/8bit_coder/minimodem-master/src/minimodem.c:360: undefined reference to `simpleaudio_close'
/tmp/cc5sSG5R.o: In function `main':
/home/8bit_coder/minimodem-master/src/minimodem.c:665: undefined reference to `databits_decode_baudot'
/home/8bit_coder/minimodem-master/src/minimodem.c:666: undefined reference to `baudot_encode'
/home/8bit_coder/minimodem-master/src/minimodem.c:797: undefined reference to `databits_decode_baudot'
/home/8bit_coder/minimodem-master/src/minimodem.c:798: undefined reference to `baudot_encode'
/home/8bit_coder/minimodem-master/src/minimodem.c:864: undefined reference to `databits_decode_binary'
/home/8bit_coder/minimodem-master/src/minimodem.c:945: undefined reference to `simpleaudio_tone_init'
/home/8bit_coder/minimodem-master/src/minimodem.c:954: undefined reference to `simpleaudio_open_stream'
/tmp/cc5sSG5R.o: In function `fsk_transmit_stdin':
/home/8bit_coder/minimodem-master/src/minimodem.c:130: undefined reference to `simpleaudio_get_rate'
/tmp/cc5sSG5R.o: In function `main':
/home/8bit_coder/minimodem-master/src/minimodem.c:975: undefined reference to `simpleaudio_close'
/home/8bit_coder/minimodem-master/src/minimodem.c:805: undefined reference to `databits_decode_baudot'
/home/8bit_coder/minimodem-master/src/minimodem.c:806: undefined reference to `baudot_encode'
/home/8bit_coder/minimodem-master/src/minimodem.c:988: undefined reference to `simpleaudio_open_stream'
/home/8bit_coder/minimodem-master/src/minimodem.c:995: undefined reference to `simpleaudio_get_rate'
/home/8bit_coder/minimodem-master/src/minimodem.c:1011: undefined reference to `fsk_plan_new'
/home/8bit_coder/minimodem-master/src/minimodem.c:1232: undefined reference to `fsk_find_frame'
/home/8bit_coder/minimodem-master/src/minimodem.c:1443: undefined reference to `simpleaudio_close'
/home/8bit_coder/minimodem-master/src/minimodem.c:1445: undefined reference to `fsk_plan_destroy'
/home/8bit_coder/minimodem-master/src/minimodem.c:833: undefined reference to `databits_decode_callerid'
/home/8bit_coder/minimodem-master/src/minimodem.c:998: undefined reference to `simpleaudio_set_rxnoise'
/tmp/cc5sSG5R.o: In function `fsk_transmit_stdin':
/home/8bit_coder/minimodem-master/src/minimodem.c:211: undefined reference to `simpleaudio_tone'
/home/8bit_coder/minimodem-master/src/minimodem.c:233: undefined reference to `simpleaudio_tone'
/tmp/cc5sSG5R.o: In function `main':
/home/8bit_coder/minimodem-master/src/minimodem.c:1132: undefined reference to `simpleaudio_read'
/home/8bit_coder/minimodem-master/src/minimodem.c:1340: undefined reference to `fsk_find_frame'
/home/8bit_coder/minimodem-master/src/minimodem.c:1155: undefined reference to `fsk_detect_carrier'
/home/8bit_coder/minimodem-master/src/minimodem.c:1186: undefined reference to `fsk_set_tones_by_bandshift'
/home/8bit_coder/minimodem-master/src/minimodem.c:845: undefined reference to `databits_decode_uic_ground'
/home/8bit_coder/minimodem-master/src/minimodem.c:833: undefined reference to `databits_decode_callerid'
/home/8bit_coder/minimodem-master/src/minimodem.c:843: undefined reference to `databits_decode_uic_train'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_binary[.refptr.databits_decode_binary]+0x0): undefined reference to `databits_decode_binary'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_uic_train[.refptr.databits_decode_uic_train]+0x0): undefined reference to `databits_decode_uic_train'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_uic_ground[.refptr.databits_decode_uic_ground]+0x0): undefined reference to `databits_decode_uic_ground'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_callerid[.refptr.databits_decode_callerid]+0x0): undefined reference to `databits_decode_callerid'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_encode_ascii8[.refptr.databits_encode_ascii8]+0x0): undefined reference to `databits_encode_ascii8'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_ascii8[.refptr.databits_decode_ascii8]+0x0): undefined reference to `databits_decode_ascii8'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.baudot_encode[.refptr.baudot_encode]+0x0): undefined reference to `baudot_encode'
/tmp/cc5sSG5R.o:minimodem.c:(.rdata$.refptr.databits_decode_baudot[.refptr.databits_decode_baudot]+0x0): undefined reference to `databits_decode_baudot'
collect2: error: ld returned 1 exit status
然后我想也许我需要列出每个文件:
gcc -o baudot.c baudot.h databits.h databits_ascii.c databits_baudot.c databits_binary.c databits_callerid.c databits_uic.c fsk.c fsk.h minimodem.c simpleaudio.c simpleaudio.h simpleaudio_internal.h simpleaudio-alsa.c simpleaudio-benchmark.c simpleaudio-pulse.c simpleaudio-sndfile.c simple-tone-generator.c uic_codes.c uic_codes.h
但这带来了很多不同的错误:
/tmp/ccmwpyzy.o:databits_baudot.c:(.text+0x1f): undefined reference to `baudot_reset'
/tmp/ccmwpyzy.o:databits_baudot.c:(.text+0x1f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `baudot_reset'
/tmp/ccmwpyzy.o:databits_baudot.c:(.text+0x3d): undefined reference to `baudot_decode'
/tmp/ccmwpyzy.o:databits_baudot.c:(.text+0x3d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `baudot_decode'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x1b8): undefined reference to `fftwf_malloc'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x1b8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_malloc'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x208): undefined reference to `fftwf_malloc'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x208): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_malloc'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x281): undefined reference to `fftwf_plan_many_dft_r2c'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x281): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_plan_many_dft_r2c'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x2cc): undefined reference to `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x2cc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x2dc): undefined reference to `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x2dc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x323): undefined reference to `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x323): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x333): undefined reference to `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x333): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_free'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x343): undefined reference to `fftwf_destroy_plan'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x343): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `fftwf_destroy_plan'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x454): undefined reference to `fftwf_execute'
/tmp/cc6Uh66Z.o:fsk.c:(.text+0x454): additional relocation overflows omitted from the output
/tmp/cc6Uh66Z.o:fsk.c:(.text+0xda7): undefined reference to `fftwf_execute'
/tmp/ccmR4Dzs.o:minimodem.c:(.rdata$.refptr.baudot_encode[.refptr.baudot_encode]+0x0): undefined reference to `baudot_encode'
/tmp/ccBHdt9j.o:simpleaudio.c:(.rdata$.refptr.simpleaudio_backend_alsa[.refptr.simpleaudio_backend_alsa]+0x0): undefined reference to `simpleaudio_backend_alsa'
/tmp/ccBHdt9j.o:simpleaudio.c:(.rdata$.refptr.simpleaudio_backend_pulseaudio[.refptr.simpleaudio_backend_pulseaudio]+0x0): undefined reference to `simpleaudio_backend_pulseaudio'
collect2: error: ld returned 1 exit status
此时我不知道该怎么做,因为它可以很好地编译并在 Linux 上运行,但是使用 Cygwin 在 Windows 上编译它就可以了。如果有人知道我做错了什么或如何修复命令或文件以使其正常工作,谢谢。
最佳答案
正如@Sami Kuhmonen 在对您的问题的评论中所述:
Not all code can be compiled on different systems. If the code requires a specific audio system, it might not be available
在这种情况下,它尝试使用但失败的三个库:
总而言之,像这样的音频代码可能试图与专为基于 Linux 的系统设计的特定驱动程序通信 (Linux vs Windows Audio in 2017)。尽管 C 可以跨不同的操作系统移植,但在您编译程序所用的库中编写的代码很可能不是。
我很确定您必须编辑(移植)源代码才能在脑海中处理更多相关的 Windows 音频编程。
注意:
感谢@matzeri 的评论,Cygwin 上实际上有一个libsndfile
包。查看link here .
关于c - 在cygwin中编译linux C程序时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51355022/
假设我有一个在 cygwin 下编译的应用程序,并且我想在不让用户安装 cygwin 的情况下分发该应用程序。打包可执行文件和 cygwin DLL 就足够了吗? 最佳答案 事情发生了变化。 Cygw
我从一个镜像站点下载了 cygwin,几个月后,当我尝试更新时,我收到一条消息:“当前 ini 文件来自较新版本的 setup-x86_64.exe” 如果我下载了新的 ini 文件,是否也意味着必须
有什么办法可以回去安装旧版本的 Cygwin? 说我想要 1.7.9 版本,但是 setup.exe在 Cygwin 网站上总是指向最新版本? 最佳答案 http://www.cygwin.com/s
我试图从我的C++代码运行这两个.data文件进行分配。我已经获得了所有文件,并且仅打算为程序实现一些功能(所有内容都应能够运行make命令进行编译)。 我曾经运行过MAC,只是刚开始使用Window
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
当我尝试对CVS管理的文件使用Emacs 23.2.1下的ediff-revision时,在*ediff-errors*框架中收到以下错误,而不是直接开始到ediff结果: cygwin warnin
我一直在用 Cygwin (许久)。具体来说,我在Win7上使用它(包括gcc/g++)进行开发工作。我最近才注意到现在存在一个 64-bit version . 我没有特定的需求要求我过渡到 64
我从安装程序 2.905 安装了 cygwin 3.1.7 64 位,如果我不使用 grep --color=always 我在终端中看不到彩色输出,即 grep - -color=auto 在我的终
如何使用 cygwin 挂载软盘镜像文件。我想挂载镜像,将文件复制到挂载的驱动器,然后从命令行卸载它。 我知道你可以使用 Virtual Floppy Drive在 Windows 中,但有没有办法在
这个question说明cygwin的软链接(soft link)和ntfs的junctions有些不同。我希望 cygwin 创建一个真正的连接点。我想过运行mklink但是,见鬼,没有mklink
我想设置一组最小的 cygwin 应用程序(ls、diff、path、find、grep),以便它们在没有完整 cygwin 安装的机器上运行。 我假设我需要的只是相关的 *.exe 文件和 *.dl
我的机器设置可以运行 cmake 和 gcc,我想在构建机器上安装具有完全相同的包和参数集的 cygwin,也可能在其他开发机器上。有没有一种方法可以做到这一点,而不必使用提供的 Setup.exe
我正在尝试使用 Cygwin 运行 Nutch。我在设置 JAVA_HOME 时遇到问题。 $ export JAVA_HOME='/cygdrive/f/program files/java/jd
如果您尝试“全局”安装 Composer,则它无法在 Cygwin 中正确运行。 将 composer.phar 放入/usr/local/bin/composer 中,然后尝试运行它会导致错误: C
要为 Cygwin 安装其他软件包,我是否只需要运行 setup.exe再次从包列表中选择? 此外,就安装 2 个 Cygwin 实例或此类问题而言,这样做不会损害我的计算机(我对这些事情有点菜鸟)。
我刚刚安装了 Cygwin,bash 提示符中的主目录看起来位于我的 Z: 驱动器上。这不是我想要的。 如何更改此设置? 最佳答案 Starting with Cygwin 1.7.34 ,建议的方法
cygwin 上的当前目录是 home/myuser。我导航到 cygwin,发现它有一个名为 home/myuser 的目录,我不知道如何导航到桌面。我不想在那里添加桌面目录,而且我无法在根文件夹
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我使用当前版本的 Cygwin,1.7.9-1。 当我输入“$ which python”时,Cygwin 输出“/usr/bin/python”。 为了确认根目录是我的 Windows 7 文件系统
我想在 Windows 中使用 cmd 做类似的事情: start dir c:\ 应打开一个新控制台,并显示 dir c: 的输出。 对于 Cygwin 我尝试了这个: cmd /c start b
我是一名优秀的程序员,十分优秀!