linker-errors

error LNK2001: unresolved external symbol public: static class [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-24 07:29:04
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (32 answers) Closed 5 years ago . I cannot figure out why i am recieving this error. Can anyone lend a hand. I need to declare VideoCapture capture in the header file and call it in Video.cpp Video.h class Video { public: static VideoCapture capture; //Default constructor Video(); //Declare a virtual destructor: virtual ~Video(); //Method void Start(); private: };

Link errors when building websocketpp with examples

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 05:52:43
问题 I'm having problems building websocketpp with examples on Windows 10. Here is what I do: I first open the CMake GUI, and specify "D:/third-party-software/websocketpp" (which is the directory to which I have cloned websocketpp) as the location of the source code and "D:/third-party-software/websocketpp/build" as the place to build the binaries. Then I press the button Configure , which asks me if I want to create the build folder, which I choose to do, and then which generator I want to use

Link error while using MinGW compiler (can't find __main)

别等时光非礼了梦想. 提交于 2019-12-24 04:37:06
问题 I'm trying to compile a very simple program with MinGW on Windows, but I still got link errors. The program to be compiled is just C++ hello world. Z:\dev>type test.cpp #include <iostream> int main() { std::cout << "Hello World!\n"; return 0; } Of course, just using MinGW's g++ is okay. Z:\dev>g++ test.cpp -o test.exe Z:\dev>test.exe Hello World! However, I tried to separate compilation and linking, but failed. Z:\dev>g++ -c test.cpp -o test.o Z:\dev>ld test.o -o test.exe test.o:test.cpp:(

Unresolved external symbol with operator overloading and templates

僤鯓⒐⒋嵵緔 提交于 2019-12-24 03:15:06
问题 In trying to compile this program: namespace MyNamespace { template<typename T> class Test { public: class Inner { int x; public: Inner() : x(0) { } friend Inner& operator++(Inner& rhs); }; Inner i; }; } template<typename T> typename MyNamespace::Test<T>::Inner& operator++(typename MyNamespace::Test<T>::Inner& rhs) { rhs = MyNamespace::Test<T>::Inner(rhs.x + 1); return rhs; } int main() { MyNamespace::Test<int> t; MyNamespace::Test<int>::Inner i = t.i; ++i; } I get the error unresolved

Linker command failed with exit code 1 (use -v to see invocation) with Swift 3

老子叫甜甜 提交于 2019-12-24 03:11:08
问题 I am working on building a Swift library and am hosting it on GitHub. All was going fine until I added BluetoothKit to the project. I then got an Apple Mach-O Linker Error: ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/Developer/Library/Frameworks' ld: /Users/calebklevetertest/Library/Developer/Xcode/DerivedData/Napalm-dblvhbjdwovurocsvzrzaxzkjjyw/Build/Products/Debug

Visual C++ LNK2019 error

99封情书 提交于 2019-12-24 03:04:08
问题 Using Microsoft Visual C++ I am trying to compile the file "test.cc" which is part of a small package available for free download at http://sourceforge.net/projects/clippoly/files/ The file test.cc appears as follows: // nclip: a polygon clip library // Copyright (C) 1993 University of Twente // klamer@mi.el.utwente.nl // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software

Why does my program fail to link?

≯℡__Kan透↙ 提交于 2019-12-24 02:15:27
问题 I'm doing a opengl program, and found an example that does what I want, but when I try to compile it, using gcc -o picksquare picksquare.c -lglut I get: /tmp/cchE9Z0Y.o: In function `pickSquares': picksquare.c:(.text+0x41d): undefined reference to `gluPickMatrix' picksquare.c:(.text+0x442): undefined reference to `gluOrtho2D' /tmp/cchE9Z0Y.o: In function `reshape': picksquare.c:(.text+0x508): undefined reference to `gluOrtho2D' collect2: ld returned 1 exit status And the code example is here:

linking error in gtk2 application in ubuntu 12.04

ぐ巨炮叔叔 提交于 2019-12-24 02:02:46
问题 I've a C GUI application (in GTK+2.0 ) that I used to link as follows : gcc -O2 -std=gnu99 -pipe -Wall -lm `pkg-congig gtk+-2.0 `pkg-config --libs gtk+-2.0` -o exec a.o b.o c.o which eventually converted into : gcc -O2 -std=gnu99 -pipe -Wall -lm -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64 linux

C++ MySQL Linker Error

允我心安 提交于 2019-12-24 01:19:36
问题 I have been trying to fetch some values from a database, so I downloaded & installed this. I included the needed headers and faced this linker errors. (I'm also using boost.) error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall sql::SQLException::getSQLState(void)const " (__imp_?getSQLState@SQLException@sql@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2

Updating CMake (seems to have) broke my program

核能气质少年 提交于 2019-12-23 20:32:13
问题 I updated from CMake 3.6 to whatever the latest version is (3.12.0-rc2) and now one of my programs won't compile. The weird thing is, the error message shows undefined symbols from in the standard library itself. Here's the error message: Undefined symbols for architecture x86_64: "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(char const*)", referenced from: GetName() in ncc.cpp.o Expression() in ncc.cpp.o Term() in ncc.cpp.o GetNum() in