[C++] Problème de compilation d'une appli en C++

Problème de compilation d'une appli en C++ [C++] - C++ - Programmation

Marsh Posté le 08-06-2002 à 18:42:05    

Voici les erreurs affichées :

Code :
  1. gcc -g -O2 -fno-rtti -fno-exceptions -Wall -W  -o authvmailmgr  authvmailmgr.o authvlib.o ../lib/libvmailmgr.a -L../lib/courier-authlib -lauthmod -lcrypt
  2. authvlib.o: In function `set_user(pwentry const*)':
  3. /home/admin/vmailmgr-0.96.9/authenticate/authvlib.cc:56: undefined reference to `operator new(unsigned)'
  4. /home/admin/vmailmgr-0.96.9/authenticate/authvlib.cc:59: undefined reference to `operator delete(void*)'
  5. authvlib.o: In function `check(mystring, mystring, bool)':
  6. /home/admin/vmailmgr-0.96.9/authenticate/authvlib.cc:81: undefined reference to `operator new(unsigned)'
  7. /home/admin/vmailmgr-0.96.9/authenticate/authvlib.cc:93: undefined reference to `operator new(unsigned)'
  8. authvlib.o: In function `check(mystring, mystring, bool)':
  9. <cut>
  10. La fonction en question avec la ligne qui merdouille :
  11. void set_user(const pwentry* pw)
  12. {
  13.   pw->export_env();
  14.   if(!!exec_presetuid && execute(exec_presetuid))
  15.     fail_temporary("Execution of presetuid failed" );
  16.   if(setgid(pw->gid) == -1 ||
  17.      setuid(pw->uid) == -1 ||
  18.      chdir(pw->home.c_str()) == -1)
  19.     fail_temporary("Bad user data in password file" );
  20.   domain = new vdomain(*pw);
  21.   config = &domain->config;
  22. }
  23. Le header pour la class vdomain :
  24. class vdomain
  25. {
  26. public:
  27.   const mystring subdir;
  28.   const mystring prefix;
  29.   const configuration config;
  30. private:
  31.   vpwtable* ptable;
  32.   // Helper functions for chattr
  33.   response chpass(vpwentry*, mystring);
  34.   response chdest(vpwentry*, mystring);
  35. public:
  36.   vdomain(const pwentry&);
  37.   vdomain(const pwentry&, mystring, mystring, const configuration&);
  38.   ~vdomain();
  39.   vpwtable* table();
  40.   mystring userdir(mystring username) const;
  41.   // Virtual user manipulation functions
  42.   vpwentry* lookup(mystring name, bool nodefault);
  43.   bool exists(mystring name);
  44.   response set(const vpwentry*, bool onlyadd, mystring maildir = "" );
  45.   response chattr(mystring user, unsigned attr, mystring newval);
  46.   response chattr(const vpwentry*, unsigned attr, mystring newval);
  47.   response deluser(mystring name, bool del_mailbox);
  48.   // Virtual user validation functions
  49.   response validate_forward(mystring);
  50.   bool validate_username(mystring) const;
  51.   bool validate_password(mystring) const;
  52.   static const unsigned ATTR_PASS = 1;
  53.   static const unsigned ATTR_DEST = 2;
  54.   static const unsigned ATTR_HARDQUOTA = 3;
  55.   static const unsigned ATTR_SOFTQUOTA = 4;
  56.   static const unsigned ATTR_MSGSIZE = 5;
  57.   static const unsigned ATTR_MSGCOUNT = 6;
  58.   static const unsigned ATTR_EXPIRY = 7;
  59.   static const unsigned ATTR_MAILBOX_ENABLED = 8;
  60.   static const unsigned ATTR_PERSONAL = 9;
  61. };
  62. Le fichier vdomain.cc :
  63. vdomain::vdomain(const pwentry& user)
  64.   : subdir(), prefix(),
  65.     config(&user.config, user.home + "/" LOCAL_CONFIG_DIR),
  66.     ptable(0)
  67. {
  68. }
  69. vdomain::~vdomain()
  70. {
  71. }


Vous auriez une idée de ce qui pourrait causer ca :??:


Message édité par joce le 06-08-2002 à 18:42:40
Reply

Marsh Posté le 08-06-2002 à 18:42:05   

Reply

Marsh Posté le 08-06-2002 à 18:45:27    

vdomain(const pwentry&) const;
al la place de  
vdomain(const pwentry&);
 
C'est un constructeur pour le objet constant s

Reply

Marsh Posté le 08-06-2002 à 18:51:59    

oki, je teste ca :)

Reply

Marsh Posté le 08-06-2002 à 18:52:17    

Code :
  1. test smilie :) ;)


:) ;)

Reply

Marsh Posté le 08-06-2002 à 18:55:29    

marche pas :/
 
c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I..    -g -O2 -fno-rtti -fno-exceptions -Wall -W -c vdomain.cc
In file included from vdomain.cc:18:
vdomain.h:23: constructors may not be `const'

Reply

Marsh Posté le 08-06-2002 à 19:13:10    

t'as quelle version de gcc?
en utilisant g++, blablabla...


---------------
Horizon pas Net, reste à la buvette!!
Reply

Marsh Posté le 08-06-2002 à 21:10:28    

Willyzekid a écrit a écrit :

t'as quelle version de gcc?
en utilisant g++, blablabla...  




 
[root@forum] /home/admin/vmailmgr-0.96.9> c++ --version
c++ (GCC) 3.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Message édité par joce le 06-08-2002 à 21:11:06
Reply

Marsh Posté le 08-06-2002 à 21:49:43    

Faut virer le const de l'autre abruti et utiliser g++ et non gcc.

Reply

Marsh Posté le 08-06-2002 à 21:50:43    

Verdoux a écrit a écrit :

Faut virer le const de l'autre abruti et utiliser g++ et non gcc.  




 
Mais putain c'est ce que j'ai dit!!! :( :sweat:
 

Willyzekid a écrit a écrit :

t'as quelle version de gcc?
en utilisant g++, blablabla...




 
Bon c'est vrai qu'en relisant, c'est pas clair :D


Message édité par Willyzekid le 06-08-2002 à 21:51:30

---------------
Horizon pas Net, reste à la buvette!!
Reply

Marsh Posté le 08-06-2002 à 22:51:51    

ah vi tient ca marche tout d'un coup :D
 
v allez bidouiller le makefile moa :heink:

Reply

Marsh Posté le 08-06-2002 à 22:51:51   

Reply

Marsh Posté le 08-06-2002 à 22:54:09    

dans un autre fichier :
 

Code :
  1. void fail(const char* msg, const char* execfile, int code)
  2. {
  3.   presetenv("CHECKVPW_ERROR=", msg);
  4.   execute(execfile);
  5.   exit(code);
  6. }
  7. c++ -DHAVE_CONFIG_H -I. -I. -I..  -I../lib    -g -O2 -fno-rtti -fno-exceptions -Wall -W -c checkvpw.cc
  8. checkvpw.cc: In function `void fail(const char*, const char*, int)':
  9. checkvpw.cc:33: `exit' undeclared (first use this function)
  10. checkvpw.cc:33: (Each undeclared identifier is reported only once for each
  11.    function it appears in.)

Reply

Marsh Posté le 08-06-2002 à 22:56:44    

pour exit, je crois que c'est :  
#include <stdlib.h>

Reply

Marsh Posté le 08-06-2002 à 22:59:43    

#include <stdlib.h>


---------------
Horizon pas Net, reste à la buvette!!
Reply

Marsh Posté le 08-06-2002 à 22:59:47    

putain mais il est horrible ce package de vmailmgr, rien n'est standard :/

Reply

Marsh Posté le 08-06-2002 à 23:00:11    

chrisbk a écrit a écrit :

pour exit, je crois que c'est :  
#include <stdlib.h>  




 
tu commence a me les brouter toi !!! :D


---------------
Horizon pas Net, reste à la buvette!!
Reply

Marsh Posté le 08-06-2002 à 23:02:07    

Willyzekid a écrit a écrit :

 
 
tu commence a me les brouter toi !!! :D  




 
 
Ecoute, coyote, y'en a un de nous deux qui est de trop ici, et je crois bien que j'etais la avant toi, alors tu vois ce qu'il te reste a faire :D

Reply

Marsh Posté le 08-06-2002 à 23:02:50    

joce a écrit a écrit :

putain mais il est horrible ce package de vmailmgr, rien n'est standard :/  




Remarque, sur ma debian, g++ trouve tout seul 'exit'.
Apparemment stdio et stdlib sont inclus d'office ...

Reply

Marsh Posté le 08-06-2002 à 23:05:38    

Verdoux a écrit a écrit :

 
Remarque, sur ma debian, g++ trouve tout seul 'exit'.
Apparemment stdio et stdlib sont inclus d'office ...  




surement une nouveauté de gcc 3.0.x ou 3.1, au choix :p

Reply

Marsh Posté le 08-06-2002 à 23:06:15    

joce a écrit a écrit :

 
surement une nouveauté de gcc 3.0.x ou 3.1, au choix :p  




Non, j'ai la version 2.95.2 :D

Reply

Marsh Posté le 08-06-2002 à 23:10:53    

Verdoux a écrit a écrit :

 
Non, j'ai la version 2.95.2 :D  




non la nouveauté de gcc 3.x c'est surement de pas inclure d'office je veux dire (vu que c'est plus proche de la norme)


Message édité par joce le 06-08-2002 à 23:10:58
Reply

Marsh Posté le 08-06-2002 à 23:33:42    

joce a écrit a écrit :

 
non la nouveauté de gcc 3.x c'est surement de pas inclure d'office je veux dire (vu que c'est plus proche de la norme)  




 
Oui et c'est pour ca que j'ai demandé la version!!!
 
Je suis un incompris :( :sweat:


---------------
Horizon pas Net, reste à la buvette!!
Reply

Marsh Posté le    

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed