gnu

how to use the GNU hcreate_r

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: #include <stdio.h> #include <stdlib.h> #include <search.h> #include <assert.h> char *data[] = { "alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whisky", "x-ray", "yankee", "zulu" }; int main(void) { ENTRY e, **ep; struct hsearch_data *htab; int i; int resultOfHcreate_r; resultOfHcreate_r=hcreate_r(30,htab); assert(resultOfHcreate_r!=0); hdestroy_r(htab); exit(EXIT_SUCCESS); } error in

caffe installation : opencv libpng16.so.16 linkage issues

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to compile caffe with python interface on an Ubuntu 14.04 machine. I have installed Anaconda and opencv with conda install opencv . I have also installed all the requirement stipulated in the coffee and changed the commentary blocks in makefile.config so that PYTHON_LIB and PYTHON_INCLUDE point towards Anaconda distributions. When I am calling make all , the following command is issued: g++ .build_release/tools/caffe.o -o .build_release/tools/caffe.bin -pthread -fPIC -DNDEBUG -O2 -DWITH_PYTHON_LAYER -I/home/andrei/anaconda

Error installing OpenCV on Ubuntu 16.04

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have being trying to install OpenCV on Ubuntu 16.04 unsing several tutorials and i always end up with an error. This is the last one i've got following this tutorial: https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-OpenCV-3.1-Installation-Guide What can i do? [ 48%] Linking CXX executable ../../bin/opencv_test_viz //usr/lib/x86_64-linux-gnu/libvtkIOImage-6.2.so.6.2: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0' //usr/lib/x86_64-linux-gnu/libvtkIOImage-6.2.so.6.2: undefined reference to `TIFFIsTiled@LIBTIFF_4.0' //usr/lib

Linker error on relocating a program above 2GB in x86_64 linux?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a user program which normally compiles to have an entry point at 0x400460 which I have to relocate to have an entry point starting at within 2GB of the shared libraries loaded in Linux. e.g linux-vdso.so.1 => (0x00007fff109cd000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcd195e6000) /lib64/ld-linux-x86-64.so.2 (0x00007fcd199af000) I am using gcc command line argument -Wl,-Ttext=0x80000000 to specify the start address for the .text segemnt. The issue is that when I am giving an address above 2GB in this argument I am

BSD Make and GNU Make compatible makefile

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a BSDmakefile and GNUmakefile that are pretty much identical except for dependency management. The GNUmakefile: ifneq ($(MAKECMDGOALS), "clean") -include $(dependencies) endif The BSDmakefile: .for i in $(dependencies) .sinclude "${i}" .endfor Is there a way to make it so that I can detect if I am running under gmake or bsdmake and then execute the appropriate include statements based off of that? I remember seeing someone take advantage of a quirk in both makefile processors so that they could achieve a similar effect. Alternatively,

Displaying struct values in GDB

房东的猫 提交于 2019-12-03 08:40:32
问题 In GDB, given a variable that points to a struct, print will display the raw pointer value and x will display the raw bytes pointed to. Is there any way to display the data pointed to as that struct, i.e. a list of fields and their values? 回答1: print *variable If you do that it will display the value of that variable in GDB. You also have an option to display the struct in an indentation and new line: $1 = { next = 0x0, flags = { sweet = 1, sour = 1 }, meat = 0x54 "Pork" } For that you need

C++11 member initialization list ambiguity

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am struggling with what appears to be an ambiguity in c++11 symbol resolution due to the GNU standard library implementation in this environment: Arch Linux 4.2.5-1 (x86_64) g++ 5.2.0 clang++ 3.7.0 Example: #include <iostream> #include <string> struct version { unsigned major; unsigned minor; unsigned patch; version(unsigned major, unsigned minor, unsigned patch) : major(major), minor(minor), patch(patch) { } friend std::ostream & operator<<(std::ostream & out, version const& v) { out << v.major << "."; out << v.minor << "."; out << v

Step by step instruction to install Rust and Cargo for mingw with Msys2?

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to install Rust on Cygwin but failed to be able link with mingw. Now I am trying to install it with Msys2. I already installed Msys2 and Mingw. I tried to follow this wiki page but I got lost at number 2: Download and install Rust+Cargo using the installer but be sure to disable the Linker and platform libraries option. Is it referring to the "rustup-init.exe" on the install page ? Should I double click to run this file or run it from Msys2? I tried to run from Msys2 and got the options: 1) Proceed with installation (default) 2)

gdb: How do I pause during loop execution?

血红的双手。 提交于 2019-12-03 08:12:41
问题 I'm writing a software renderer in g++ under mingw32 in Windows 7, using NetBeans 7 as my IDE. I've been needing to profile it of late, and this need has reached critical mass now that I'm past laying down the structure. I looked around, and to me this answer shows the most promise in being simultaneously cross-platform and keeping things simple. The gist of that approach is that possibly the most basic (and in many ways, the most accurate) way to profile/optimise is to simply sample the

Trying to smash the stack

拜拜、爱过 提交于 2019-12-03 07:47:26
I am trying to reproduce the stackoverflow results that I read from Aleph One's article "smashing the stack for fun and profit"(can be found here: http://insecure.org/stf/smashstack.html ). Trying to overwrite the return address doesn't seem to work for me. C code: void function(int a, int b, int c) { char buffer1[5]; char buffer2[10]; int *ret; //Trying to overwrite return address ret = buffer1 + 12; (*ret) = 0x4005da; } void main() { int x; x = 0; function(1,2,3); x = 1; printf("%d\n",x); } disassembled main: (gdb) disassemble main Dump of assembler code for function main: 0x00000000004005b0