-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots and Lots of Unresolved External Symbols #38
Comments
Apologies, I'm not much of a Windows user. But this does kinda sound like what happens with MSVS if you build a library for a 32-bit target and then try to link it into an application built for a 64-bit target. Or visa versa. For some idiotic reason the default seems to be 32-bit builds even on 64-bit versions of Windows. Assuming that you do want to build for 64-bits, when you run cmake to configure the build, be sure to tell it to do so. For VS 2019, it's like this:
So that's my wild guess of what might be wrong. |
Add this in your .h file: Also, add the debug/release .lib files to your linker\input directories and vc++ directories\library directories. |
Ah, OK. This is the WinSock library? Can I add this to the CMake file to ensure that it gets linked in? |
yes it is winsock - no clue if you can add it to cmake, I'm not using it too often :) |
Link to Winsock in CMake e.g. like this. |
I seem to have the same problem as SushiSalad: I've build the library and configured VS'project setting to use this library. Where do I have to add this preprocessor statement (#pragma ...)? |
Just to update this with the latest info, as of Release v0.8:
...but...
I haven't tried adding the |
You can tell CMake whether to propagate dependencies or not. I.e. add PUBLIC/PRIVATE keywords to your CMakeLists like this |
I hope this is all fixed in Release v0.8.1. |
I've been trying to integrate your code with MS Visual Studio 2019 for quite awhile now and I've come up with many errors. Currently the one I can not figure out is all these unresolved external symbols that I'm getting. I'm new to integrating libraries with Visual Studio, or anything for that matter. I'll walk you through what I've done.
I used CMake to build the binaries for a static library then in the .sln file it produced I built the solution.
After building it I placed the sockpp-static.lib and sockpp-obj.lib in a dependencies folder in the repo of the project I was testing it with. I pointed the linker at both of these files and then added the include and library directories.
It threw some weird runtime errors that I had to fix and some weird iterator debug errors that I fixed and now I'm at this point where it throws all these unresolved external symbol errors based off the sockpp-static.lib file.
It looks like this:
https://i.imgur.com/NImylP6.png
It does this after I use anything to do with sockpp.
For example:
will throw a bunch of errors. However if it's only
in_port_t port;
then it won't throw the errors.I've tried messing with the runtime library it uses and some preprocessor settings as well. I even tried adding each of the .obj files that are generated by CMake to the Additional Directories but all that does is make it so the file that is causing the issue is no longer "sockpp-static.lib(socket.obj)" but it's "socket.obj" that's causing the problem.
Forgive me, I'm new to this. I have no clue what could be causing all these errors.
The text was updated successfully, but these errors were encountered: