I have been trying for hours to create a program that outputs something like command[/home/nerdofcode/]: by running something like: printf(“Command[“, system(“pwd”),”]: “);… But the problem I am receiving is that when I go to type input, it starts typing at command[&#…
Tag: gcc
GCC Bug, “linux” string in path replaced with “1” when using “” angle brackets to include a header through a macro
I may have found a bug in gcc. I couldn’t find anything related to this online so I want to know if anyone seen this before. I am using “Ubuntu 16.04.0 LTS” with: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.6), but this problem can be reproduced on later gcc versions as well, gcc…
Keep gcc linker from using non-system libraries found in system /lib64 folder
I am porting a large C++ library (libcoro.so) and example application (coro-example.cpp) from Windows to RedHat Linux 7.4. I have very little development experience on Linux, so this is probably a ‘newbie’ question. I have libcoro and the example app compiling, linking, and running on my RHEL 7.4 …
Ruby, ffi, and a custom C library
I’m trying to create a custom C library I can call from Ruby using FFI. My library will wrap certain libtiff functions with my own code, and the resulting higher-level functions will be called from within Ruby via the FFI interface. I’ve got test code working in C, that compiles successfully to a …
VS Code will not build c++ programs with multiple .ccp source files
Note that I’m using VS Code on Ubuntu 17.10 and using the GCC Compiler. I’m having trouble building a simple program which makes use of additional .ccp files. I’m probably missing something obvious here as I’m fairly new to programming but I’ll explain what I’ve done so far…
Client/Server pthreads program not executing under Valgrind. Runs fine normally
I have a C server program that creates & opens the write end of a named pipe (in /var/run), and interrupts on a SIGIO signal for a tty uart, pushing data into the pipe from that interface. This program also spawns a secondary pthread, which opens the read end of a separate pipe (again, in /var/run), reads…
How do you determine where segfault occured when ip (null)?
segfault at 0 ip (null) sp bf9ed55c error 4 in appname[8048000+252000] If I don’t have the IP address, how do I determine where the crash occurred? does it being (null) mean anything useful? in the appname[8048000+262000] = 0x82Aa000 is that supposed to give a clue? is it the 0x82AA000 the value I shoul…
Makefile – wildcard and recipe build
I have the following makefile I got this message : make: Circular src/paquet/packet_implem.o <- src/paquet/packet_implem.o dependency dropped. gcc -std=c99 -Wall -Werror -Wshadow -Wextra -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -lz -rdynamic -I/home/jy95/local/include -L/home/jy95/local/lib; /usr/lib…
libopencv_core.so.2.4: error adding symbols: DSO missing from command line
I have installed OpenCV 3.3.0 to Ubuntu 16.04. Just want to compile this code. g++ -o main gpu_thresh.cpp ‘pkg-config opencv –cflags –libs’ -lopencv_gpu -lopencv_core g++ -L/usr/local/lib -o main gpu_thresh.cpp ‘pkg-config opencv –cflags –libs’ -lopencv_gpu -lop…
C code about pointers
I’ve got this simple code that plays with pointers taken from Jon Eriksen’s book that I’m trying to compile but gcc gives me warnings in compilation and segmentation fault (core dumped) when I run it. Output: Answer This program is wrong, and the advice given in the book is obviously wrong, …