linker-errors

Linker errors with Fortran to C library - /usr/lib/libf2c.so: undefined reference to 'MAIN__'

北城余情 提交于 2019-12-01 21:33:40
So I'm having a little trouble with the fortran to C library. Now, before I get into the problem, I can tell you that I cannot use g2c as some forum sites have suggested. Now, to the problem. When I try to compile a very large project, I get the following: [from the makefile...] g++ -L [~200 dirs] -l [~200 libs] -lf2c /usr/lib/libf2c.so: undefined reference to 'MAIN__' collect2: ld returned 1 exit status make: *** [all] Error 1 Now, I have checked my /usr/lib directory and have come up with the following: $ locate libf2c /usr/lib/libf2c.so /usr/lib/libf2c.so.0 /usr/lib/libf2c.so.0.22 So at the

Undefined reference to `kill'

只谈情不闲聊 提交于 2019-12-01 20:36:44
I developed an application for an ARM7 embedded system in C. Now I want to compile and link it with C++ in order to use some C++ features. To do this, I am using mipsel-elf-g++ instead of mipsel-elf-gcc . I can compile my code with mipsel-elf-g++ successfully, but in linking step I get the errors: /opt/mipsel/lib/gcc/mipsel-elf/3.4.6/../../../../mipsel-elf/lib/libc.a(lib_a-abort.o): In function ```abort': /cygdrive/d/Files/cross/mips/newlib-1.15.0/newlib/libc/stdlib/abort.c:63: undefined reference to _exit'` /opt/mipsel/lib/gcc/mipsel-elf/3.4.6/../../../../mipsel-elf/lib/libc.a(lib_a-signalr.o

Linker error when using a template class? [duplicate]

本秂侑毒 提交于 2019-12-01 18:50:01
This question already has an answer here: Why can templates only be implemented in the header file? 16 answers I'm getting an "unresolved external symbol "public:__thiscall hijo<int>::hijo<int>(void)" referenced in function_main I started a new project cause I was having this same error on another larger project. The error occur when I try to allocate space using the new keyword. If this error is silly please forgive me cause I haven't programmed anything in the last months. /********************file hijo.h******************/ #pragma once #ifndef hijo_h #define hijo_h template <class A> class

linker error “relocation R_X86_64_PC32 against undefined symbol” despite compilation with -fPIC

妖精的绣舞 提交于 2019-12-01 17:27:26
问题 I'm compiling a c++ program using the command line g++ -c prog.cc -std=c++11 -march=native -fPIC -fopenmp and then try to make a shared object via g++ prog.o -shared -fopenmp -o lib/libprog.so This has always worked. But today I get: /usr/bin/ld: prog.o: relocation R_X86_64_PC32 against undefined symbol `_ZTVN12_GLOBAL__N_111handle_baseE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status The

Does the JVM throw if an unused class is absent?

▼魔方 西西 提交于 2019-12-01 16:52:10
Consider the program: public class Test { public static void main(String[] args) { if (Arrays.asList(args).contains("--withFoo")) { use(new Foo()); } } static void use(Foo foo) { // do something with foo } } Is Foo required in the runtime classpath if the program is launched without arguments? Research The Java Language Specification is rather vague when Linkage Errors are reported: This specification allows an implementation flexibility as to when linking activities (and, because of recursion, loading) take place, provided that the semantics of the Java programming language are respected,

duplicate symbols for architecture x86_64 (Implementing FBSDKCoreKilt) Swift

浪尽此生 提交于 2019-12-01 16:14:49
This is the most horrifying error that I've dealt with so far. To be clear: This is in swift so it's not a ".h" ".m" issue My compile sources is so tiny, there are no duplicates there. I have redownloaded the SDK several times but it never works. The project only has two frameworks in it: FBSDKCoreKit and LoginKit Any ideas? What is duplicated? duplicate symbol _llvm.cmdline in: /Users/charleswesleycho/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKAccessToken.o) /Users/charleswesleycho/Documents/FacebookSDK/FBSDKLoginKit.framework/FBSDKLoginKit(FBSDKLoginButton.o) duplicate

C++ : Extern C Functions inside a Namespace

坚强是说给别人听的谎言 提交于 2019-12-01 15:02:17
I have to link two libraries, say A and B. Some of the files are common in both libraries. So, I declare functions in library A inside a namespace, say abc. So, in A and B, a function func looks like below: [ in A] namespace abc { extern "C" void func(); } [in B] extern "C" void func(); While building the project, compiler throws linking errors saying multiple definitions of function func. Isn't the function func in A inside the namespace or is there some problem with extern "C" functions. If there is, then how can I differentiate them both? When you use Extern "C" you are turning off name

Does the JVM throw if an unused class is absent?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 14:43:36
问题 Consider the program: public class Test { public static void main(String[] args) { if (Arrays.asList(args).contains("--withFoo")) { use(new Foo()); } } static void use(Foo foo) { // do something with foo } } Is Foo required in the runtime classpath if the program is launched without arguments? Research The Java Language Specification is rather vague when Linkage Errors are reported: This specification allows an implementation flexibility as to when linking activities (and, because of

C++ : Extern C Functions inside a Namespace

烈酒焚心 提交于 2019-12-01 14:40:10
问题 I have to link two libraries, say A and B. Some of the files are common in both libraries. So, I declare functions in library A inside a namespace, say abc. So, in A and B, a function func looks like below: [ in A] namespace abc { extern "C" void func(); } [in B] extern "C" void func(); While building the project, compiler throws linking errors saying multiple definitions of function func. Isn't the function func in A inside the namespace or is there some problem with extern "C" functions. If

Boost::system link error on Ubuntu

不问归期 提交于 2019-12-01 11:45:54
I'm trying to compile the following c++ code that implements Context Tree Switching ( More info on the download page ): Zip archive, 0.2 MB which requires some boost libraries. I download the latest version from boost.org and built all libraries that needed building following the instructions on the website. I also modified the makefile included in the archive to add the boost lib path and boost_system, but I still get an error. Here's the makefile i'm using: PROGRAM = cts SOURCES = $(wildcard *.cpp) OBJECTS = $(SOURCES:.cpp=.o) CFLAGS = -Wall LDFLAGS = -lboost_program_options -lboost