linker-errors

error during making GTest

十年热恋 提交于 2019-11-28 22:26:54
I was trying to set up GTest environment on my Ubuntu machine. but while making the GTest to get the library, i get the following error... som@som-VPCEH25EN:~/Workspace/CPP/gtest-1.6.0/make$ make g++ -I../include -g -Wall -Wextra -lpthread sample1.o sample1_unittest.o gtest_main.a -o sample1_unittest gtest_main.a(gtest-all.o): In function `~ThreadLocal': /home/som/Workspace/CPP/gtest-1.6.0/make/../include/gtest/internal/gtest-port.h:1336: undefined reference to `pthread_getspecific' /home/som/Workspace/CPP/gtest-1.6.0/make/../include/gtest/internal/gtest-port.h:1340: undefined reference to

Undefined reference to 'vtable for xxx'

为君一笑 提交于 2019-11-28 20:40:26
问题 takeaway.o: In function `takeaway': project:145: undefined reference to `vtable for takeaway' project:145: undefined reference to `vtable for takeaway' takeaway.o: In function `~takeaway': project:151: undefined reference to `vtable for takeaway' project:151: undefined reference to `vtable for takeaway' takeaway.o: In function `gameCore': project.h:109: undefined reference to `gameCore<int>::initialData(int)' collect2: ld returned 1 exit status make: *** [takeaway] Error 1 I keep getting this

C++ - LNK2019 error unresolved external symbol [template class's constructor and destructor] referenced in function _main

笑着哭i 提交于 2019-11-28 19:39:53
[[UPDATE]] -> If I #include "Queue.cpp" in my program.cpp, it works just fine. This shouldn't be necessary, right? Hey all -- I'm using Visual Studio 2010 and having trouble linking a quick-and-dirty Queue implementation. I started with an empty Win32 Console Application, and all files are present in the project. For verbosity, here's the complete code to duplicate my error. I realize some of the code may, in fact, be wrong. I haven't had a chance to test it yet because I haven't yet been able to link it. Queue.hpp #ifndef ERROR_CODE #define ERROR_CODE enum Error_Code { Success, Underflow,

Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file

三世轮回 提交于 2019-11-28 19:08:13
I'm having trouble with the linking of my files. Basically, my program consists of: The main program, gen1 . gen1 - receives input sends to str2value for processing, outputs results str2value , breaks input into tokens using "tokenizer" determines what sort of processing to do to each token, and passes them off to str2num , or str2cmd . It then returns an array of the results. str2num - does some processing str2cmd - ditto author.py - a python script that generates str2cmd.c and str2cmd.h from a header cmdTable.h . I'm pretty sure I have my includes right, I've checked a couple of times. I've

“File not found”, “linker command failed with exit code 1” in Xcode 4.5.1

痴心易碎 提交于 2019-11-28 17:50:44
Am developing an existing iOS application and I have to write unit test cases for this project. It is building and running in Simulator 6.0. Whenever I try to test the project, it is showing the error message below. Am not able to figure the exact error. id: file not found: /Users/Yuva/Library/Developer/Xcode/DerivedData/FlyApp-aexukpgtbathuadgxlnm/Build/Products/Debug-iphonesimulator/FlyApp.app/FlyApp clag: error: linker command failed with exit code 1 (use -v to see invocation) Could you please help me to solve this linker error and test the app? This error driven me crazy for 1.30 hrs I

Symbol not found: kUTTypeImage

蓝咒 提交于 2019-11-28 17:18:05
问题 I copied some bits of code from apple's documentation- and I got these 2 errors: Undefined symbols for architecture i386: "_kUTTypeImage", referenced from: -[ImagePicker imagePickerController:didFinishPickingMediaWithInfo:] in ImagePicker.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) What am I doing wrong? EDIT: The code: - (IBAction) showSavedMediaBrowser { [self startMediaBrowserFromViewController: self

Lua on the iPhone?

半城伤御伤魂 提交于 2019-11-28 16:15:35
I am trying to use Lua on the iPhone. On Mac OS X, in a normal (non-iOS) Cocoa application, I used the following code: lua_State* l; l = lua_open(); luaL_openlibs(l); luaL_loadstring(l, "print(\"Hi from Lua\");"); lua_pcall(l, 0, 0, 0); I downloaded Lua 5.1.4 from lua.org/ftp and compiled it for Mac OS X. In the Xcode project, I used "Add Existing Framework" to add liblua.a and I used "Add Existing Files" to add the include directory. This works as expected, and prints the string: "Hi from Lua". When I try the same thing in an iOS project, it gives the errors: "_luaL_newstate", referenced from

Compiling a MFC app from Visual Studio 2010 to 2012 RC results in LNK2038

天涯浪子 提交于 2019-11-28 13:42:17
My project is compiling and running OK in debug and release modes in VS 2010. Today I tried to compile it with VS 2012 and I got this error : 1> Generating Code... 1>pcrecppd.lib(pcrecpp.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in NamesEditorDlg.obj I searched for "_MSC_VER" in the code but I could not find any match. Neither could I find "1600" or "1700". So I am wondering how I can solve this problem. Looks like you're using a .lib from vc2010 in vc2012 (at a guess it looks like a PCRE library). You'll need to recompile all your .libs or

How to link during Matlab's MEX compilation

瘦欲@ 提交于 2019-11-28 11:21:21
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 cluster that maintains several versions of gcc. The libraries sundials_cvode and sundials_nvecserial are

Using gcc, I am unable to get 3rd party library, Cairo, to link/compile

微笑、不失礼 提交于 2019-11-28 09:15:02
问题 The errors that show up are for undefined symbols, not the Cairo functions I copied from the example, but what I guess are internal functions. I have looked around and tried using $(pkg-config --cflags --libs cairo), verbatim from a common online example using the terminal. I tried that after using EXPORT=(my path to cairos .ps file). I currently have one option in CodeBlocks 'Link Libraries' in the linker settings: /usr/lib/x86-linux-gnu/libcairo.a Also, I have /usr/include/cairo in my