[Qt-interest] How to compile the SNMP++ with QT and use it .

John McClurkin jwm at nei.nih.gov
Tue Apr 13 18:55:08 CEST 2010


jiangzhw2008 wrote:
> 
> Hi all, please, help me with this task. I'm new to C++ and QT.
> I am design a Quantitative assessment of information security detection 
> system written with QT. I need a SNMP implementation library.
> I have chosen this one : 
> http://www.agentpp.com/snmp_pp3_x/download_snmp_ppv3/download_snmp_ppv3.html
> more specifically http://www.agentpp.com/snmp++v3.2.24.tar.gz 
> <http://www.agentpp.com/snmp++v3.2.23.tar.gz> this archive,
> 
> I am using Windows XP. The project is written in QT, my IDE is the QT 
> Creator1.3.
> 
> The SNMP lib that I gave you link for is just an archive with sources.
> 
> I've compile the libdes.a in the snmp++v3.2.24.tar.gz 
> <http://www.agentpp.com/snmp++v3.2.23.tar.gz> with QT creator 
> successfully,but failed in compiling the dll or lib of snmp++. While I 
> compiled with VS2005 ,i got the libdes.lib and snmp++.lib,but when i 
> added these to the QT project,the QT couldn't recognized the function in 
> snmp++.
> 
> I googled much,it's said the dll compiled by msvc can not recognized by 
> QT for the different format of lib between them, I tried to add extern C 
> declartion and using pexports,dlltool to tranformate the lib but failed!
> 
> Is there a good way to solve this?Could someone be so kind to  give me a 
> snmp++ example of QT4 (lib included)?
> I'm considering to construct a qt IDE in VS2005,would then the lib 
> compiled by msvc can recoginzed by this IDE?
> 
You seem to be trying to intermix Visual Studio and Gnu. That is way 
more trouble than it is worth. The fact that your archive ends with 
.tar.gz suggests that it is targeted at 'nix operating systems. 
QtCreator uses the Gcc compiler in MinGW (Minimum Gnu for Windows). The 
file libdes.a that you created in QtCreator is a static library. If you 
build your application in QtCreator you can just link it in. Gcc will 
not create .dll or .lib files. Those are Microsoft shared library 
extensions. Shared libraries built with Gcc will have the extension .so. 
My advice would be to stick to QtCreator. You already built the library 
statically. Just compile your application with QtCreator and link in 
that library. You can link both static and shared libraries into an 
application




More information about the Qt-interest-old mailing list