Problème de link d'une librairie ".lib"
Bonjour, je viens à vous pour soliciter votre regard et vos compétences, parce que je vous avoue que je tourne en rond depuis une bonne semaine sur ce problème.
Mon code permet de récupérer le nom de l'OS de l'ordinateur, via le protocole SNMP. Pour ce faire, j'ai utilisé l'API : SNMP++.
Je dev sous Windows 7 édition familiale avec QtCreator.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#include <QtCore/QCoreApplication>
#define SYSDESCR "1.3.6.1.2.1.1.1.0" //Définit l'adresse dans la MIB de l'info que je cherche
#include <iostream>
#include <windows.h>
/*------------------------LIBRAIRIE PROPRE A SNMP++--------------*/
#include <snmp_pp.h>
#include <snmp.h>
#include <oid.h>
#include <vb.h>
#include <target.h>
#include <pdu.h>
#include <address.h>
/*-----------------------------------------------------------------*/
using namespace std;
/*---------------------------DECLARATION-------------------------*/
void get_system_descriptor()
{
int status;
CTarget ctarget((IpAddress) "10.4.8.5");
Vb vb (SYSDESCR);
Pdu pdu;
/*-----------------------------------------------------------------*/
/*-----------------CREATION DE LA SESSION SNMP-----------------*/
Snmp snmp(status);
if (status != SNMP_CLASS_SUCCESS)
{
cout << snmp.error_msg (status);
return;
}
/*----------------------------------------------------------------*/
/*---------------------------REQUETE----------------------------*/
pdu += vb;
if ((status = snmp.get (pdu, ctarget)) != SNMP_CLASS_SUCCESS)
cout << snmp.error_msg (status);
else
{
pdu.get_vb (vb, 0);
cout << "System Descriptor = "<< vb.get_printable_value();
}
/*----------------------------------------------------------------*/
//INT MAIN EN COMMENTAIRE PARCE CE QUE JE NE SAIS PAS QUOI EN FAIRE //!!!!
/*int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}*/
} |
J'ai inclus ceci dans le fichier .pro :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #-------------------------------------------------
#
# Project created by QtCreator 2013-02-04T10:05:52
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = snmp
CONFIG += console
CONFIG -= app_bundle
CONFIG += stl
TEMPLATE = app
win32:INCLUDEPATH += $$quote(T:/Projet BTS IRIS/CD SNMP/snmp++/binaries/win32/include)
win32:LIBS += $$quote(T:/Projet BTS IRIS/CD SNMP/snmp++/binaries/win32/release/snmp_pp.lib)
SOURCES += main.cpp |
Et donc le fameux problème que je rencontre est à la compilation, voici le message d'erreur que j'obtiens :
http://img15.hostingpics.net/pics/393043Capture.png
Merci mille fois pour toutes les indications que vous pourriez m'apporter ! :ccool: