linker-errors

Including one Xcode project in another — linker errors

こ雲淡風輕ζ 提交于 2019-11-27 08:36:46
问题 I am trying to do this, and running into problems. The parent project needs to access the class SettingsViewController from the child project. I have put the child project path into my header search paths. Everything compiles OK, but I get linker errors, as follows: Undefined symbols: "_OBJC_METACLASS_$_SettingsViewController", referenced from: _OBJC_METACLASS_$_StatisticsViewController in StatisticsViewController.o "_OBJC_CLASS_$_SettingsViewController", referenced from: objc-class-ref-to

Exporting static data in a DLL

守給你的承諾、 提交于 2019-11-27 08:14:37
I have a DLL which contains a class with static members . I use __declspec(dllexport) in order to make use of this class's methods . But when I link it to another project and try to compile it, I get "unresolved external symbol" errors for the static data. e.g. In DLL, Test.h class __declspec(dllexport) Test{ protected: static int d; public: static void m(){int x = a;} } In DLL, Test.cpp #include "Test.h" int Test::d; In the application which uses Test, I call m(). I also tried using __declspec(dllexport) for each method separately but I still get the same link errors for the static members.

Multiple definition of … linker error

做~自己de王妃 提交于 2019-11-27 08:12:44
I defined a special file: config.h My project also has files: t.c, t.h pp.c, pp.h b.c b.h l.cpp and #includes: in t.c: #include "t.h" #include "b.h" #include "pp.h" #include "config.h" in b.c: #include "b.h" #include "pp.h" in pp.c: #include "pp.h" #include "config.h" in l.cpp: #include "pp.h" #include "t.h" #include "config.h" there are no include directives in my *.h files, only in *.c files. I defined this in config.h: const char *names[i] = { "brian", "stefan", "steve" }; and need that array in l.cpp, t.c, pp.c but Im getting this error: pp.o:(.data+0x0): multiple definition of `names' l.o

Linker error when using static members

梦想与她 提交于 2019-11-27 08:11:14
问题 I'm using Qt 4.7 and Cmake 2.8.3 with g++ 4.2.1 on Mac OS X. I'm getting a bizarre linker error when using static or global variables in one of my files. Here's the error: ld: duplicate symbol ColorTrail::calculateColorUniformLocation in CMakeFiles/GLBall.dir/src/DesktopMain.cpp.o and CMakeFiles/GLBall.dir/src/ColorTrail.cpp.o collect2: ld returned 1 exit status calculateColorUniformLocation is a static member of class ColorTrail... but its not even used in DesktopMain.cpp at all! Here's what

crypt function and link error “undefined reference to 'crypt'”

流过昼夜 提交于 2019-11-27 07:50:17
问题 I have used the crypt function in c to encrypt the given string. I have written the following code, #include<stdio.h> #include<unistd.h> int main() { printf("%s\n",crypt("passwd",1000)); } But the above code threw an error ,"undefined reference to `crypt'". What is the problem in the above code. Thanks in advance. 回答1: If you want to use the crypt() function, you need to link to the library that supplies it. Add -lcrypt to your compile command. Older versions of glibc supplied a libcrypt

file was built for archive which is not the architecture being linked (i386)

泪湿孤枕 提交于 2019-11-27 07:21:31
I got to build static library. I want to use in my iPhone and ipad app. When I try to run the simulator I get linking errrors. I am new to iOS development. kindly help; ld: warning: ignoring file /Users/valuelabs/Desktop/DruvaProject/libraries/libnetUtils.a, file was built for archive which is not the architecture being linked (i386) Undefined symbols for architecture i386: "_OBJC_CLASS_$_netUtils", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) I tried adding i386

linking errors while separate parser using boost spirit x3

廉价感情. 提交于 2019-11-27 06:25:33
问题 I am currentyl trying to separate my boost spirit x3 parser into different _def and .cpp files using BOOST_SPIRIT_DEFINE/DECLARE/INSTANTIATE , but I keep getting a linking error. HERE is my parser which is separated. The linker error reads <artificial>:(.text.startup+0xbb): undefined reference to `bool kyle::parser::impl::parse_rule<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::spirit::x3::context<boost::spirit:

Simple C inline linker error

纵饮孤独 提交于 2019-11-27 06:14:06
问题 simple problem: given the following program: #include <stdio.h> inline void addEmUp(int a, int b, int * result) { if (result) { *result = a+b; } } int main(int argc, const char * argv[]) { int i; addEmUp(1, 2, &i); return 0; } I get a linker error... Undefined symbols for architecture x86_64: _addEmUp", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) seems as though it doesn't

How to link during Matlab's MEX compilation

对着背影说爱祢 提交于 2019-11-27 06:07:11
问题 I've written a program of the following form: #include "stuff_I_need.h" int main(){ construct_array(); // uses OpenMP pragma's print_array(); return(0); } that compiles, links, and runs correctly with the following command: `gcc44 -I/home/matteson/sundials/include/ main.c -lm -L/home/matteson/sundials/lib -lsundials_cvode -lsundials_nvecserial -fopenmp -o /home/matteson/MPI_test/CVODE_test/main_test` "gcc44" is simply gcc version 4.4 and is named like this because it's being compiled on a

undefined reference to `strlwr' [closed]

♀尐吖头ヾ 提交于 2019-11-27 05:08:18
My code is like a text compressor, reading normal text and turns into numbers, every word has a number. It compiles in DevC++ but does not end, however, it does not compile in Ubuntu 13.10. I'm getting an error like in the title in Ubuntu "undefined reference to `strlwr'", my code is a little long so I am not able to post it here, but one of the error is from here: //operatinal funcitons here int main() { int i = 0, select; char filename[50], textword[40], find[20], insert[20], delete[20]; FILE *fp, *fp2, *fp3; printf("Enter the file name: "); fflush(stdout); scanf("%s", filename); fp = fopen