-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unresolved symbol error visual studio 2017 #170
Comments
Please post the full build output, without it there is no context for me to deduce what the issue might be. |
Of course, here's the build output I get:
I'm french and so, output is french, I translated errors in english for you |
Thanks, typically, this kind of error will occur when either you have not linked against the serial library (not sure how to express that in Visual Studio) or in this specific linker error perhaps you're building |
Hi, I ran into this with VS2019 and banged my head against the wall for quite some time with the typical visual studio linking things all in order. I then noticed that this happens with two functions in serial requiring registry access: Error LNK2019 unresolved external symbol __imp_RegCloseKey referenced in function "class std::vector<struct serial::PortInfo,class std::allocator > __cdecl serial::list_ports(void)" (?list_ports@serial@@ya?AV?$vector@UPortInfo@serial@@v?$allocator@UPortInfo@serial@@@std@@@std@@xz) Error LNK2019 unresolved external symbol __imp_RegQueryValueExW referenced in function "class std::vector<struct serial::PortInfo,class std::allocator > __cdecl serial::list_ports(void)" (?list_ports@serial@@ya?AV?$vector@UPortInfo@serial@@v?$allocator@UPortInfo@serial@@@std@@@std@@xz) And then from a random stackoverflow response I already lost, found out that these need to be linked against Adding that to my project's linked libraries seems to solve the issue. I have no previous experience on this, and I don't quite understand why compiling the serial library itself, and the test_serial project included don't have an issue with this (the test runs fine). |
Apologies to add to such an old thread, but if anybody else encounters this issue even with the files included in your project and linked to Advapi32.lib, try changing the .cc file extensions to .cpp. My version of Visual Studio doesn't compile .cc files by default. Changing them to .cpp fixed it. An alternative issue which can sometimes cause the same symptoms is if you have two .cpp/.cc files with the same name, e.g., |
Everytime i try to compile with visual studio 2017, i'm getting in trouble with an unresolved symbol error (LNK2019)... How can I fix that ?
The text was updated successfully, but these errors were encountered: