gnu

What GNU/Linux command-line tool would I use for performing a search and replace on a file?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 16:01:31
问题 What GNU/Linux command-line tool would I use for performing a search and replace on a file? Can the search text, and replacement, be specified in a regex format? 回答1: sed 's/a.*b/xyz/g;' old_file > new_file GNU sed (which you probably have) is even more versatile: sed -r --in-place 's/a(.*)b/x\1y/g;' your_file Here is a brief explanation of those options: -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplied) -r, --regexp-extended use extended regular

Compiling gdb for remote debugging

倖福魔咒の 提交于 2019-12-03 12:56:57
I'm trying to remote debug an application running on arm9 So far I've been able to cross compile and execute gdbserver on my device. get gdb (7.2) sources and extract them ./configure --target=arm-none-linux-gnueabi --with-expat=/usr/local/lib/ make cd gdb/gdbserver ./configure --host=arm-none-linux-gnueabi make tftp gdbserver to my device run and connect via gdb to the device gdbserver "seems" to start correctly and attach itself to my helloworld application When I try to gdb to the remote server, I get "warning: Can not parse XML target description; XML support was disabled at compile time"

What' s the difference between gnustl and stlport in android ndk development?

我的梦境 提交于 2019-12-03 11:07:52
I want to know if their performance/stability differ from each other and their licenses explained in short. Real world experiences are welcomed. As of yesterday (NDK r9d), gnustl was still more comprehensive, e.g. support for <thread>, <future>, and some other C++11 features. Even these depend on the toolchain: you could not use the default ARM gcc 4.6 to have them enabled. OTOH, stlport license is no-nonsense free, like the rest of AOSP, while the linking exception to GPL v3 for gnustl is not easy to understand. See https://groups.google.com/d/topic/android-ndk/OWl_orR0DRQ for some older

error: cannot convert 'std::basic_string<char>::iterator …' to 'const char* for argument '1' …'

爷,独闯天下 提交于 2019-12-03 11:06:15
I'm getting the following error: error: cannot convert 'std::basic_string<char>::iterator {aka __gnu_cxx::__normal _iterator<char*, std::basic_string<char> >}' to 'const char*' for argument '1' to 'int remove(const char*)' For some reason, my program compiles perfectly when I'm working on a Mac... but once I use a Linux machine, this error pops up in more than one place. (If anyone could explain why this occurs, that would be great!) Here's one of the instances where the error pops up: SomeClass::SomeClass(string t, string art, Time dur) { char chars[] = ","; t.erase(std::remove(t.begin(), t

Handling file paths cross platform

六眼飞鱼酱① 提交于 2019-12-03 10:37:42
Do any C++ GNU standalone classes exist which handle paths cross platform? My applications build on Windows and LInux. Our configuration files refer to another file in a seperate directory. I'd like to be able to read the path for the other configuration file into a class which would work on both Linux or Windows. Which class would offer the smallest footprint to translate paths to use on either system? Thanks Unless you're using absolute paths, there's no need to translate at all - Windows automatically converts forward slashes into backslashes, so if you use relative paths with forward slash

How to convert a GNU linker Script ld to Scatter File (ARM)

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to migrate from GCC to the new ARM COMPILER 6. But I'm not able to well convert the Gnu liker script (ld) to the equivalent of ARM Scatter file. The Original Code is as following: arm-none-eabi-ld -T link.ld test.o shared/bootcode.o shared/vertors.o -o test.elf Where link.ld script is as following ENTRY(bootcode) SECTIONS { . = 0x00000000; /* Code starts with vectors, then bootcode, then other code */ .text : { *vectors.o(vectors) *bootcode.o(boot) *(.text) /* remainder of code */ } =0 .data : { *(.data) } .bss : { *(.bss) } /*

GNU screen: how to clear scrollback and screen at once

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking for a way to clear both the scrollback and the visible screen at once in GNU screen. At the moment I use two separate bindings: C-a, C (which is the default one for clearing the visible text) bind _ eval "scrollback 0" "scrollback 15000" (which clears the scrollback) Can someone point me to how I can do both in one? 回答1: Turns out you can just do: bind _ eval "clear" "scrollback 0" "scrollback 15000" Note that the order seems to matter: it doesn't seem to work every time if you have the "clear" at the end (it always clears the

C Compiler cannot create executables on SUA/Interix

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Whenever I try to build an application with Interix's GCC on Windows, this is what happens: /tmp/grep-2.5.4-src/build$ ../configure --build=x86_64-pc-interix6 checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ../install-sh -c -d checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-pc-interix6 checking host system type... x86_64-pc-interix6 checking for gawk... (cached) gawk checking for gcc...

Can&#039;t compile and link programs with clang

匿名 (未验证) 提交于 2019-12-03 09:18:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently compiled Clang 2.9 (from here ) on an Ubuntu system. I'm having trouble compiling and linking a simple program. Does anyone know how to fix this? Here's the output I see: a@ubuntu:~/Desktop$ clang add.c /usr/bin/ld: 1: Syntax error: word unexpected (expecting ")") clang: error: linker command failed with exit code 2 (use -v to see invocation) uname -a output Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux gcc -v output: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=

Xcode warning: … is a GNU extension

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use a C++ library for an iOS app. With Apple LLVM 3.1 compiler configured (default), I get a lot of warnings for this C++ code, most of them saying: ... is a GNU extension The introduction of clang's user manual says: The Clang driver and language features are intentionally designed to be as compatible with the GNU GCC compiler as reasonably possible, easing migration from GCC to Clang. In most cases, code "just works". So, is it save to just look for a switch to disable this warnings (btw. how to?) or should I better get this lib rid of