Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1464 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  Problème d'include lié à iostream et SNMP++

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème d'include lié à iostream et SNMP++

n°2173973
Memphis277
Posté le 04-02-2013 à 11:50:50  profilanswer
 

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. #include <QtCore/QCoreApplication>
  2. #define SYSDESCR "1.3.6.1.2.1.1.1.0" //Définit l'adresse dans la MIB de l'info que je cherche
  3. #include <iostream>
  4. #include <windows.h>
  5. /*------------------------LIBRAIRIE PROPRE A SNMP++--------------*/
  6. #include <snmp_pp.h>
  7. #include <snmp.h>
  8. #include <oid.h>
  9. #include <vb.h>
  10. #include <target.h>
  11. #include <pdu.h>
  12. #include <address.h>
  13. /*-----------------------------------------------------------------*/
  14. using namespace std;
  15. /*---------------------------DECLARATION-------------------------*/
  16. void get_system_descriptor()
  17. {
  18.     int status;
  19.     CTarget ctarget((IpAddress) "10.4.8.5" );
  20.     Vb vb (SYSDESCR);
  21.     Pdu pdu;
  22. /*-----------------------------------------------------------------*/
  23. /*-----------------CREATION DE LA SESSION SNMP-----------------*/
  24. Snmp snmp(status);
  25. if (status != SNMP_CLASS_SUCCESS)
  26. {
  27.     cout << snmp.error_msg (status);
  28.     return;
  29. }
  30. /*----------------------------------------------------------------*/
  31. /*---------------------------REQUETE----------------------------*/
  32. pdu += vb;
  33. if ((status = snmp.get (pdu, ctarget)) != SNMP_CLASS_SUCCESS)
  34.     cout << snmp.error_msg (status);
  35. else
  36. {
  37.     pdu.get_vb (vb, 0);
  38.     cout << "System Descriptor = "<< vb.get_printable_value();
  39. }
  40. /*----------------------------------------------------------------*/
  41. //INT MAIN EN COMMENTAIRE PARCE CE QUE JE NE SAIS PAS QUOI EN FAIRE //!!!!
  42. /*int main(int argc, char *argv[])
  43. {
  44.     QCoreApplication a(argc, argv);
  45.     return a.exec();
  46. }*/
  47. }


 
J'ai inclus ceci dans le fichier .pro :
 

Code :
  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2013-02-04T10:05:52
  4. #
  5. #-------------------------------------------------
  6. QT       += core
  7. QT       -= gui
  8. TARGET = snmp
  9. CONFIG   += console
  10. CONFIG   -= app_bundle
  11. CONFIG += stl
  12. TEMPLATE = app
  13. win32:INCLUDEPATH += $$quote(T:/Projet BTS IRIS/CD SNMP/snmp++/binaries/win32/include)
  14. win32:LIBS += $$quote(T:/Projet BTS IRIS/CD SNMP/snmp++/binaries/win32/release/snmp_pp.lib)
  15. 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:

mood
Publicité
Posté le 04-02-2013 à 11:50:50  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  Problème d'include lié à iostream et SNMP++

 

Sujets relatifs
problème format celluleProblème d'algorithme pour mon moteur 3D
Probleme : Tableau de pointeurs sur structure[RESOLU] Problème de version de PHP (ou ZEND) ?
Problème bandeau joomlaProbleme ERREUR PDO
Problème génération labyrintheProblème entre Doctype et un script
[VBS] Script Language problème aide svpproblème CSS externe pour facebook box
Plus de sujets relatifs à : Problème d'include lié à iostream et SNMP++


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR