Linker Questions
Ad
Is there a way to find the address of a const variable in the map file?
I am writing embedded c-code with the segger embedded studio for a nordic nrf52840 microcontroller. after compiling my code, i get a .map-file and
Is it legal C to declare a non-const variable 'const' externally?
Say i have a file, window.h, which defines: extern const int window_width, window_height; i don't want anyone to
'linker input file unused because linking not done' error when running make
I'm compiling c programs i made for a project. goals compiling get_next_line.c and
On Windows MSVC, is it possible to merge some .obj into one .obj? If yes, how should I do that?
For example, there is three object files a.obj b.obj c.obj just compiled out with cl, and it is desired to combine them
gcc - how to create an so from a source file and other o files?
I am working on a c project. https://github.com/eantoranz/gitmod it's
Safely call openSSL functions from inside a shared library
I have implemented a client program that uses openssl to connect to the server in the secure way. the client is compiled as a shared object (so),
Incorrect gdb configurations for vscode?
I have some c files, organized like so: └── src ├── app.out ├── makefile ├── main.c
Running address of an application, followed by heap and stack expansions
I have an m.c: extern void a(char*); int main(int ac, char **av){ static char string [] = "hello ,
Undefined symbols for architecture arm64: "_FIRAuthStateDidChangeInternalNotificationAppKey", referenced from
I am trying to update to latest frameworks in our app, but getting this error undefined symbols for architecture arm64:
C compiler can't find function definition
I'm new to c programming and encounter this question: three files: main.c, foo.h, foo.c are in the
Ad
How to run each "function" in a code section?
I want to be able to declare function so that they are added to a specific code section and then they are all executed before my start function.
Can GCC version script include debug symbols?
When building a shared library with gcc, without using a version script, we can split our debug symbols into separate .dbg files, allowing us to
When building a DLL file, does the generated LIB file contain the DLL name?
In visual c++ , when i build a dll , the output files are .dll and .lib. is the name of the dll built into the .lib file . the
How to include/link C .lib files in a Delphi project
We have a .lib file with functionality that must be included in a delphi application. it is easy to include .obj files, but for some
Fail to compile the Y86 simulatur (CSAPP)
I have problem compiling the y86 simulator for doing practices in csapp
How to encourage 'address-of' access to a linker variable
As discussed in access symbols
undefined reference to OpenSSL_version, Error linking openssl?
Trying to run this simple program #include <openssl/ssl.h> int main() { printf("version: %s\n",
How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention?
I have a shared library that i wish to link an executable against using gcc. the shared library has a nonstandard name not of the form libname.so,
What libraries do I need to link my mixed-mode application to?
I'm integrating .net support into our c++ application. it's an old-school mfc application, with 1 extra file compiled with the "/clr" option
Undefined reference linking error when using &MyClass::MyFunction
This just has me stumped, so i thought i'd query here: i have a class as follows: class myclass { public: void
C incomplete types: linker doesn't warn about obvious error
A file main.c declares a function of the incomplete type int func(), then uses it as int func(void).
Ad
Is '#include "file2.c"' different from 'gcc file1.c file2.c'?
Is there any reason to prefer linker commands over include directives if you don't plan on recompiling the included files
A little trouble with g++ compiling makefile
I've got the following makefile: test_containers: containers.o g++ out/containers.o test/test_containers.cpp -o
Guarantees on the Object lifetime of inline static Meyers singleton, with explicit placement in a section?
I have inherited some code that compiles fine under g++ 9 and 10, but gives a runtime error for both compilers when optimization is turned on
C++ Linking Errors: Undefined symbols using a templated class
I'm getting some really wierd linking errors from a class i wrote. i am completely unable to find anything that will describe what is happening.
g++ undefined reference to typeinfo
I just ran across the following error (and found the solution online, but it's not present in stack overflow):
linker woes - undefined reference
I'm having a problem with my compiler telling me there is an 'undefined reference to' a function i want to use in a library. let me share some
How can I find out which library is home to a given object?
I'm programming in fortran and c on an sgi running irix 6.5, but this should be applicable to all unix-like systems. how do i find which library
Can we have multiple c files to define functions for one header file?
Newbie to c and c++. i have one .h file in which some functions are declared. i'm trying to implement the functions in two separate .c
Multiple definition error of StringCchPrintfW when cross-compling with MinGW on Alpine linux
I'm cross-compiling opencascade on alpine linux for windows with mingw and run into a multiple definition linking error of
Not all of my constructors are being imported?
I'm making a heap class to be importable with heap.h and my constructors including bool types do not work, yet every other
Linking shared library libGLES_mali.so causes dlopen failed: library "[email protected]" not found in Android >= 7.0
Since android 7.0 it's not possible anymore to link against a non-ndk shared library (see
Ad
LNK2019: unresolved external symbol - linking .h files with .cpp (definition) files in Visual Studio 2022 isn't working
Okay, so i'm currently a beginner programmer for c++ (year 11 in school, 3rd year of high school but we're still studying basic functions, so
A linking error when building APK files of QML apps
I use qt 5.12 on a windows 7 x64 machine and below is the devices on qt creator 4.8:
Android resource linking failed..... error: failed linking references
My android app got unpublished from google play because there were a lot of permissions in the project. but now i need to update my project and
How to use a static library with node-gyp on Windows?
I am trying to link a static library using node-gyp in order to use it as a native node addon. however, when i run
Can I extern the entire namespace?
Is there a method to declare a namespace with the extern modifier so that the namespace's entire content is externally linked?
Why are there multiple libgcc.a shipped with android NDK, which one should be used to link with?
Android ndk 17 (and i assume earlier versions too), contains multiple versions of libgcc.a:
Does Android compiler honor -Wall?
I'm trying to build a shared object with the following recipe in our
Creating a standalone, relocatable build of postgres
For a small project i'm working on, i would like to create a “relocatable build” of postgresql, similar to the binaries
Xcode returns linker error "library not found for -lFirebaseAuth"
I wanted to test firebase initial app on unity. i made a build from unity in macos and in xcode project folder, i have runned the pod command
Linker errors in GoogleMobileVision when using Firebase ML Kit on iOS without cocapods
I am trying to add the mlvisiontextmodel of firebase 5.0.1 into an xcode project without cocoapods. i have added all the dependent frameworks as
Linker errors with external NDK library that needs 'cpufeatures'
I'm trying to build and link freeimage to an android project. i'm close but i'm tripping up on some linker errors from that library. i'm
Ad
cmake to link to dll without lib
I've been given a dll without libs. the dll comes with hpp and h files. i used dumpbin to create an exports.def file and lib to create a
Running Ruby in C compile and link issues
I've been trying all day to build and run a simple ruby inside of c program. this is a recurring topic here, and none of them are identical
ldd shows libm.so.6 but still linking with -lm is needed
I built a library and ldd shows that it references libm.so.6: ldd liba.so ...
Issues Linking pcap.p when libpcap is installed on my Ubuntu
I found a handy packet capture program in c and went
arm-none-eabi-gcc: error: unrecognized command line option '--cref'; did you mean '--xref'?
I am using arm-none-eabi-gcc for stm32 i am trying to generate cross-reference table by passing option '--cref' to the linker, but i get this
How to combine gcc flags -o and -MM correctly?
During compilation and linking of a simple program, i encountered a weird behavior of gcc that i cannot explain. this here
Static function/variable in .c file
Most explanations that i come across describing why the static keyword is used on global functions or variables describe its effect as the
How to bind Python to C++ code that includes Jsoncpp?
Working on a code that enables python to call a c++ code compiled into shared library file (.so file) via python's
Defaulting non-startup modules to new section in custom linker script
I'm attempting to create a custom linker script that takes all functions except main and the internal startup functions and put them
confused about compile time constants
As i read in a c++ book, the process of gcc is: pre-processing, compiling, assembling and linking. there are compile
version `libssl.so.10' not found
On ubuntu 18.04 with apt install i installed libssl1.0.0 and libssl1.0-dev. the following shared
Ad
Share sizeof(array) between two modules
I want to share the value of sizeof(array) between two .c modules. the array is initialized in file a, so compiler knows the size at
Undefined reference in a custom ELF file, but the symbol is defined in the files symbol table
I have been trying to learn about x86-64 machine code and elf files. for that purpose i wrote some code to generate an elf file with some machine
How do I create a library in C?
I am working on a program that is using libgit2. i had kept the code in a single c file. say: somefile.c i compile and use it. now i
odd linker error occuring when making program: 'multiple definition of `fnames'; src/main.o:(.data.rel.local+0x0): first defined here'
So i am programming a program that grew so much that i decided to create many files for this project (as i have done before). after creating 2
C function shadowing: why does this example not work?
By experimenting with this simple code: #include <stdio.h> #include <stdlib.h> #include <math.h> double sin
Using dlsym() to stub malloc/free leads to segmentation fault
I started to dabble in unit testing c code (using check) and stubbing functions. i am trying to unit test a small library of data structures that
Should every function in C have its own .c file ? or can i put all the functions of my program in one .c file?
I'm new to c programming and i just started studying functions. should i put each function in a .c and .h file, or can i put all of the functions
Linker --whole-archive option
I am using c language. i am linking static libraries with --whole-archive. linker is
Why wrong function was linked by the linker?
I am very confused about the following situation: i have linux project (which is written in c) that uses a static library a to get an
Few basic GCC flag questions
I'm trying to complie and run my c program. the program uses threads. i'm running windows 10 using wsl with ubuntu terminal. (also trying it with
Ad
Xcode: Undefined symbol: _omp_get_max_threads
I'm trying to use openmp in c with xcode 11.4. i have installed libomp with homebrew, and homebrew apparently installed it in:
Can gcc's linker fold multiple instantiations of a static function in a C header into a single instance?
The embedded c code i'm writing has numerous (i.e. >100) small static accessor functions defined in headers, but i'd be uncomfortable moving them
Is it possible to link against .symtab table symbols in an executable file?
Given below main.c: #include <stdio.h> void test() { printf("test()\n"); } int
In Which memory segment we shall find the memory address of a function in C
Function pointers points the address of a function in c. that means a function has a memory address and it will be part of any of the memory
Linking with a static library
I am having trouble in linking with a static library i created. here is my directory structure: test ├── b.c ├── b.o
Error in linking paho mqtt c with arm-none-linux-gnueabi-gcc and arm-none-linux-gnueabi-g++
I have the arm-none-linux-gnueabi in the below give path and the same compiler is used to build my target file,
Link an ELF binary with a c program
Given only access to a standalone elf program i want to be able to call a function within the program from my own program. let's say the below
Strange problem when trying to link C code against ICU Unicode libraries on Linux
I have been playing around with the icu unicode libraries and i recently encountered some strange linking errors that have stumped me.
Why do ld, nm, objdump report 'no symbols' in this shared object, when symbols appear to exist?
I have an undocumented shared object, libxsal.so, which i would like
linking succeeds with clang but not gcc (-llzma on Debian bullseye amd64)
On debian bullseye (testing), with these xz/lzma-related packages installed: ii liblzma-dev:amd64 5.2.4-1+b1
Setting stack size in cmake with gcc
I am building a c++ project on linux using gcc 9.2 and cmake 3.15, and i need to increase the default stack size. i found many
Ad
Why am I getting `undefined reference to xxx` errors when all libraries and references needed are accounted for?
Essentially i am trying to use the redland rdf libraries but i cannot link to them.
undefined reference to `WinMain` while compiling my own kernel
I've started writing my very own kernel and am developing on windows 10. i am using the following tools: gcc 8.1.0 elf
Why does weak attribute in gcc work differently in static library than for object files?
On stack overflow there are numerous threads of people confused with linking weak symbols to the static library. in short, when using only object
Where/When to link against the "Standard C Library" when compiling C programs?
On some platforms like microsoft windows no need to link against the "standard c library" with -lc flag, but on some other
Create function with a duplicate name
I'm tasked with creating a popen() function using pipes, which i have already completed. the catch is that the function must also be
If GCC only finds a static library and not a dynamic one, does it resort to static linking the found file?
Please consider the following command: gcc myfile.c -o myapp.exe -lmydir -lmylib mydir inclues the
G++ 4.9.2 and 8.2.0 - final binary's dependency with default lib path searching ./../lib directory (implicit RPATH issue)
I encountered an odd difference between the binary produced by a 4.9.2 g++ and a 8.2.0 g++ on a linux, when upgrading from the former to the
How to place multiple const objects from multiple translation units sorted in one memory block?
I am developing firmware for some devices and each of them contain configuration objects which values are allowed to be changed by an external
IAR Workbench Error [Li005] while copying files between examples
I'm having the following errors: error[li005]: no definition for "mfs_uart_init" [referenced from
Redefining initial stack pointer value for stm32f3
I have an stm32f303 discovery board, and i'm trying to understand the linking and relocating process more. i'm compiling and running this example
Do libraries compiled with MinGW work with MSVC?
Problem: i would use a mingw library in visual studio project. how my system is built: i
Ad
clang not recognizing unitialized pointer found in static library
I've found a curiosity when compiling with clang (on a macbook, if it helps). suppose i have two files: blah.c
I'm trying to put link to some text but it is not working. I think something is overlapping in css but i won't understand it. could you take a look
Hyperlink is not working. i think there is some problem with css. can anyone please overlook and help with this? ignore this how
Linking with GameNetworkingSockets library on Windows gives "unresolved external" error
I have a cmake c++ project that uses some third party library
Method ViewModel.Init receives null as parameters when linker "Link All" enabled in MvvmCross at iOS
I am facing such problem: in mvvmcross 4.4.0 on ios project when i have changed linker mode from "link only
How to recover from lost source code?
I have a one-function dll that exports gethash(). however, the source code for this dll is lost. i need to integrate this code into my msvc++
Why Am I Getting Link Errors When Calling Function in Math.h?
When attempting to call functions in math.h, i'm getting link errors like the following undefined reference to sqrt
Best practices for debugging linking errors
When building projects in c++, i've found debugging linking errors to be tricky, especially when picking up other people's code. what strategies
Why does fatal error "LNK1104: cannot open file 'C:Program.obj'" occur when I compile a C++ project in Visual Studio?
I've created a new c++ project in visual studio 2008. no code has been written yet; only project settings have been changed. when i
Error exporting symbol when building Python C Extension in Windows
I'm working on porting a python module to windows. i have a toy example as follows. the folder structure is: foo/
How to edit load command in Mach-O file and successfully link it on tvOS?
Let's assume that i have a .a fat library which is built for several architectures (e.g. armv7, armv7s, i386, x86_64, arm64). library is built for
ADAL iOS: Instance method in category overrides method from class (linker warning)
My setup: i'm using adal via
Ad
Blog Categories
Ad