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

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).

Related

How to set up llvm-c++ api for Visual Studio 2017

I've been working on a compiler for my own little made up language for a school project, completed the Lexer already and built up most of the ASTBuilder but now I want to start generating LLVM-IR code to actually be able to do something with it and the problem is, I can't seem to figure out how to get the LLVM-C++ API to work on Visual Studio.
I went to LLVM's website and downloaded the latest package, copied the include and lib folders and set them up in the project properties but something just isn't quite working, Visual Studio complains I have linker errors even though I linked against the lib files and made sure I copied all of them. Saw it has many files called "CMakeLists.txt", tried to look it up but I can't quite understand it.
Thanks in advance for any help!

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

libcurl/curlpp giving me "__imp__curl_version" error

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.

Using SDL to make a simple game, struggling with linking everything together [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 7 years ago.
I would like to attempt to make a simple game in c++.
So I found really cool series about how to make a game but the creator didn't include how to install different libraries etc.
So, in the tutorials, he gives us this code:
http://gynvael.vexillium.org/ext/vc/game.cpp
As a basic framework to make the game.
From now on I will list for you what I found out and what I think is the problem:
The problem is that when you just try to compile and run it, it will throw tons of errors at you etc.
I needed to link my project to SDL first, which I did and I think it works because there is no major errors or underlined code.
But then, there was a problem with the gl.h file.
So I have figured out that I need to install OpenGL libraries and link them to my visual studio project. I found out that I need FreeGlut and GLEW to run the piece of code from the link above.
So I have linked GLEW fairly easily with my project but there is a problem with GLUT.
Apparently, for unknown for me reason you have to compile the .lib file yourself. And that brought me to a whole new level of problems. So the newest version of GLUT (3.0) doesn't have the visual studio folder in it (In the tar file) so I cannot compile the newest version.
On the other hand, all the older versions have that visual studio folder which allows me to compile the freeglut.lib file and add it to my program's dependencies.
But when I do that, it comes up with an error: LNK1104: cannot open file 'freeglut.lib'
I have no idea why's that because I did everything exactly like in tutorials, multiple times.
I think that it could be because I got the newest version of GLEW, but old (from 2013 I think) version of GLUT, because the newest one doesn't have a folder with visual studio project to compile.
All I need is to make the code (from the link) work.
#EDIT~~~~~~~~~~~~~~~~~~~~~~~~
I have found out that my dependencies folder was in the wrong place and I moved it, instead of the problem with the freeglut.lib file, which seems like has been sorted out (I think I fixed it :D) I get like 5 new errors:
Screenshoot of the error log: http://puu.sh/hD6x5/d5fc1e1be6.png
but none of this rings the bell. Nothing happens either if I doubleclick it.
That error means that you need to link with these three additional libraries:
Glu32.lib
SDLmain.lib
SDL_Image library
You may need to download and build SDL_Image, but the other two should already be part of Windows SDK and SDL respectively.
Oh, and you need to not define a main() function in your own code. It's either the framework code you are using, or even SDL (IIRC) that is doing that for you.

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