I'm using OpenCV 2.4.6 and Visual Studio 2008 with Windows8.1 x86.
When I debug my program it signal me 9 errors:
1>FYD_control.obj : error LNK2019: unresolved external symbol "int __stdcall cv::waitKey(int)" (?waitKey#cv##YGHH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YGXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "double __stdcall cv::threshold(class cv::_InputArray const &,class cv::_OutputArray const &,double,double,int)" (?threshold#cv##YGNABV_InputArray#1#ABV_OutputArray#1#NNH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::cvtColor(class cv::_InputArray const &,class cv::_OutputArray const &,int,int)" (?cvtColor#cv##YGXABV_InputArray#1#ABV_OutputArray#1#HH#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::medianBlur(class cv::_InputArray const &,class cv::_OutputArray const &,int)" (?medianBlur#cv##YGXABV_InputArray#1#ABV_OutputArray#1#H#Z) referenced in function _main
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::fastFree(void *)" (?fastFree#cv##YGXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
1>FYD_control.obj : error LNK2019: unresolved external symbol "int __stdcall cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YGHPAHH#Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>FYD_control.obj : error LNK2019: unresolved external symbol "void __stdcall cv::error(class cv::Exception const &)" (?error#cv##YGXABVException#1##Z) referenced in function "public: int & __thiscall cv::Mat::at<int>(int,int)" (??$at#H#Mat#cv##QAEAAHHH#Z)
1>C:\Users\___________________________\Debug\FYD2_Control.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://c:\Users\_________________\Debug\BuildLog.htm"
1>FYD2_Control - 9 error(s), 0 warning(s)
I've analized everything and I've noticed that while in this errors I have
(?waitKey#cv##YGHH#Z)
(?imshow#cv##YGXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z)
(?threshold#cv##YGNABV_InputArray#1#ABV_OutputArray#1#NNH#Z)
(?cvtColor#cv##YGXABV_InputArray#1#ABV_OutputArray#1#HH#Z)
(?medianBlur#cv##YGXABV_InputArray#1#ABV_OutputArray#1#H#Z)
(?fastFree#cv##YGXPAX#Z)
(?_interlockedExchangeAdd#cv##YGHPAHH#Z)
(?error#cv##YGXABVException#1##Z)
if I analize the .lib there is the same, but with A instead the first G
(?waitKey#cv##YAHH#Z)
(?imshow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z)
(?threshold#cv##YANABV_InputArray#1#ABV_OutputArray#1#NNH#Z)
(?cvtColor#cv##YAXABV_InputArray#1#ABV_OutputArray#1#HH#Z)
(?medianBlur#cv##YAXABV_InputArray#1#ABV_OutputArray#1#H#Z)
(?fastFree#cv##YAXPAX#Z)
(?_interlockedExchangeAdd#cv##YAHPAHH#Z)
(?error#cv##YAXABVException#1##Z)
Substituting the A with G in the .lib I solve this problem, but later it gives me an other error
The procedure entry point ?fastFree#cv##YGXPAX#Z could not be
located in the dynamic link library
How can I solve this?
Sorry for my english and thank's to anyone will answer.
you have problem with linking. replacing A with G in your library wont help. Make sure that you have added all libraries in additional dependencies. Below are the most necessary lib files make sure you have included it.
highgui210d.lib
cxcore210d.lib
cv210d.lib
Once you have done this if u still get error then go to lib folder of opencv (C:\opencv\build\x86\vc12\lib) and add all the lib files to additional dependencies (right click on your project select properties->configuration properties->linker->input then on right pane locate additional dependencies then add all lib file names) of your project.
Related
I am trying to do Catch2 Unit Testing in Visual Studio. I have created a small test project to practice. When I try to compile this test project, I get a linker error. I am now trying to diagnose this linker error, but the Catch2.hpp header file contains thousands of lines of code. My hope is that someone who is more familiar with Catch2 or unit testing in general can diagnose what the issue is.
I will describe the process by which I created this project. I created a new project in a new solution. I have 4 files, all in the same directory, listed below.
The class I want to test:
//a.h
#pragma once
class A {
friend int A_Tester_Func1(A a);
public:
A(int num) : my_num_(num) {
}
private:
int my_num_;
};
The test:
//atester.cpp
#pragma once
#include "catch.hpp"
#include "a.h"
int A_Tester_Func1(A a) {
return a.my_num_;
}
TEST_CASE("a contains a positive integer", "[a]") {
//...
A a(3);
REQUIRE(A_Tester_Func1(a) == 3);
}
The main function that runs the tests:
//tester.cpp
#define CATCH_CONFIG_MAIN
#include "catch.hpp" // this should create the main function
The Catch2 Testing Framework:
// catch.hpp
/*
* Catch v2.13.2
* Generated: 2020-10-07 11:32:53.302017
*/
//~17-18k lines of code that from Catch2
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
When I try to compile this code in Visual Studio using the Local Windows Debugger button, I get a bunch of Unresolved External Symbol linker errors. I believe I read somewhere that Catch2 is "partially compiled." That may have something to do with it, but I don't know. Following this guide (StackOverflow: Best practices for Unit testing with Catch2 in Visual Studio) has worked for me, but I'm trying to understand why the small example above is not successfully linking.
I have included the linker errors below for completeness, although I feel that they will probably not be necessary for the question.
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::StringRef::StringRef(char const *)" (??0StringRef#Catch##QAE#PBD#Z) referenced in function "public: class Catch::BinaryExpr<int const &,int const &> const __thiscall Catch::ExprLhs<int const &>::operator==<int>(int const &)" (??$?8H#?$ExprLhs#ABH#Catch##QAE?BV?$BinaryExpr#ABHABH#1#ABH#Z)
1>atester.obj : error LNK2019: unresolved external symbol "struct Catch::ITestInvoker * __cdecl Catch::makeTestInvoker(void (__cdecl*)(void))" (?makeTestInvoker#Catch##YAPAUITestInvoker#1#P6AXXZ#Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::NameAndTags::NameAndTags(class Catch::StringRef const &,class Catch::StringRef const &)" (??0NameAndTags#Catch##QAE#ABVStringRef#1#0#Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::AutoReg::AutoReg(struct Catch::ITestInvoker *,struct Catch::SourceLineInfo const &,class Catch::StringRef const &,struct Catch::NameAndTags const &)" (??0AutoReg#Catch##QAE#PAUITestInvoker#1#ABUSourceLineInfo#1#ABVStringRef#1#ABUNameAndTags#1##Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Catch::AutoReg::~AutoReg(void)" (??1AutoReg#Catch##UAE#XZ) referenced in function "void __cdecl `anonymous namespace'::`dynamic atexit destructor for 'autoRegistrar1''(void)" (??__FautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::StringMaker<int,void>::convert(int)" (?convert#?$StringMaker#HX#Catch##SA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::Detail::stringify<int>(int const &)" (??$stringify#H#Detail#Catch##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABH#Z)
1>atester.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Catch::ITransientExpression::~ITransientExpression(void)" (??1ITransientExpression#Catch##UAE#XZ) referenced in function "public: virtual __thiscall Catch::BinaryExpr<int const &,int const &>::~BinaryExpr<int const &,int const &>(void)" (??1?$BinaryExpr#ABHABH#Catch##UAE#XZ)
1>atester.obj : error LNK2019: unresolved external symbol "void __cdecl Catch::formatReconstructedExpression(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Catch::StringRef,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?formatReconstructedExpression#Catch##YAXAAV?$basic_ostream#DU?$char_traits#D#std###std##ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##3#VStringRef#1#1#Z) referenced in function "private: virtual void __thiscall Catch::BinaryExpr<int const &,int const &>::streamReconstructedExpression(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?streamReconstructedExpression#?$BinaryExpr#ABHABH#Catch##EBEXAAV?$basic_ostream#DU?$char_traits#D#std###std###Z)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::AssertionHandler::AssertionHandler(class Catch::StringRef const &,struct Catch::SourceLineInfo const &,class Catch::StringRef,enum Catch::ResultDisposition::Flags)" (??0AssertionHandler#Catch##QAE#ABVStringRef#1#ABUSourceLineInfo#1#V21#W4Flags#ResultDisposition#1##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____0(void)" (?____C_A_T_C_H____T_E_S_T____0##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::handleExpr(struct Catch::ITransientExpression const &)" (?handleExpr#AssertionHandler#Catch##QAEXABUITransientExpression#2##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____0(void)" (?____C_A_T_C_H____T_E_S_T____0##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::handleUnexpectedInflightException(void)" (?handleUnexpectedInflightException#AssertionHandler#Catch##QAEXXZ) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____0##YAXXZ$0
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::complete(void)" (?complete#AssertionHandler#Catch##QAEXXZ) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____0##YAXXZ$0
1>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main##YAHXZ)
What is causing these errors? How do I fix these errors while keeping catch.hpp in the same project as my source files?
In a .cpp file, add this to make the project a Catch2 test runner:
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
Read more at Supplying main() yourself
I ran into the same problem.
You need to keep #define CATCH_CONFIG_MAIN in the first line of the file, especially before other #include.
atester.cpp must not have the #pragma once directive. It's for header files, and while it may not be your source of trouble, it simply doesn't belong. Since you're not providing enough detail (namely: where's the minimized project file?), I have to be conservative here.
It seems that tester.cpp is not part of the project that you're building. Just because it's a file that exists on disk doesn't mean it's automatically picked up. You have to manually add it to the MSVC project. That's all there's to it. I use Catch2 with MSVS all the time and that's all it takes to make it work.
I downloaded OpenCV from NuGet on MSVS 2017, and ran a code I had found on this very site:
#include "stdafx.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image = imread("C:\\Users\\Chubak\\Pictures\\index.jpg");
if (image.empty())
return -1;
imshow("TEST", image);
waitKey();
return 0;
}
But when I run the code I get this extremely unintelligible errors that I don't understand:
1>------ Build started: Project: OpenCLTest, Configuration: Debug Win32 ------
1>OpenCLTest.cpp
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray#cv##QAE#ABVMat#1##Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPAHH#Z) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey#cv##YAHH#Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow#cv##YAXABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV_InputArray#1##Z) referenced in function _main
1>OpenCLTest.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread#cv##YA?AVMat#1#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function _main
1>c:\users\chubak\documents\visual studio 2017\Projects\OpenCLTest\Debug\OpenCLTest.exe : fatal error LNK1120: 7 unresolved externals
1>Done building project "OpenCLTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I understand that unresolved externals error is related to missing obj files but don't they come with the NuGet Package?
I also found this question but all the links given in the answers are no longer working, so this may or may not be a duplicate.
OpenCV => 3.1.0
Operating System / Platform => Windows 10 / x64
Compiler => Visual Studio 2013
Detailed description
I wrote my code based on the example given on opencv github page for SURF matcher using CUDA.
When I try to build, i get the following errors:
1>Testing.obj : error LNK2019: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::DescriptorMatcher> __cdecl cv::cuda::DescriptorMatcher::createBFMatcher(int)" (?createBFMatcher#DescriptorMatcher#cuda#cv##SA?AU?$Ptr#VDescriptorMatcher#cuda#cv###3#H#Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::cuda::SURF_CUDA::SURF_CUDA(void)" (??0SURF_CUDA#cuda#cv##QEAA#XZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: int __cdecl cv::cuda::SURF_CUDA::defaultNorm(void)const " (?defaultNorm#SURF_CUDA#cuda#cv##QEBAHXZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadKeypoints(class cv::cuda::GpuMat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &)" (?downloadKeypoints#SURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#23#AEAV?$vector#VKeyPoint#cv##V?$allocator#VKeyPoint#cv###std###std###Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadDescriptors(class cv::cuda::GpuMat const &,class std::vector<float,class std::allocator<float> > &)" (?downloadDescriptors#SURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#23#AEAV?$vector#MV?$allocator#M#std###std###Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::operator()(class cv::cuda::GpuMat const &,class cv::cuda::GpuMat const &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,bool)" (??RSURF_CUDA#cuda#cv##QEAAXAEBVGpuMat#12#0AEAV312#1_N#Z) referenced in function main
1><computer_dir>\TestCode\x64\Debug\TestCode.exe : fatal error LNK1120: 6 unresolved externals
All libraries seem to be linked properly and I am not getting any error while writing the code.
It would be great if anyone could say what the error is. Thanks!
I'm developing a small Application using a QWidget and statically linking Qt 5.6. I'm using VS12 at moment.
#include <QMainWindow>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow w;
w.show();
return a.exec();
}
It compiles fine but I'm getting linker errors.
1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "unsigned long __cdecl CreateTLSIndex(void)" (?CreateTLSIndex##YAKXZ) referenced in function "struct A0x6526a104::Current * __cdecl `anonymous namespace'::GetCurrentData(void)" (?GetCurrentData#?A0x6526a104##YAPAUCurrent#1#XZ)
1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "bool __cdecl DestroyTLSIndex(unsigned long)" (?DestroyTLSIndex##YA_NK#Z) referenced in function _DllMain_ANGLE#12
1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "bool __cdecl SetTLSValue(unsigned long,void *)" (?SetTLSValue##YA_NKPAX#Z) referenced in function "struct A0x6526a104::Current * __cdecl `anonymous namespace'::AllocateCurrent(void)" (?AllocateCurrent#?A0x6526a104##YAPAUCurrent#1#XZ)
1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "void * __cdecl GetTLSValue(unsigned long)" (?GetTLSValue##YAPAXK#Z) referenced in function "void __cdecl `anonymous namespace'::DeallocateCurrent(void)" (?DeallocateCurrent#?A0x6526a104##YAXXZ)
1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "bool __cdecl sh::InterpolationTypesMatch(enum sh::InterpolationType,enum sh::InterpolationType)" (?InterpolationTypesMatch#sh##YA_NW4InterpolationType#1#0#Z) referenced in function "private: static bool __cdecl gl::Program::linkValidateVaryings(class gl::InfoLog &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sh::Varying const &,struct sh::Varying const &)" (?linkValidateVaryings#Program#gl##CA_NAAVInfoLog#2#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUVarying#sh##2#Z)
1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: struct sh::ShaderVariable & __thiscall sh::ShaderVariable::operator=(struct sh::ShaderVariable const &)" (??4ShaderVariable#sh##QAEAAU01#ABU01##Z) referenced in function "private: bool __thiscall gl::Program::linkAttributes(class gl::InfoLog &,class gl::AttributeBindings const &,class gl::Shader const *)" (?linkAttributes#Program#gl##AAE_NAAVInfoLog#2#ABVAttributeBindings#2#PBVShader#2##Z)
1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: __thiscall sh::Attribute::Attribute(void)" (??0Attribute#sh##QAE#XZ) referenced in function "public: __thiscall gl::Program::Program(class rx::ProgramImpl *,class gl::ResourceManager *,unsigned int)" (??0Program#gl##QAE#PAVProgramImpl#rx##PAVResourceManager#1#I#Z)
1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: __thiscall sh::Attribute::~Attribute(void)" (??1Attribute#sh##QAE#XZ) referenced in function "public: __thiscall gl::Program::Program(class rx::ProgramImpl *,class gl::ResourceManager *,unsigned int)" (??0Program#gl##QAE#PAVProgramImpl#rx##PAVResourceManager#1#I#Z)
1>libGLESv2d.lib(ProgramImpl.obj) : error LNK2001: unresolved external symbol "public: __thiscall sh::Attribute::~Attribute(void)" (??1Attribute#sh##QAE#XZ)
1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: struct sh::Attribute & __thiscall sh::Attribute::operator=(struct sh::Attribute const &)" (??4Attribute#sh##QAEAAU01#ABU01##Z) referenced in function "void __cdecl std::_Fill<struct sh::Attribute *,struct sh::Attribute>(struct sh::Attribute *,struct sh::Attribute *,struct sh::Attribute const &)" (??$_Fill#PAUAttribute#sh##U12##std##YAXPAUAttribute#sh##0ABU12##Z)
I have included the following libs:
winmm.lib
imm32.lib
Ws2_32.lib
opengl32.lib
Qt5Guid.lib
Qt5Widgetsd.lib
qtpcred.lib
qtharfbuzzngd.lib
Qt5PlatformSupportd.lib
qwindowsd.lib
libEGLd.lib
libGLESv2d.lib
qtfreetyped.lib
Qt5Cored.lib
And the funny thing is that if use QtCreator it compiles,links and runs just fine.
What I saw is that QtCreator adds the following compile flags:
-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_OPENGL_ES_2_ANGLE_STATIC -DGL_APICALL= -DEGLAPI=
I tried them in my project but it does not change anything.
What am I missing? What do I need to make the program link?
I found it. This is the list of libs you need to make it work:
winmm.lib
imm32.lib
Ws2_32.lib
Qt5Guid.lib
Qt5Widgetsd.lib
qtpcred.lib
qtharfbuzzngd.lib
Qt5PlatformSupportd.lib
qwindowsd.lib
libEGLd.lib
libGLESv2d.lib
qtfreetyped.lib
Qt5Cored.lib
+ preprocessord.lib
+ translatord.lib
+ d3d9.lib
+ dxguid.lib
opengl32.lib is not needed.
I still have no idea why QtCreator knows what libs are needed and why VS2013 does not.
Thanks for your help.
As far as I can tell the linker is complaining about this line of code. Looking at what that file is including seems to suggest dependence on libANGLE.
After a lot of Googling I found that CreateTLS() seems to be defined in libANGLE common, which can be found here.
I'm not sure in which particular Lib or DLL those definitions end up but looking into the build scripts would definitely reveal it (sorry, I don't have time to do that atm). But the symbols in the original question are definitely in one of the Libs provided by libANGLE.
this page suggests that all you need to do is add libEGLd.lib and libGLESv2.lib to your linker line, which is already the case, but you should check that you also have the DLLs too. Note point 3, quoted from the linked page, below:
Copy libEGL.dll and libGLESv2.dll from the build output directory (see Building ANGLE) into your application folder.
If you add the DLLs to your solution you can automate copying them to the destination directory..
I'm having some problems with using CEF in my application which uses the MD/MDd runtime library linking.
I have downloaded the latest build of CEF3 from cefbuilds.com and followed the instructions How to link CEF against a different run-time library.
I have built the "libcef_dll_wrapper" project after changing "Runtime Library" to "/MDd" and "Platform Toolset" to "v110" and then I've linked the resulting "libcef_dll_wrapper.lib" binary to my project.
However, when I try to build my project I get the following errors:
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_utf16_clear referenced in function "public: static void __cdecl CefBrowserSettingsTraits::clear(struct _cef_browser_settings_t *)" (?clear#CefBrowserSettingsTraits##SAXPAU_cef_browser_settings_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_utf8_to_utf16 referenced in function "public: static bool __cdecl CefStringTraitsUTF16::from_string(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct _cef_string_utf16_t *)" (?from_string#CefStringTraitsUTF16##SA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAU_cef_string_utf16_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_list_free referenced in function "public: static void __cdecl CefSettingsTraits::clear(struct _cef_settings_t *)" (?clear#CefSettingsTraits##SAXPAU_cef_settings_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl CefBrowser::CreateBrowser(class CefWindowInfo &,class CefRefPtr<class CefClient>,class CefStringBase<struct CefStringTraitsUTF16> const &,class CefStructBase<struct CefBrowserSettingsTraits> const &)" (?CreateBrowser#CefBrowser##SA_NAAVCefWindowInfo##V?$CefRefPtr#VCefClient####ABV?$CefStringBase#UCefStringTraitsUTF16####ABV?$CefStructBase#UCefBrowserSettingsTraits#####Z) referenced in function "public: void __thiscall caspar::html::html_producer::run(void)" (?run#html_producer#html#caspar##QAEXXZ)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol "bool __cdecl CefInitialize(class CefStructBase<struct CefSettingsTraits> const &,class CefRefPtr<class CefApp>)" (?CefInitialize##YA_NABV?$CefStructBase#UCefSettingsTraits####V?$CefRefPtr#VCefApp#####Z) referenced in function "public: void __thiscall caspar::html::html_producer::run(void)" (?run#html_producer#html#caspar##QAEXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_execute_process referenced in function "int __cdecl CefExecuteProcess(class CefMainArgs const &,class CefRefPtr<class CefApp>)" (?CefExecuteProcess##YAHABVCefMainArgs##V?$CefRefPtr#VCefApp#####Z)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_initialize referenced in function "bool __cdecl CefInitialize(class CefMainArgs const &,class CefStructBase<struct CefSettingsTraits> const &,class CefRefPtr<class CefApp>)" (?CefInitialize##YA_NABVCefMainArgs##ABV?$CefStructBase#UCefSettingsTraits####V?$CefRefPtr#VCefApp#####Z)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_shutdown referenced in function "void __cdecl CefShutdown(void)" (?CefShutdown##YAXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_do_message_loop_work referenced in function "void __cdecl CefDoMessageLoopWork(void)" (?CefDoMessageLoopWork##YAXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_run_message_loop referenced in function "void __cdecl CefRunMessageLoop(void)" (?CefRunMessageLoop##YAXXZ)
The full log can be found here.
Any ideas as to what I might be missing?
Are you also libcef.lib in the linker input?