mongoose networking library link issue VS19 c++ project - c++

I cannot get work mongoose, visual studio have some LINK problems.
Just trying to run an example from https://github.com/cesanta/mongoose/blob/master/examples/http-server/main.c
What I did:
create c++ project
include mongoose.c and mongoose.h, then create main.cpp
Copy code in here
RUN => linker errors for x64
so I did new blain c++ project for building library
include mongoose.c and mongoose.h
build .lib for x64
give a path for first project => still LINK problems (now different)
All erors are similar:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol __imp_bind referenced in function mg_open_listener
mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\mongoose.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_casecmp referenced in function main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_http_listen referenced in function main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_http_serve_dir referenced in function "void __cdecl cb(struct mg_connection *,int,void *,void *)" (? cb##YAXPEAUmg_connection##HPEAX1#Z) mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_log referenced in function main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_log_prefix referenced in function main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_log_set referenced in function main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol mg_mgr_poll referenced in function
main mongooseWebServer E:\JOB\StitchingProject\mongooseWebServer\main.obj 1
Any advices?

I figured out that mongoose need also their .exe program running in backgroud, similar to the apache. EXE itself is unsecured and antivirus must be turned off...
To be able to compile with their libraries, this EXE must running.

Related

CGAL Polygonal_surface_reconstruction_Examples do not compile

I am new to CGAL and C++ and I am running into compile errors when setting up the CGAL Polygonal_surface_reconstruction_Examples as described in the manual.
I have installed glpk-4.65 (https://sourceforge.net/projects/winglpk/) and then had to manually point CMake to the directory.
CMake made the VisualStudio2022 SLN file but when I try compiling I am getting the error below. I assume that there is something not set up correctly with GLPK but I am not sure how to resolve this.
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol glp_create_prob referenced in function "public: virtual bool __cdecl CGAL::GLPK_mixed_integer_program_traits<double>::solve(void)" (?solve#?$GLPK_mixed_integer_program_traits#N#CGAL##UEAA_NXZ) polyfit_example_user_provided_planes C:\dev\CGAL-5.4-examples\CGAL-5.4\examples\Polygonal_surface_reconstruction\sln\polyfit_example_user_provided_planes.obj 1

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

VS2017: Linker errors after enabling MASM in C++ project

So I'm trying to create a .dll wrapper (32 bit x86) in C++ and I need to write assembler wrapper functions. I've tried to use inline assembler in combination with __declspec(naked) but that didn't seem to work for C++ constructors (the compiler still generated code).
I've tried to work around that by writing with raw assembler files directly.
Before doing anything with MASM (and invoking any of my assembler functions) my project compiles and links fine.
In order to be able to use MASM I went into the "Build Customizations" and enabled MASM. After doing that I now get a bunch of linker errors with seemingly unrelated functions:
Error LNK2001 unresolved external symbol _memset SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(utility_desktop.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol _free SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(delete_scalar.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __cexit SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(utility.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol __CxxThrowException#8 SoundEngine D:\Home\Documents\Git\SoundEngine\SoundEngine\MSVCRT.lib(throw_bad_alloc.obj) 1
Since those aren't even in refrenced (at least directly) in my code, how do I make this error go away?
Does VS change any name mangling or linker options after enabling MASM?

I always get errors in linker with Visual Studio 2019 and OpenCV

I installed OpenCV-v2.4.11 from NuGet Package Manager in Microsoft Visual Studio 2019. However, I can't get working this code:
#include <opencv2/opencv.hpp>
int main()
{
cv::Mat A;
return 0;
}
I got these errors:
Errors once more: (Visualisation is name of my project)
- Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPEAX#Z) referenced in function "public: __cdecl cv::Mat::~Mat(void)" (??1Mat#cv##QEAA#XZ) Visualisation C:\Users\maoap\source\repos\Visualisation\Visualisation\Source.obj 1
- Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QEAAXXZ) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ) Visualisation C:\Users\maoap\source\repos\Visualisation\Visualisation\Source.obj 1
- Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPEAHH#Z) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ) Visualisation C:\Users\maoap\source\repos\Visualisation\Visualisation\Source.obj 1
- Severity Code Description Project File Line Suppression State
Error LNK1120 3 unresolved externals Visualisation C:\Users\maoap\source\repos\Visualisation\x64\Debug\Visualisation.exe 1
Answered in comments below the question.
The compiler toolkits in vs 2019 are not compatible with opencv in Nuget or else now,there are two way you can choose:
1.compile opencv by yourself,you need to rewrite makefile.
2.use it in vs2015.

Opus Undefined reference while linking on Window

After 4 hours of search, I cannot understand why there are some unresovled external symbal error while I link the library.
I'm using VS 2015.
Severity Code Description Project File Line
Error LNK2019 unresolved external symbol _opus_encoder_create referenced in function "public: __thiscall Compressor::Compressor(int,int)" (??0Compressor##QAE#HH#Z) PortOpus A:\sharedfolder\babel\client\Compressor.obj 1
I would like to know, why ? Plus I'm sure that the lib got these functions, as I've opened it with atom and ctrl+f the name.