小编Pro*_*ica的帖子

汇编语言中的getch等价物

我在汇编语言中使用C++编写x86,我需要用汇编语言而不是C++语言来了解getch等价物,因为我不想使用C++编程语言中的任何函数.

我在网上找到了代码,但是它将给定的值保存到变量并用C++创建.我想只使用该功能来停止程序,直到按下任何键.我不必在进一步的编程中使用输入的键值.

c c++ assembly

4
推荐指数
1
解决办法
2533
查看次数

ffmpeg安装失败OSX 10.7.2

你能帮助我吗?

我尝试使用brew安装ffmpeg,但我不能.

似乎已成功安装依赖项.

我使用的是Mac OSX 10.7.2和XCode 4.2.1.

我无法安装ffmpeg.

我试过了:

brew install ffmpeg
brew install --use-clang ffmpeg
brew install --use-clang --HEAD ffmpeg
Run Code Online (Sandbox Code Playgroud)

他们都失败了.

这是结果日志.

$ brew install --use-clang ffmpeg
==> Downloading http://ffmpeg.org/releases/ffmpeg-0.9.1.tar.bz2
File already downloaded in /Users/brunogermano/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/ffmpeg/0.9.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libfreetype --cc=/usr/bi
ERROR: libmp3lame >= 3.98.3 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org …
Run Code Online (Sandbox Code Playgroud)

install ffmpeg osx-lion

4
推荐指数
1
解决办法
8616
查看次数

酿造不适合我OSX 10.7

我已经安装了xcode 4.3并且正在运行但是当我执行brew install wget时.我明白了


    ==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
    ######################################################################## 100.0%
    ==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable
    configure: configuring for GNU Wget 1.13.4
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking build system type... x86_64-apple-darwin11.3.0
    checking host system type... x86_64-apple-darwin11.3.0
    checking for gcc... …

macos xcode homebrew

4
推荐指数
1
解决办法
6707
查看次数

_IO_wide_data_2:这是什么?

我正在开发一个嵌入式平台(架构是SH4),几分钟前我的程序用SIGABRT崩溃了.

幸运的是,我在gdbserver下运行,被这个信号中断的线程有这个堆栈转储:

#0  0x2a7f1678 in raise () from /home/[user]/target/lib/libc.so.6
#1  0x2a7f2a4c in abort () from /home/[user]/target/lib/libc.so.6
#2  0x2a81ade0 in __libc_message () from /home/[user]/target/lib/libc.so.6
#3  0x2a81f3a8 in malloc_printerr () from /home/[user]/target/lib/libc.so.6
#4  0x2a8c3700 in _IO_wide_data_2 () from /home/[user]/target/lib/libc.so.6
Run Code Online (Sandbox Code Playgroud)

你知道这里发生了什么吗?一个糟糕的免费()?坏删除?不好malloc?什么是"_IO_wide_data_2"应该做什么?我看到malloc_printerr()调用我也不明白.

谷歌给了我234个结果,但所有这些都只是因为这些人在他们的回溯中有"功能".

c c++ debugging gdb

4
推荐指数
2
解决办法
826
查看次数

汇编中“org xxxx”的用途是什么

最近我在学习如何编写引导扇区,这是我正在学习的完整代码:

org 07c00h
    mov ax, cs
    mov ds, ax
    mov es, ax
    call DispStr
    jmp $

DispStr:
    mov ax, BootMessage
    mov bp, ax
    mov cx, 16
    mov ax, 01301h
    mov bx, 000ch
    mov dl, 0
    int 10h
    ret

BootMessage: db "Hello, OS!"
times 510-($-$$) db 0

dw 0xaa55
Run Code Online (Sandbox Code Playgroud)

如果您知道如何启动系统,这是一个非常简单的代码。结果Hello OS!屏幕上显示一行,唯一不知道的就是第一行:org 07c00h,书上告诉我这行代码让编译器把地址定位到7c00h的地方,但是解释的很含糊,我真的不知道这里有什么用。这条线org 07c00h在这里做什么?我试图删除该行,并使用 nasm 创建一个bin文件,然后使用 bochs 来启动 bin 文件。与上一个没有什么不同:“你好 OS!” 也显示在屏幕上。我可以说第一行在这里什么都不做吗?org xxxxintheworld 有什么用?

boot x86 assembly operating-system pc

4
推荐指数
1
解决办法
3464
查看次数

如何在C中完成相当于"ulimit -n 400"的操作?

在开始用C编写的程序之前,我必须运行命令"ulimit -n 400"来提高允许打开文件的数量,但是有没有办法在C程序中执行相同的操作?

也就是说,增加该进程允许的打开文件描述符的数量.(我对每个线程限制不感兴趣.)

它是否涉及设置ulimits,然后分叉一个允许有更多打开文件的孩子?

当然,我可以编写一个运行ulimit的shell包装器,然后启动我的C程序,但感觉不那么优雅.我也可以通过bash或sh的源代码来查看它是如何在那里完成的 - 也许我会在这里得到答案.

还有关系,如果你想选择很多文件描述符,请看这里.

c unix linux glibc libc

3
推荐指数
2
解决办法
8721
查看次数

用于自动列出目标文件的 GNU make 替换命令

一种常见的 makefile 有这样一行:

OBJS=something.o other.o third.o progname.o

progname: $(OBJS)
Run Code Online (Sandbox Code Playgroud)

然后你会跑make progname。但是 GNU Make 也可以从它在当前目录中看到的所有 c 文件中生成 o 文件本身的列表。这是怎么做的?

基本上,我希望能够将 C 文件添加到目录中,而无需更改 makefile。

(例如是通过一些shell-magic,还是有一个内置函数?)

makefile

3
推荐指数
1
解决办法
2489
查看次数

在Mac OSX Snow Leopard上安装PostgreSQL for Rails 3 - 错误消息

我使用Brew安装了PostgreSQL(以前尝试使用PostgreSQL网站上的独立安装程序进行安装),但是当我尝试捆绑安装时收到以下错误消息:

Errno::EACCES: Permission denied - /Users/xxxxx/.rvm/gems/ruby-1.9.3-p194/gems/pg-0.14.1/.gemtest An error occurred while installing pg (0.14.1), and Bundler cannot continue. Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

我在Stackoverflow上找到了各种可能的解决方案,但这些解决方案似乎都无法解决问题.

psql --version返回:9.2.1 which psql返回:/ usr/local/bin/psql

任何人都认识到这个错误,和/或有任何进一步的想法如何解决它?

如果做不到这一点,我想我可以在本地坚持使用SQLite,并在生产环境中使用PostgreSQL.我假设我需要手动对database.yml文件进行以下更改(我将第一次部署):

production:
  adapter: postgresql
  encoding: unicode
  database: myapp_production
  pool: 5
  username: myapp
  password: 
Run Code Online (Sandbox Code Playgroud)

并且,在我的gemfile中,包含以下内容(请注意,运行bundle install会返回相同的错误,但是因为我假设生产服务器上的PostgreSQL安装没有任何错误,我认为它应该仍然有用吗?) :

group :production do

  gem 'pg'

end
Run Code Online (Sandbox Code Playgroud)

编辑:如果宝石'pg'包含在gemfile中,那么Webrick根本不会运行.

编辑2:此外,当我尝试运行rvmsudo gem install pg时,我得到了这个:

ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file
collect2: ld returned …
Run Code Online (Sandbox Code Playgroud)

postgresql macos homebrew ruby-on-rails

3
推荐指数
1
解决办法
1743
查看次数

在Raspberry Pi上运行Open GL程序?

Raspberry Pi可以运行OpenGL程序吗?像GL 1.x程序一样,而不是OpenGL ES 2.x,我知道它可以运行.

我问的原因是,我在启动SFML 2时遇到了麻烦.

opengl sfml mesa raspberry-pi raspbian

3
推荐指数
1
解决办法
2848
查看次数

如何在Windows Phone 8中获取IMSI和IMEI?

我知道在Windows Phone 7中,获取IMSI和IMEI是不可能的.

有没有办法在Windows Phone 8中获取IMSI和IMEI

windows-phone-8

3
推荐指数
1
解决办法
8209
查看次数