How do i fix curl linker errors - c++

i'm trying to use libcurl in my C++ application, but i'm running into linker errors.
I did add the include and lib folder in my project and added the .lib file in the additional dependencies.
Error: LNK2019 unresolved external symbol __imp__curl_easy_init referenced in function _main

Related

LNK2019 when trying to use FreeType 2.10.1?

I have been trying to complete the first tutorial on the FreeType website. I am using the provided code on the website and I have added the libraries and included the proper include files but I receive 7 LNK2019 errors:
Error LNK2019 unresolved external symbol FT_Set_Transform referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Set_Char_Size referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_New_Face referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Load_Char referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Init_FreeType referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Done_FreeType referenced in function main \main.obj 1
Error LNK2019 unresolved external symbol FT_Done_Face referenced in function main \main.obj 1
I found this stack over flow thread and tried what the comments suggested but that made more errors pop up.
I tried this tutorial on how to set it up but I still receive the same 7 errors. And the guy in the comments section had the same problem as me but no answers there.
Build the .lib file on your computer, don't use another one and read index.html in the VS project .sln directory.
Be sure that the configuration when building the .lib is similar to the configuration of the project you want to add the file to...
Make sure to add it to additional dependencies (Linker -> Input) NOT (Linker->General)
Add the full directory (also with the freetype.lib name) AFTER %(AdditionalDependencies) macro

Linker Error prevents me from initializing TA-LIB in C++

I'm having a problem with TA-LIB in my C++ project.
I just downloaded TA-lib (ta-lib-0.4.0-msvc.zip) and copy-and-pasted c folder to my project folder.
Because of a linker error, I can't go any further.
What I did:
I just downloaded TA-lib (ta-lib-0.4.0-msvc.zip) and copy-and-pasted c folder to my project folder.
include "c\include\ta_libc.h"
Is there anything wrong with my steps? Or any steps I missed?
#AlenL
Thank you for your help.
I included every proj files in IDE.
But the result is the same.
+) Error List
LNK2019 unresolved external symbol _TA_Shutdown referenced in function _main
LNK2019 unresolved external symbol _TA_Initialize referenced in function _main
LNK1120 2 unresolved externals
Look into the ta-lib\c\ide\vs2005\lib_proj folder and it's subfolders. You need to include the .vcproj files from the subfolders into your solution.

How to resolve an unresolved external symbol error with MSVCRTD.lib

I have a C++ Visual Studio DLL project that has a link error:
MSVCRTD.lib(tncleanup.obj) : error LNK2019: unresolved external symbol __imp__InitializeSListHead#4 referenced in function "void __cdecl __scrt_initialize_type_info(void)" (?__scrt_initialize_type_info##YAXXZ)
I set the Project Properties, Linker, General, Show Progress to "For Libraries Searched" to verify the correct version of MSVCRTD.lib is being referenced.
Look up the unresolved external symbol: InitializeSListHead to find what library it is defined in:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683482(v=vs.85).aspx
Kernel32.lib
In Visual Studio, set the Project Properties, Linker, General, Show Progress to “For Libraries Searched (/VERBOSE:Lib)"
Start a build and examine the output to see the "Searching libraries" referencing "Kernel32.lib".
In my case I found another Kernel32.lib was being referenced incorrectly.

Unresolved external symbols linking to glew32s.lib

So this isn't the first time I have run into this problem, but the solutions that worked in the past don't seem to be working. I am currently receiving the following errors:
Error LNK1120 6 unresolved externals
Error LNK2019 unresolved external symbol __imp__glGetString#4 referenced in function _glewContextInit#0
Error LNK2019 unresolved external symbol __imp__wglGetCurrentDC#0 referenced in function _wglewGetExtension#4
Error LNK2019 unresolved external symbol __imp__wglGetProcAddress#4 referenced in function __glewInit_GL_3DFX_tbuffer
Error LNK2019 unresolved external symbol __imp__glClear#4 referenced in function "public: void __thiscall vortex::graphics::Window::clear(void)const " (?clear#Window#graphics#vortex##QBEXXZ)
Error LNK2019 unresolved external symbol __imp__glEnable#4 referenced in function "private: bool __thiscall vortex::graphics::Window::init(void)" (?init#Window#graphics#vortex##AAE_NXZ)
Error LNK2019 unresolved external symbol __imp__glViewport#16 referenced in function "void __cdecl vortex::graphics::windowResize(struct GLFWwindow *,int,int)" (?windowResize#graphics#vortex##YAXPAUGLFWwindow##HH#Z)
to give you a rundown of what I have tried, I have checked and rechecked the linking paths to the libraries, I have put the GLEW_STATIC preprocessor definition in the necessary section, I have redownloaded the libraries multiple times to make sure I was linking a Win32 library to the Win32 application, and I have no idea what to do now. It was working fine for awhile, and the above solutions would always fix this sort of error, but not this time. The sooner I can get a response the better, as this is a project that I wanna get more work done on soon. Thank you for any help you can give me.
Add OpenGL32.lib and glu32.lib to your linker inputs.
Add opengl32.lib to your linker inputs, and
add GLEW_STATIC to your Properties->C/C++->Preprocessor->Preprocessor Definitions
I had a very similar problem myself, and the solution for me was adding the glew32.dll to the folder, as well as adding #pragma comment(lib, "glew32.lib") and linking to it. The glew32.dll will refer to glew32.lib, so if you dont have it, it will give off similar linking errors.

Problems including MATLAB "engine.h" for C++ code

I am trying to run the example code from the MATLAB Doc, but when I try to build the project in Visual Studio I get this error
fatal error C1083: Cannot open include file: 'engine.h': No such file or directory
The fact is that in the Doc I cannot find where to find the header to link it, they show the examples as if there was no need to do anything else, just do the
#include "engine.h";
Any ideas about how to solve this issue?
EDIT
I solved the first problem but now I get some errors reated to missing libs:
1>engwindemo.obj : error LNK2019: unresolved external symbol _engClose referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _mxGetClassName referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _engGetVariable referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _engOutputBuffer referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _mxDestroyArray referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _engEvalString referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _engPutVariable referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _mxGetPr referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _mxCreateDoubleMatrix_730 referenced in function _main
1>engwindemo.obj : error LNK2019: unresolved external symbol _engOpen referenced in function _main
I set the Path variable as told in the documentation, set the lib path and added some libraries and now I don't know what else can I do. I also rebooted VisualStudio in order to make the Path variable change effective.
Thanks in advance.
I finaly solved the problem. I was building a WIN32 project, while matlab is x64, so VisualStudio gives errors when you try to link 64-bit platforms. The solution is changing the Active Solution Platform to x64, inside Project Properties -> Configuration Manager.
It is well explained in the following link.
Thanks anyway for the answers, they were useful.
So, summarizing, to be able to compile and run a c++ code in VisualStudio2008 and Matlab2010 with engine.h, the following steps are required:
1.- Set Path variable in Advanced System Settings-> environment variables: C:\Program Files\MATLAB\R2010a\bin\win64 (or the path where libeng.dll is located)
2.- In project properties of VisualStudio, link in Additional Include directories of C++->General:
"C:\Program Files\MATLAB\R2010a\extern\include"
3.- In project properties, linker->general, Additional Library Directories:
"C:\Program Files\MATLAB\R2010a\extern\lib\win64\microsoft"
4.- Add the following libraries in Linker->Additional Dependencies:
libeng.lib
libmx.lib
5.- Change the Active Solution Platform to x64, in Configuration Manager as explained in the link.
Have you added the MATLAB include directory to your project's include path?
. The directory should be like "C:\Program Files\MATLAB\R2010a\extern\include"
In case you forgot, add the folder containing libmat.dll libmx.dll etc. to your path. For me that was:
C:\Program Files\MATLAB\R2012a\bin\win64
While the Jav_Rock's answer is completely correct, I want to add information about one of the points:
1.- Set Path variable in Advanced System Settings-> environment variables: C:\Program Files\MATLAB\R2010a\bin\win64 (or the path where
libeng.dll is located)
I spent three hours to understant what does it means, so I want to clarify this moment for future researchers.
You need to add the path of MATLAB Engine dll libraries to your Windows.
We can do it this way:
My Computer -> right click: Settings. Opened System window. Left bottom corner: Advanced System Settings
Advanced Tab
In the Environment variables for your user press Create... button and add this one:
Variable name: PATH
Variable value: C:\Program Files\MATLAB\R2016a\bin\win64
This path is reference on where is your libeng.dll located.
Important moment: it can require to restart VS or even restart computer.