Compiler radiusplugin

Résolu
Bonjour,

J'essaye de compiler radiusplugin mais après un make j'ai ceci:

OBJ: RadiusClass/RadiusAttribute.o
OBJ: RadiusClass/RadiusPacket.o
OBJ: RadiusClass/RadiusConfig.o
RadiusClass/RadiusConfig.cpp: In constructor 'RadiusConfig::RadiusConfig()':
RadiusClass/RadiusConfig.cpp:31: error: 'memset' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In constructor 'RadiusConfig::RadiusConfig(char*)':
RadiusClass/RadiusConfig.cpp:47: error: 'memset' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'int RadiusConfig::parseConfigFile(const char*)':
RadiusClass/RadiusConfig.cpp:91: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:99: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:107: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:115: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:123: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:131: error: 'strncmp' was not declared in this scope
RadiusClass/RadiusConfig.cpp:133: warning: deprecated conversion from string constant to 'char*'
RadiusClass/RadiusConfig.cpp:133: warning: deprecated conversion from string constant to 'char*'
RadiusClass/RadiusConfig.cpp:144: error: 'strstr' was not declared in this scope
RadiusClass/RadiusConfig.cpp:152: error: 'atoi' was not declared in this scope
RadiusClass/RadiusConfig.cpp:156: error: 'atoi' was not declared in this scope
RadiusClass/RadiusConfig.cpp:164: error: 'atoi' was not declared in this scope
RadiusClass/RadiusConfig.cpp:172: error: 'atoi' was not declared in this scope
RadiusClass/RadiusConfig.cpp:175: error: 'strstr' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'void RadiusConfig::setServiceType(char*)':
RadiusClass/RadiusConfig.cpp:265: error: 'strncpy' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'void RadiusConfig::setFramedProtocol(char*)':
RadiusClass/RadiusConfig.cpp:279: error: 'strncpy' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'void RadiusConfig::setNASPortType(char*)':
RadiusClass/RadiusConfig.cpp:296: error: 'strncpy' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'void RadiusConfig::setNASIdentifier(char*)':
RadiusClass/RadiusConfig.cpp:312: error: 'strncpy' was not declared in this scope
RadiusClass/RadiusConfig.cpp: In member function 'void RadiusConfig::setNASIpAddress(char*)':
RadiusClass/RadiusConfig.cpp:329: error: 'strncpy' was not declared in this scope
make: *** [RadiusClass/RadiusConfig.o] Error 1


Je ne comprends pas trop l'erreur. Après le recherche sur la toile je n'ai rien trouvé de concluant.

Une idée?

9 réponses

  1. Contributeur
    Oui j'en ai trouvé un autre http://www.vyatta.org/forum/viewtopic.php?p=5808&sid=e6807f8ffed673dc6b774cae72e346f5
    mais (bete que je suis) je ne sais pas dans quel fichier de dois le mettre?
    1. Contributeur
      ok, après avoir lu plus attentivement il s'avere qu'il fallait modifier plusieurs fichiers mais cela ne marche pas.

      Concernant ton lien, le gars dis que CVS repository contient la solution. Ok, mais il est ou ce dépôt CVS?
      1. Modérateur
        Tu as plusieurs fichiers à modifier.
        diff --git a/Config.h b/Config.h
        diff --git a/IpcSocket.h b/IpcSocket.h
        diff --git a/RadiusClass/RadiusConfig.h b/RadiusClass/RadiusConfig.h
        diff --git a/User.h b/User.h


        S'il avait 4 fichiers il aurait été plus facile le faire avec patch

        L'idée est que les lignes qui débutent avec en +, ben, il faut les rajouter.
        Je te souligne le fichier.
        Les lignes à rajouter dans les fichiers je les mets en gras.

        La ligne en gras soulignée il faut la supprimer

        Fichier Config.h
        diff --git a/Config.h b/Config.h
        index 5aa75ac..0fd1df1 100644
        --- a/Config.h
        +++ b/Config.h
        @@ -22,6 +22,8 @@
         #ifndef _CONFIG_H_
        
         #define _CONFIG_H_
        +#include <string.h>
        +
         #include <fstream>
         #include <iostream>


        Fichier IpcSocket.h
        diff --git a/IpcSocket.h b/IpcSocket.h
        index e286be3..48d83f9 100644
        --- a/IpcSocket.h
        +++ b/IpcSocket.h
        @@ -21,6 +21,7 @@
        
         #ifndef _IPCSOCKET_H_
         #define _IPCSOCKET_H_
        +#include <string.h>
        
         #include <string>
         #include "User.h"


        Fichier RadiusClass/RadiusConfig.h
        diff --git a/RadiusClass/RadiusConfig.h b/RadiusClass/RadiusConfig.h
        index 6f1612f..f0f92d6 100755
        --- a/RadiusClass/RadiusConfig.h
        +++ b/RadiusClass/RadiusConfig.h
        @@ -22,11 +22,13 @@
         #ifndef _CONFIGPARSER_H_
        
         #define _CONFIGPARSER_H_
        +#include <stdlib.h>
        +#include <string.h>
        +
         #include <fstream>
         #include <iostream>
        
         #include "RadiusServer.h"
        -#include"RadiusServer.h"
         #include "error.h"
        
         #include <list>


        Fichier User.h
        diff --git a/User.h b/User.h
        index 9bed4a6..8d0a8f7 100644
        --- a/User.h
        +++ b/User.h
        @@ -21,6 +21,8 @@
        
         #ifndef _USER_H_
         #define _USER_H_
        +#include <string.h>
        +
         #include <string>
         #include <iostream>
         #include <stdio.h>
        


        1. Modérateur
           cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/radiusplugin co radiusplugin


          Et le résultat de make sur Debian Testing
          :~/src/radiusplugin$ make
          OBJ:  RadiusClass/RadiusAttribute.o 
          OBJ:  RadiusClass/RadiusPacket.o 
          OBJ:  RadiusClass/RadiusConfig.o 
          OBJ:  RadiusClass/RadiusServer.o 
          OBJ:  RadiusClass/RadiusVendorSpecificAttribute.o 
          OBJ:  AccountingProcess.o 
          OBJ:  Exception.o 
          OBJ:  PluginContext.o 
          OBJ:  UserAuth.o 
          OBJ:  AcctScheduler.o 
          OBJ:  IpcSocket.o 
          OBJ:  radiusplugin.o 
          OBJ:  User.o 
          OBJ:  AuthenticationProcess.o 
          OBJ:  main.o 
          OBJ:  UserAcct.o 
          OBJ:  UserPlugin.o 
          OBJ:  Config.o 
          BIN:  radiusplugin.so 

          1. Contributeur
            on se croisé

            On fait j'ai fait ces modifications mais maintenant j'ai:

            BIN:  radiusplugin.so 
            /usr/bin/ld: RadiusClass/RadiusAttribute.o: relocation R_X86_64_32 against 'a local symbol' can not be used when making a shared object; recompile with -fPIC
            RadiusClass/RadiusAttribute.o: could not read symbols: Bad value
            collect2: ld returned 1 exit status
            make: *** [radiusplugin.so] Error 1
            
          2. Contributeur
            mais ca c'est quoi une commande (car elle ne marche pas)

            cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/radiusplugin co radiusplugin


            ?
            1. Contributeur
              Nikel! Franchement t'es un chef!

              Merci pour ton temps!