Linking errors only when using Qt creator [duplicate] - c++

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 4 years ago.
I have linking problems when I execute some code that links to different shared libraries. The fact is that I haven't them if I use the console, but only if I execute it within the Qt creator IDE.
Do you guys know if there a kind of console where I can use nm readelf and stuff like that with the QT build / runtime environment?
Alternatively, how would you debug such problem?
Specifically, the error I get is something like:
symbol lookup error: blabla undefined symbol: blabla
[EDIT] Suggested question is different in respect to what I'm asking. I'm specifically speaking about the qt creator environment, not linking errors in general. Specifically, it's about how to debug linking errors in qt creator when using the console everything seems ok.

1) Can you explain a bit more in detail what you need?
2) Can you publish your .pro file generated by Qt Creator?

Related

unresolved external symbol _SDL_main referenced in function _main_getcmdline [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 1 year ago.
This is probably me being stupid but what am I doing wrong here? I'm not sure if I need the code but I'm doing this in Visual Studio 2019.
Are you sure you specified both assembly versions correctly in the linker? This means both for release and for debug.
Considering that you are using VisualStudio2019, I strongly advise you to use vcpkg - this is a package management made by Microsoft that simplifies the installation of libraries and other features in 1 line =)
Using it, you do not even need to enter the linker, and the official vcpkg website will help you configure it correctly.
Did you make sure that your project is linked with SDL2.lib and SDL2main.lib?

Suddenly getting LNK2001 errors [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 2 years ago.
Been working on this project in Visual Studio 2017 for a couple weeks, and suddenly since my last build I started getting hundreds of LNK2001 errors. The supposed unresolved symbols seem to be standard CRT and C++ stuff, for example memmove, _imp_CrtDbgReport, strlen, etc. I was doing some stuff in the config of my project so I'm betting I hovered over an option and accidentally scrolled or something, but I can't seem to see any obvious issue.
The project is still being generated with the MDd CRT, I'm not ignoring default libs. I have, however, started using a new 3rd party library, but again the supposed LNK2001 errors are for things like strlen and memcpy.
To be clear, the issue I'm facing is that the standard C and C++ library functions like strlen, memmove, etc. that I have been using the entire time (not explicitly) are suddenly showing up as unresolved external symbols.
I found the issue. I was passing in a command line argument to set the entry point to be wWinMain rather than just setting the subsystem type of the application to Windows.

unresolved external symbol (LNK 2001) error with pcap functions [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 know how to fix typical LNK2019 errors in MSVS (2013) but I'm having some extra trouble when trying to use winpcap..
I installed winpcap from this site (a couple times, actually), which supposedly installed the necessary .dlls I need, and I also installed the developer kit and pointed the linker to it as so: (1), (2).
I placed WIN32 in my preprocessor directives (or rather, defines), which took away compilation errors. However, when I run the test code at the bottom of this post, I get these errors.
Test code here: http://pastie.org/10730081
Looking at your screenshot, you have added the paths to both the 64-bit and 32-bit library files. If the developers of the library were not careful to use different names for their 64-bit and 32-bit editions, then the linker won't be able to find the right functions.
It is searching first in the 64-bit folder (because that's the one you have listed first), but you are compiling the application targeting a 32-bit architecture (the "Win32" project configuration is active).
The fix is simple: make sure that you have matched up the "Library Directories" with your project configuration:
Win32 → C:\code\C++\libs\WpdPack\Lib\
x64 → C:\code\C++\libs\WpdPack\Lib\x64\

Linking dependency to static library? [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 8 years ago.
I have a small console application that makes use of the MySql C/C++ connector interface.
I'd like to make a static library out of the existing code and am wondering how (or if it is possible) to link the MySql C/C++ interface with my static library seeing as there is no "Link" tab in the properties dialog of the project.
I'd basically like to link my static library to a new project and have everything work as it did in my old console application.
Is there a way of doing this (without simply just linking the MySql C/C++ interface to the new project) or am I looking at this from the wrong angle? If so let me know what might be a better alternative.
Static library projects (i.e. that output a .lib file on a win32 environment) haven't a link tab because they're not meant to be linked when generating the output file.
Instead they concur, alongside with other .lib files, to resolve link-time dependencies in a project (e.g. executable) that requires linking.
To do what you want you just need to include the necessary headers and make sure both your code and the C/C++ interface (which is also a lib file) are provided at link-time for the project that will use them and will be ultimately linked

Display frame from VNC/RFB into an OpenGL application [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 8 years ago.
I would like to be able to display remote client in a simple OpenGL application. "Simple" means only display the client such as a texture.
I started to look the VNC protocol but due to their popularity I only have few documentation related to VNCViewer. About RFB the only documentation is: http://www.realvnc.com/docs/rfbproto.pdf which is cool to understand the protocol but not enough to use it in a C++ OpenGL application. Then I found: http://libvnc.github.io/
I tried to compile the example (downloaded from github). So I added into my qtproject all rfb headers files run cmake on some of them. Then I built it but got the error:
undefined reference to `rfbMakeXCursor' and many others related to rfbXxxxx
rfb.h contains declarations to those "undefined" errors.
I don't understand what did I do wrong. Has anybody already made it work?
I'm working on Windows 8.1 64bit using C++ qtCreator and MinGW.
Headers are just ""able of contents" for the compiler to know, which functions can be called. You need to actually link to the library. The odds are, that since you've got it from GitHub you must first build the library. The built library you then add to some "extras/lib" directory in your project, configure that directory as additional library directory and add the library to the linker flags.