最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dll - Query related to library linking in C++ - Stack Overflow

programmeradmin4浏览0评论

Below is the example directory structure, on the basis of which, I would define my problem faced.

MySQL Connector Folder
|
|___bin
|
|___include
|   |
|   |___mysqlx
|       |
|       |___xdevapi.h
|
|___lib64
    |
    |___vs14
    |   |
    |   |___mysqlcppconn-static.lib
    |   |___libssl.lib
    |   |___extra.lib
    |   |___extra.lib
    |
    |___libssl-3-x64.dll

---------------------------------------------------------------

Project Folder
|
|___main.cpp

I have made the project in visual studio ide and wish to proceed further in that only.
So, what I have done is, in my main, I am using the #include "xdevapi.h", header and I have also set the directory for the additional include directories, in the project properties.
The problem comes in the linker part, I mean, how can I determine, in which library are the functions for the xdevapi.h defined in, are those declared functions a part of the dynamic library or the static library, which library, do I need to link.
For example, take that xdevapi.h, just declares the functions, defined in the static library, mysqlcppconn-static.lib, so I would just need to link that library in my project, all the other libraries would be unnecessary for this project. The extra.lib, would be extra here.
In short, if I could summarize my question, it would be how can I determine which library is required to include a specific header file in my code.
Tried, reading the documentation, was of no help, everything, just went over my head, had some cmake in it, which I don't understand a bit. So, if there is any other way, it would be very helpful.

I just want to be able to determine, which library is required in my project and where could, I get that, if the documentation is complex to understand, I am kind of at beginner level of learning cpp.

发布评论

评论列表(0)

  1. 暂无评论