Can't link the MinHook library - c++

I keep getting
error LNK2019: unresolved external symbol _MH_CreateHook#12 referenced
in function _DllMain#12
yet I put
#include "MinHook.h"
#pragma comment(lib,"libMinHook.x64.lib")
and have the locations to include and libs set
The library can be downloaded from here https://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=44326
or from https://github.com/TsudaKageyu/minhook
I have even compiled the source and yet the same problem :/

Make sure you are building your application as a 64 bit application if you are using a x64 library. You can not use a 64 bit library with a 32 bit application.

Related

openssl Could Not Find libcrypto-3-x64.dll

I connected openssl to my project and it compiles and runs well, but next to the program after compiling there is a file libcrypto-3-x64.dll, without which the program will not run, so the question is how do I use openssl without this dll how to integrate it into the project?
I found out what the problem is, with the dynamic library it does not exist, EVP_CIPHER_CTX_t ctx(EVP_CIPHER_CTX_new()); when I compile a program (static lib openssl) with this line there are so many errors unresolved external character (example __imp_getsockname)
VERSION 3.0.5
I compiled the library according to this guide https://youtu.be/PMHEoBkxYaQ x64 static and still errors like this "unresolved external symbol __imp_WSAGetLastError" "unresolved external symbol __imp_CertOpenStore.".
I solved my problem and leave the answer here, just add 2 libraries in Linker => Additional Dependencies
Ws2_32.lib
Crypt32.lib

Unresolved external symbol for every glew function I use

I wanted to create new OpenGl/GLEW/GLFW Visual Studio project in 64 bit. So I downloaded glew binaries and glfw binaries. My project settings are as followed:
Additional Libraries:
glew-2.1.0\lib\Release\x64
glfw-3.3.bin.WIN64\lib-vc2019
Additional Dependencies:
glew32s.lib (I dont get why its named glew32 and its in x64 folder)
opengl32.lib
glfw3.lib
With such setting for every glew function like glGenBuffers or glUseProgram or anything I get LNK2001 unresolved external symbol error.
Any clue where I did a mistake?
(And since I am a new to all of these can someone explain why do I have to link opengl32.lib on 64 bit app and why there is no opengl64.lib and so on?)
When you want to link the static glew library on windows, then you've to define the GLEW_STATIC preprocessor definition when you compile your application.
See Building Your Project with GLEW
and GLEW - why should I define GLEW_STATIC?.
If you use gnu (g++), then just add -D GLEW_STATIC to the build command.
In Visual Studio add GLEW_STATIC to the Project properties -> C/C++ -> Preprocessor -> Preprocessor Definitions
Well it seems to work when I link it dynamicly (glew32.lib instead of glew32s.lib).
Still no clue why static linking didnt work out.

Boost and Telegram API: unresolved external symbol

I am trying to build Telegram API to C++ from here https://github.com/reo7sp/tgbot-cpp
And it need Boost libs. I installed it, builded solution with CMake, but then I try to build my solution I have a lot of "unresolved external symbot" problems
These are OpenSSL library symbols. boost::asio::ssl requires OpenSSL. See notes at the bottom of this page: http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio/overview/ssl.html.

Unresolved external symbol, with static lib that uses another static lib

I have a C++ program, ProgramA, which is an executable that has a static library, LibraryB, which in turn relies on another static library (libcurl, actually) that is not compiled within my project.
Now, on OSX this works fine. I make sure to link libcurl and ProgramA and LibraryB compile and ProgramA runs great.
However, on Windows, I keep getting linking errors:
error LNK2019: unresolved external symbol __imp_curl_global_init referenced in function
I've double and triple checked that I'm linking the libcurl static library into the project. And actually, in the Visual Studio solution, I have another executable, ProgramB, which doesn't use LibraryB but instead references the libcurl library directly, and this works fine. Unless I include LibraryB in which case the unresolved errors come back.
Suggestions? Thoughts? Thank you!
The problem is that you are linking against the static version of the library but building against the shared version (DLL) of the library. When building against the shared version symbols are exported using __declspec(export) (or a .def file) which causes the compiler to add __imp to the beginning of the exported symbol name.
Te resolve this you can add CURL_STATICLIB to the preprocessor definitions of the dependent project to build against the static library correctly.

make GNU gettext work for a MFC App

im trying to add i18n support with gettext on my mfc app, but i found the following problems
1) The ufficial distribution stopped to support MSVC, so i found another build here.
http://gnuwin32.sourceforge.net/packages/gettext.htm
i fixed the include and linker path for the new libraries but when i try to use gettext it give me this error
Error 1 error LNK2001: unresolved external symbol __imp__libintl_gettext ToolManager.obj ToolManager
Any idea of why? im pretty sure the important .lib are in the linker path.
Try the binaries from ftp.gnome.org; latest gettext build is from 12-Sep-2010 and should AFAIK work fine with MSVC.
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/