libcurl/curlpp giving me "__imp__curl_version" error - c++

I'm trying to make an application in C++, in Windows using VS 2015. I've read in many places that curlpp is a good way to make HTTP requests. So I downloaded curlpp and noticed that it needed libcurl.
I've built curlpp normally, and I've also managed to build libcurl using the instructions inside winbuild/BUILD.WINDOWS.txt and it generated a libcurl_a.lib. I've also added everything to the include paths, preprocessor, additional dependencies, whatnot.
However, when I try to compile my project, here's what I get:
1>curlpp.lib(cURLpp.obj) : error LNK2001: unresolved external symbol __imp__curl_version
I'm not sure how to fix this. I've searched the entire libcurl and curlpp trying to find what __imp__curl_version is with no luck. I've also spent a lot of time trying to figure it out, but everywhere I look, people just say that libcurl needs to be linked, but I'm already doing that. What is wrong?
If you need any more information, I'll update the post.
Thanks!
EDIT: As #frymode suggested, I used another sln file and compiled using another configuration. That solved my problem.

Related

How to add 3rd party library in Unreal Engine 4

I am new to Unreal Engine. But here is what I planned to do. I want to an experiment project by combining socket.io with Unreal Engine 4. I know somebody may shot at me, for it already had a plugin. But I don't like graph programming at all (I prefer "real" coding)
But as I followed instruction from Installing socket.io C++ and here. It just won't work. The error told me something about File Not Found on multiple headers file from this github repo. So I tried to add a lot of things (Hopefully it won't affect the outcome). And now a tons of errors had popped up. Now they are mostly about Macro errors. And I have absolutely no idea how to fix.
The problem is I don't understand why after I include .lib files to PublicAdditionalLibraries I still needed the original file (Shouldn't it work like any other visual studio projects?)
Also how to tackle loads of errors I am facing
Thanking in advanced
Did you add your include paths with the lib headers to PublicIncludePaths array ( in the StartupModule() method ? it's gonna be needed to use methods from your lib.
Here is an exemple how to use the PublicIncludePaths
string includePath = Path.Combine(ThirdPartyPath, "opencv", "include");
PublicIncludePaths.Add(includePath);
ThirdPartyPath is a member of my module class i retrieve with my getter
Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/"));
I took a look at the github repo of Socket-IO-cpp lib and the only libs compiled for windows are in 32bits, take care you're not tried to compile in 64bits, or every .lib files of your libraries are in 32bits to be linked all together, in case you're using others libs.
If you got some runtime error, take a look at my answer which explain how to indicate .dll when .libs arn't enough.
Hope it helps

Google gRPC (C++) building under VisualStudio 2013. Link errors

I'm trying to setup gRPC for my project in Visual Studio. Did everything as described here: http://www.infopulse.com/blog/grpc-framework-by-google-tutorial/. (Trying to compile helloworld example -> Git grpc/examples/cpp/helloworld)
The main problem I'm getting, while compiling:
unresolved external symbol "void _cdecl grcp::FillMetadata
... and so on.
Nothing wrong with protobuf (Everything working)
OpenSSL, zlib - OK.
My Includes:
$(SolutionDir)..
$(SolutionDir)..\include
$(SolutionDir)..\third_party\protobuf\src
$(SolutionDir)\packages\grpc.dependencies.zlib.1.2.8.10\build\native\include
$(SolutionDir)\packages\grpc.dependencies.openssl.1.0.204.1\build\native\include
$(SolutionDir)\packages\gflags.2.1.2.1\build\native\include
$(SolutionDir)\packages\gtest.1.7.0.1\build\native\include
Additional dependencies:
libprotobuf.lib
grpc.lib
gpr.lib
libeay32MDd.lib
ssleay32MDd.lib
Everything in correct folders.
What am I missing here? Maybe some of you have an already working .sln project with all dependencies list? I know that the problem must be connected to some .lib that I'm missing here.
It looks like you're not linking in the grpc++ code. It's unfortunately not a supported target right now, but we're looking to remedy that very soon. I'd really like to be offering a nuget package for C++ users.
If you want to try for now though, make sure you're compiling the vsprojects/vcxproj/grpc++/grpc++.vcxproj project alongside the rest of your code. Let us know how you go (and please file bugs at github.com/grpc/grpc/issues to help us prioritize things).

Building MuPdf and registering document handlers

Here we have a question, an answer and some happy people.
But I've got a different situation,
I'm coding in C++ and I'm going to build MuPdf myself.
So, when i add fz_register_document_handlers function before fz_open_document_with_stream I'll get 5 unresolved external symbols for these
_opj_image_destroy (2 times)
_opj_copy_image_header
_opj_image_comp_header
_opj_image_create
I can get rid of 3 of them by linking openjpeg\libopenjpeg\image.c but _opj_image_destroy is stock on my compiling error list!
[UPDATE]
Mupdf version: 1.6
I don't know that it's a right way or not but I created a visual studio project, named Native and put Mupdf source in it and try to compile.
Then i'm using it's header in other c++ project (and using declare "C" in it) and linked Native to it.
It works fine until i trying to open a file as a stream and not file address.
So, my project failed with this error: "No document handlers registered".This error is caused by document.c file.
I searched and find the page which was linked above and I changed the source.
The compile errors appeared after that change!
Thanks for your help and sorry for my English...
Firstly, you haven't said what version of MuPDF you are using. I'm going to assume you're using the latest version from git (currently 1.6 as of 1 Feb 2015).
Secondly, you've not told us anything of use about how you're building MuPDF. Without knowing exactly what you've changed, it's hard to speculate what you're doing wrong.
If you're compiling vanilla .c files with a c++ compiler then you probably need to do some wrapping of files with extern "C" declarations.
Feel free to get in touch on the #ghostscript irc channel and tell us more.
[Update]
It sounds to me like you are missing the openjpeg decoder. You can't just add a single file from the openjpeg source and expect it to magically work.
Why are you creating your own Visual Studio project when we provide one for you already? platform/win32/mupdf.sln

CFtpConnection::GetCurrentDirectory unresolved token error. Other functions like SetCurrentDirectory work though

The dll compiles fine as unmanaged code, however when I add /clr and change to Use MFC in a Shared DLL in the project properties, mfCFtpConnection::GetCurrentDirectory gives me LNK2028 and LNK2019 errors. Which are unresolved token and unresolved eternal symbol errors.
I have #include and linked wininet.lib. So I am puzzled.
I read a post online where the user had this issue and it was related to mfc100.lib renaming CFtpConnection::GetCurrentDirectory to CFtpConnection::GetCurrentDirectoryA. There was no work around and a microsoft rep said it would be fixed in future versions of mfc100.lib. I do not know if that is the problem.
Here is the link to the post.
Link to online Post
Any ideas it is driving me crazy.
Also I tried CFtpConnection::GetCurrentDirectoryAsURL and the code compiled fine.
I think this error stems from the fact that there are some #defines used to sneak around CLR restrictions for MFC dlls.
If you're using VS2010, you can hover over the method name and you will see the #define statement that is renaming your method in the generated .obj file. Since it's been renamed, the other modules in your code won't be able to link to it.

libcurl on windows

I am writing a C++ application that needs to use libcurl with HTTPS support. I already built the basic libcurl without any problem. However I have spent over 10 hours on compiling the HTTPS version, I've tried building it with VS2008, I've tried with mingw32 and I've tried with nmake. I have read about every post there is on the subject and nothing seems to work on my computer.
My question is the following : Since I use the curl lib without modifications, Is there anywhere I can find a package containing : libcurl.lib, libcurl.dll, and all the necessary dlls (ssl,zlib, libeay32,etc) to include them in my project and never worry about compilation ever again??
The lib absolutely needs to have SSL support.
Thanks
David