Questions about linking libraries in C
I am learning C (still very much a beginner) on Linux using the GCC compiler. I have noticed that some libraries, such as the library used with the math.h
header, need to be linked in manually when included. I have been linking in the libraries using various flags of the form -l[library-name]
, such as -lm
for the above-mentioned math library.
How do .so files avoid problems associated with passing header-only templates like MS dll files have?
Based on the discussion around this question. I’d like to know how .so files/the ELF format/the gcc toolchain avoid problems passing classes defined purely in header files (like the std library). According to Jan in that answer, the dynamic linker/loader only picks one version of such a class to load if its defined in two .so files. So if two .so files have two definitions, perhaps with different compiler options/etc, the dynamic linker can pick one to use.
Is there a way to use gcc as a library?
Anyone knows a solution that works something like this:
Is GCC dying without threads support on Windows? [closed]
Closed 9 years ago.
Larger Code is Still Faster
When compiling C code with gcc
, there are compiler optimizations, some that limit code size and others create fast code.
Larger Code is Still Faster
When compiling C code with gcc
, there are compiler optimizations, some that limit code size and others create fast code.
How To Share Code Between Assembly Files In A Modular Way
Recently, I started learning Arm64 assembly. The assembler I’m using is the GNU Assembler (GAS). The version of GAS I’m using is GNU assembler (GNU Binutils for Ubuntu) 2.42
.
How To Share Code Between Assembly Files In A Modular Way
Recently, I started learning Arm64 assembly. The assembler I’m using is the GNU Assembler (GAS). The version of GAS I’m using is GNU assembler (GNU Binutils for Ubuntu) 2.42
.
Failed build of C,C++ GNU GCC 14.1.0 ToolChain for M68K (windows MSYS2)
Failed to build C,C++ GNU GCC ToolChain for M68K (windows MSYS2)
with items:
GCC-14.1.0, NEWLIB-4.4.0, BINUTILS-2.42, GDB-14.2.
What is this PROFILE macro?
I am looking at some old source code (circa 1994-1996) from a long-lost time a MUD gaming.