c++ - Build custom library without header dependency -


i made small application in qt, sending , receiving messages from/to rabbitmq broker.

i made library containing rabbitmq publisher , consumer, in turn uses amqp library here. everytime need use library in application, need copy 2 .lib files (qamqp, rabbitmqlib), plus 10 header files, , add them in .pro file (through libs , includepath).

i made similar project in c#, there needed 2 .dlls, , it.

my question : how can make same qt? 1 or 2 .lib files, included in application needs them, , that's it, no need 10 additional header files.

you can totally this. not need these headers (using them usefull) - need declare objects (types, functions, variables) using. so, if have lot of headers, use, say, 1 function, need add function declaration before use (may be, adding __declspec(dllimport), or, if using qt - q_decl_import).

but, if problem facing, adding these files pro-file, better solution here write pri-file, this:

mylib.pri

includepath   += $$pwd/headers dependpath    += $$pwd/headers  headers += \     $$pwd/headers/header1.h \     ...     $$pwd/headers/header10.h  libs += -l$$pwd/libs -lqamqp -lrabbitmqlib 

and include pro-file:

include($$path_to_common_libs/mylib/mylib.pri) 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -