linker

Failed to resolve Android.App.fragment with link SDK assemblies only enabled

余生长醉 提交于 2019-12-24 03:55:29
问题 I'm getting the following error after adding Google Play Services to my application. I have Link SDK Assms Only enabled and it is critical to keep it enabled. Sample here: https://dl.dropboxusercontent.com/u/19503836/so_googlemaptest.droid.zip C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly. Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment at Mono.Linker.Steps.MarkStep

GTK+ compilation undefined reference C

为君一笑 提交于 2019-12-24 03:42:59
问题 I'm trying to compile and link a simple program downloaded from the web to learn how to make a GUI using the gtk+ library. Here is my makefile: CC = gcc BIN = gtk_led SRC = main.c gtkled.c OBJ = main.o gtkled.o CPPFLAGS =-Wall -W -ansi -pedantic -O2 `pkg-config --cflags gtk+-2.0` LDFLAGS = `pkg-config --libs gtk+-2.0` all: $(BIN) $(BIN): $(SRC) $(CC) $(CPPFLAGS) -c $(SRC) $(CC) $(LDFLAGS) -o $(BIN) $(OBJ) clean: rm -f *.o *~ core $(BIN) When I do make , the build fails with the following

How Linkers Resolve Multiply Defined Global Symbols in C

夙愿已清 提交于 2019-12-24 03:37:54
问题 My Textbook says that: "Functions and initialized global variables get strong symbols. Uninitialized global variables get weak symbols.Given a strong symbol and multiple weak symbols, choose the strong symbol" So I create two files to see: file1.c: int number; int main(int argc, char *argv[]) { printf("%d",number); return 0; } file2.c (just one line): int number = 2018; and I ran gcc -Wall -o program file1.c file2.c and the output is 0, which I can understand before I study linker ('number'

How do I link Allegro 5 from my Makefile?

萝らか妹 提交于 2019-12-24 03:35:23
问题 I need to link the Allegro Game Development Library from my Makefile . When I do this, the compiler returns: Undefinied Reference < Function Name >. 回答1: Before trying to embed the compilation line into the Makefile, make sure you understand how to do it the command line, and more important, make sure it works: g++ hello.cpp -o hello -I/usr/include/allegro5 -L/usr/lib -lallegro Then, a simple Makefile to compile hello.cpp could be: CXX=g++ CFLAGS= LDFLAGS=-L/usr/lib -lallegro INCLUDE=-I. -I

How do I add --whole-archive linker option in scons?

谁都会走 提交于 2019-12-24 03:30:28
问题 I have a library that only interacts in static scope with an application. This requires me to link the library with the --whole-archive option to avoid the linker from "optimizing" out the library (this is done because the linker never actually sees my library being used). The issue is that I haven't found a way to add this linker option for a specific library in scons. env.Append(LIBS=['mylib']) #I don't have the linker option env.Append(LINKFLAGS=['-Wl,--whole-archive','-lmylib']) #I don't

Difference between input and output sections in a linkerfile?

为君一笑 提交于 2019-12-24 03:09:38
问题 While it could be clear in the context of a resulting binary or ELF file what is a section, many places in documentation (independently of the compiler used) refers them as to Input or Output sections. What are the differences between these? 回答1: The linker consumes object files (and possibly shared libraries) and outputs an executable or shared library. The input object files are composed of named sections - .text , .data , .rodata , .bss , etc. So is the output file. It is a principal part

undefined reference to c++ class constructor [duplicate]

五迷三道 提交于 2019-12-24 03:08:20
问题 This question already has answers here : Why can templates only be implemented in the header file? (16 answers) Closed 6 years ago . i am using Qt5 creator , all the files are included in the project (the class "MyCounter" is created using the IDE wizard) i reduced my code to this one, and when i compile and run: undefined reference to MyCounter<int>::MyCounter() main.cpp #include <QCoreApplication> #include"mycounter.h" //if include "mycounter.cpp" instead of "mycounter.h" works fine int

Gcc fails to recognize `-I../path`

丶灬走出姿态 提交于 2019-12-24 02:52:33
问题 I have a problem with linking and gcc, probably resulting from a stupid mistake on my side. Drawing from this post Header files linked to from header file not found, I tried the -I option to inlcude header files, but gcc just does not seem to recognize the parameter. ~/Documents/projects/opencl/NVIDIA_GPU_Computing_SDK/src_l$ gcc opencl_hello_world.c –I../OpenCL/common/inc/CL/ –L/usr/local/cuda/lib –lOpenCL gcc: –I../OpenCL/common/inc/CL/: No such file or directory gcc: –L/usr/local/cuda/lib:

Linker error when operator== is a friend [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-24 02:37:29
问题 This question already has answers here : overloading friend operator<< for template class (5 answers) Closed 4 years ago . The following code is a minimum code to reproduce my problem. When I try to compile it, the linker can not find operator== for Config : Undefined symbols for architecture x86_64: "operator==(Config<2> const&, Config<2> const&)", referenced from: _main in test2.o The operator== is a friend of Config . BUT when I do no longer declare operator== as a friend, the code

Undefined reference to boost::system::generic_category despite linking with boost_system [duplicate]

元气小坏坏 提交于 2019-12-24 02:30:33
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (32 answers) Closed 4 years ago . My compilation command is: g++ -I/home/foo/boost_1_56_0 -L/home/foo/boost_1_56_0/stage/lib -lboost_system -lboost_filesystem -lpthread -lboost_thread -lboost_system -lboost_filesystem -lpthread -lboost_thread main.cpp foo.cpp I get an undefined reference to boost::system::generic_category error despite the fact that I link it with