-2

how do I link the bare minimum of the Qt library to my project/exe?

I don't want to use anything from Qt except the networking library, and even then (if possible) the needed part of it only.

How do I do that?

EDIT: What I want from Qt is only the networking library, and if possible, only the TCP part. (this: http://doc.qt.io/qt-5/qtnetwork-module.html shows lots of unnecessary stuff)

w4j3d
  • 341
  • 2
  • 6
  • 12
  • What is that "needed part of it" you speak of? Checksum calculation? Signal handling? The obvious answer is: identify the part you want and reuse it. Although that would be considered bad practice: you'd copy/paste code you have little understanding of and would then not benefit from subsequent updates... – Linus Kleen Feb 12 '16 at 21:45
  • the needed part is what my code relies on. (assuming I can tell the compiler to include only that). I'm still new to qt, I'm just trying to determine whether to use it or not. – w4j3d Feb 12 '16 at 21:47
  • With a properly-designed library, when you link to it you only get the pieces you need. Just like a real library: you don't have to take home all the books if you're only interested in the books on networking. – Pete Becker Feb 12 '16 at 21:48
  • If you need qt for networking *only* you might want to look somewhere else first; there must be a better alternative you desist from mentioning. As to my knowledge (hence the comment, not an answer) there's no way to tell a *linker* (not the compiler) to exclude certain unwanted parts of precompiled libraries. – Linus Kleen Feb 12 '16 at 21:51
  • There's plenty of information about deploying Qt applications in the docs. What part are you having trouble with, specifically? – MrEricSir Feb 12 '16 at 21:59
  • @LinusKleen was looking at Winsocks, but it isn't simple/straight forward as Java/C#; Qt is. – w4j3d Feb 12 '16 at 22:00
  • So it's Qt's compatibility layer for Windows networking you're interested in? Why not update the question and its tags to include this *minor* detail? That lures in people that might actually help your issue (rather than try to defend SO purity standards on how to ask questions like I do). – Linus Kleen Feb 12 '16 at 22:10

1 Answers1

3

If all you need is a portable TCP socket library, you don't need Qt, there are plenty of small portable libraries that will do the job.

Qt is not a library, it is an application development framework, it consists of many libraries and tools, and many rely on others. Even if you only want to use Qt5Network, it will still require Qt5Core, the Qt toolchain, MOC and all the Qt idioms for using it.

dtech
  • 47,916
  • 17
  • 112
  • 190