Linked Questions

1 vote
2 answers
1k views

I'm a bit curious about the internal of ELF file. And I have this question: Why we need to compile a shared library (.so) with the flag -fPIC? While theoretically, we can dynamically link an ...
Boehm's user avatar
  • 11
1 vote
1 answer
835 views

I'm very confused about position-independent code and its usage for dynamic libraries. I found this good example about -fPIC option of GCC: GCC -fPIC option and I figure out how it works. However, I'm ...
peppone's user avatar
  • 85
1 vote
1 answer
1k views

I have a very simple plugin from the code from this example (https://docs.unity3d.com/Manual/NativePlugins.html). I'm updating a UI Text Field with the value from the plugin. This works as expected ...
Andrew's user avatar
  • 567
1 vote
3 answers
496 views

I have gone through below link and it says that on most Operating Systems , pointers store the virtual address rather than physical address but I am unable to get the benefit of storing virtual ...
Radha Gogia's user avatar
1 vote
2 answers
1k views

I was learning dynamic linking recently and gave it a try: dynamic.c int global_variable = 10; int XOR(int a) { return global_variable; } test.c #include <stdio.h> extern int ...
pkuGenuine's user avatar
1 vote
1 answer
1k views

Hello I am using caffe using Ubuntu 16.04 using GPU anyone have idea how to solve this error I tried by cannot figure out how to remove it. Firstly getting errors of OpenCV and Protobuf and now that I ...
Asad's user avatar
  • 11
2 votes
2 answers
642 views

I understand g++ -fPIC option as nicely explainjed in: GCC -fPIC option I have many source files those are managed through makefile for build. It's difficult to segregate source files that is meant ...
Dr. Debasish Jana's user avatar
2 votes
2 answers
330 views

Please somebody help. I am creating a shared library and when run with this command this gives a error "gcc -shared libx.o -o libx.so" /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-...
Invictus's user avatar
  • 2,790
0 votes
1 answer
658 views

Building a cpp binary inside a docker builder with cmake FROM ubuntu:focal as builder WORKDIR /var/lib/project RUN cmake ... && make ... Then copying the built binary to final image which ...
ishkhan23's user avatar
0 votes
1 answer
365 views

I'm observing some weird behaviour from a relatively simple piece of code and would like to ask if anybody has seen such before. The code below is a basic example for allocating memory inside a ...
assen.totin's user avatar
0 votes
0 answers
336 views

I have a command line like this: $ gcc -shared -fPIC procmem.c -o libprocmem.so But i don't know what -shared and -fPIC mean? Can someone explain it to me. Thank you.
A.H.John's user avatar
1 vote
1 answer
164 views

As mentioned here, compiling without -fPIC removes the ability for the code to be included in a library. Why would someone want to do this? Are there other reasons to compile without -fPIC?
Rufus's user avatar
  • 5,614
0 votes
0 answers
298 views

I wrote a simple shared lib which contains the usage of stdout in stdio.h. #include <stdio.h> ... fflush(stdout); ... There was no compilation issue before I added the fflush(stdout) with ...
drdot's user avatar
  • 3,367
2 votes
1 answer
212 views

My Makefile was like this earlier. export SOURCE1 = source1.c \ 1.c \ 2.c \ 3.c export SOURCE2 = source2.c \ 1.c all: gcc -Wall -W -g -O2 ${SOURCE1} -lm -lipc -...
user1293997's user avatar
-1 votes
1 answer
195 views

I ran into this while studying a line of code in cmake for building a library: -Wall -Wfloat-equal -o3 -fPIC What do these compiler flags mean and how do they work? Why do they need to be inserted?
devil_e's user avatar

15 30 50 per page
1
2