Posts

Showing posts from September 23, 2018

Linker error: /usr/bin/ld: cannot find -lgcc_s

Image
Clash Royale CLAN TAG #URR8PPP up vote 3 down vote favorite I am trying to compile symlinks (tar.gz-file), which is a very small tool with one line for compilation: gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c which gives the error .... /usr/bin/ld: cannot find -lgcc_s /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status The output of /sbin/ldconfig -p | grep libgcc is libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1 and trying to include the mentioned directory directly gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/ -O2 -N -s -o symlinks symlinks.c produces the same error. Three questions: Why does it not work with the first command, as the lib seems to be in the search path Why does including the path itself does not help How to fix this? ubuntu gcc share | improve this question edited Nov 13 '13 at 16:17 asked Nov 13 '13 at 16:09 Alex 1,629 15 42 70 EDIT: Th...

Delete Substring from JSON file (malformed)

Image
Clash Royale CLAN TAG #URR8PPP up vote 2 down vote favorite I am trying to delete different values from a JSON file. It's not pretty and jq returns 1 compile error. I am searching for a solution from the command-line (awk/sed). Here is my sample data from my json-file (similiar to docker-compose): aaaa"MyPorts":"80/tcp":,"8080/tcp":,"9080/tcp":,"9090/tcp":,aaaa bbbb"PROTO 9080/tcp 9090/tcp"bbbbb cccc"TEST PROTO 80 8080"ccccc All entries can be found multiple times or also within one line. After using the replace it should look like: aaaaaaaa bbbbbbbbb cccc"TEST"ccccc I tried sed and (awk -F["]) but could not get some useful results. How can this be done ? Update: I made the sample clearer.. There are 3 different types:...: 1: Delete from "MyPorts" to }}, 2. Delete "Proto to " 3. Delete from " PROTO" till one character before ", only if left from Proto...