Linking zlib in Visual Studio 2012 - c++

I have a C++ program that compiled and ran fine on Linux that I am now trying to compile on a Windows machine in Visual Studio. The main problem I'm facing is the following error message:
error LNK2019: unresolved external symbol _gzread referenced in function
I have downloaded the zlib library and attempted to link it to my project, but apparently unsuccessfully. I'd appreciate clear instructions on how to link this to my project. The less you assume in your instructions, the better, as I'm relatively new to Visual Studio.

Found the solution. Even though I'm working on a 64-bit machine, VS was compiling in 32-bit mode. I just used the 32-bit version of zlibwapi instead of the 64-bit version and it worked.

Related

Why do I get the 'fatal error LNK1120: 1 unresolved externals' when building (release) my C++ DLL developed for VBA?

I have developed a simple (no COM) C++ DLL for VBA (Excel) in VS 2008, which works perfectly on Win 10 and Excel 2016, as well as on Win XP and Excel 2003, both during debug and release. I have developed it following this example.
Now, jumping to the issue, using the same recipe and piece of code I have developed the same DLL, but in VS 2015. The debug and release versions for x64 work perfectly, but when I want to release the DLL for X86, it throws me the following error:
1>defFile.def : error LNK2001: unresolved external symbol "func_name"
Additional info, the project has only 2 files, as in the example:
.cpp
.def
Anyone has an idea how to get over this link issue?
My feeling is that, there might be a setting that I overlooked or skipped!
If you need the code or the settings, I will happily provide them, but they should be as in the example!
Thanks!

link MinGW gcc c++ application against mvsc c++ .lib

I need to integrate the Intel RealSense C++ library (legacy 2016 R3 not the current 2.0 SDK) to an already existing application built with Qt MinGW g++ 32-bit (installed by Qt5.11 offline installer)
basically, they provide the headers and some .lib files to compile and link applications
when I try to compile the Segmentation example in Visual Studio, they work, (they provide a .props file that I can add to the Visual Studio Solution's Project's Property Manager, btw, I am using Visual Studio Community 2017 on Windows 10 Home 64-bit), but, the application I am developing was made using QtCreator so I need to be able to compile with QtCreator, and migrating the build to Visual Studio might not be a viable solution
if I try to compile the Segmentation example with MinGW (32-bit) in QtCreator (installed by Qt5.11 offline installer) I get error messages like this one
C:\src\Debug\app\main.cpp:34: error: undefined reference to `UtilCmdLine::UtilCmdLine(Intel::RealSense::Session*, int)'
and even if I try to use MSVC (64-bit) in QtCreator (installed by Qt5.11 offline installer) (which is not really a great option)
I get error messages like this one
C:\src\Debug\app\main.cpp.obj:-1: error: LNK2019: unresolved external symbol PXCSession_CreateFromPath referenced in function "public: static class Intel::RealSense::SenseManager * __cdecl Intel::RealSense::SenseManager::CreateInstance(wchar_t const *)" (?CreateInstance#SenseManager#RealSense#Intel##SAPEAV123#PEB_W#Z)
for several symbols
has anyone solved a similar problem?
MinGW I think I understand not working, because of MSVC symbol mangling and a general different ABI, and because the tools to work with .lib files in MinGW are no longer being available (at least not in the official website), but why is MSVC not working? am I missing something that Visual Studio has that QtCreator does not?
would there be a way to make something like a wrapper library in visual studio so that I can use in MinGW? I saw some people who had similar problems with .lib files being told to use a COM style interface if they could
I saw that being the
just to clarify, I'm not sure if it's a problem introduced by the Qt libraries but there is some of the application's code just doesn't compile correctly with MSVC, so for now, I'd prefer a way to compile with MinGW in QtCreator, though we might eventually get it to work with both compilers (or at least try to)

Accommodate VS2013 project to VS2015

So I've recently upgraded VS2013 to VS2015 and I'm still struggling accommodating the code & project's definitions to make it work.
I have dozens of projects in my solution. I also use jsoncpp as an additional lib.
When compiling a single project, I get this error:
3>LINK : fatal error C1047: The object or library file '..\Libs\json_cpp\build\vs71\release\lib_json\json_vc71_libmt.lib' was created with an older compiler than other objects; rebuild old objects and libraries
So I've open the Libs\json_cpp\makefiles\vs71\jsoncpp.sln with VS2015 and rebuild the solution.
that didn't help.
Possible Reason
My projects are all using Platform Toolset Visual Studio 2015 - Windows XP (v140_xp)
while the jsoncpp Platform Toolset is Visual Studio 2013 - Windows XP (v120_xp)
If this is indeed the issue so the obvious solution is to have both solutions compile in the same Platform Toolset Visual Studio 2015 - Windows XP (v140_xp).
Possible Solution
So, I've tried that. and got countless of these warnings:
json_value.obj : warning LNK4006: "public: static int const std::numeric_limits<unsigned short>::digits10" (?digits10#?$numeric_limits#G#std##2HB) already defined in json_writer.obj; second definition ignored
Anybody else suffered from this agonizing process of VS upgrade and can share some insights?

Compiling FFTW 3.3.4 With Visual Studio 2013

Has anyone managed to compile the latest release of FFTW 3.3.4 using the Visual C++ compiler? I'm aware that the project maintainers offer pre-compiled dll's that were built with MinGW, but I'm looking to compile them myself.
So far, I've downloaded the source (of course), and I am trying to use one of the pre-made VS solutions that was reported to work for Visual Studio 2010 and FFTW 3.3, but when I'm building, I'm getting a few "unresolved external" errors like the following:
Error 1259 error LNK2019: unresolved external symbol _fftwf_mkprinter_str referenced in function _fftwf_export_wisdom_to_string C:\Users\bryan\Downloads\fftw-3.3.4\fftw-3.3.4\fftw-3.3-libs\libfftwf-3.3\export-wisdom-to-string.obj libfftwf-3.3
I know this is a bit of a stretch, but has anyone built FFTW 3.3.4 using Visual Studion 2013?
I have had the same problem.
Take a look on
http://wiki.panotools.org/Hugin_SDK_%28MSVC_2013%29
There is explained how you can build libfftw-3.3
In the same way you can build libfftwf-3.3
To build bench and benchf you have to remove '....\libbench2\aligned-main.c'
That is explained here (commentar 6)
Compiling FFTW source in Visual studio

unresolved external symbol _forceCRTManifestCUR

When I am trying to build one of my C++ solution for x64 architecture. I am getting alot of these errors:
Error 34 error LNK2001: unresolved external symbol _forceCRTManifestCUR
Project was working fine before but I had to reinstall windows and so
VS since than it is having this problem.
It builds all fine when i build it for x32
My Operating System is Windows XP - X32 (Visual Studio - 2008) can this be the reason? I
hope it is possible to build a solution for x64 architecture while
on a x32 system?
Please guide me how can i resolve this issue.
Thankyou.