Avatar billede conrad Nybegynder
13. oktober 2003 - 13:39 Der er 5 kommentarer og
1 løsning

import obsolete warning

Jeg får en import obsolete warning når jeg compiler. Jeg bruger g++ på en red hat 7.2 og KDevelop 2.0. Jeg har kun 4 filer som jeg bruger i min makefile, porblemet opstod da jeg tilføjede nr 4.

Hvad er der galt?
Avatar billede arne_v Ekspert
13. oktober 2003 - 13:48 #1
Kan du poste den præcise fejl tekst ?

Som evt. forklare om der er noget specielt i #4.
Avatar billede conrad Nybegynder
13. oktober 2003 - 14:04 #2
Fejlen>
[lennart@dhcppc1 trust]$ make
g++ -c Main.cpp TrustManager.cpp TrustCalculator.cpp TrustValue.cpp -s
In file included from Main.cpp:3:
TrustCalculator.h:3:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
In file included from TrustCalculator.cpp:1:
TrustCalculator.h:3:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
g++ -o trust Main.o TrustManager.o TrustCalculator.o TrustValue.o -s
Avatar billede conrad Nybegynder
13. oktober 2003 - 14:05 #3
og .h filen
#ifndef TRUSTCALCULATOR_H
#define TRUSTCALCULATOR_H
#import "TrustValue.h"
/*
**    By Lennart Conrad 12-10-2003
**  The TrustCalculator class is an abstract class.
**     Subclasses implementing different strategies should impmement the calculate() methods
**    implementation are found in TrustCalculator.cpp
**
*/
class TrustCalculator
{


    public:
    //Constructor
  //TrustCalculator();
    //methods
    virtual double calculate(TrustValue&)=0;//abstract methods
   
};       
//implementing class - strategy 1
class TrustCalculatorS1 : public TrustCalculator
{


    public:
    //Constructor
  TrustCalculatorS1();
    //methods
    double calculate(TrustValue&);
   
};   
//implementing class - strategy 2
class TrustCalculatorS2 : public TrustCalculator
{
    public:
    //Constructor
  TrustCalculatorS2();
    //methods
    double calculate(TrustValue&);
   
};   
#endif //TRUSTCALCULATOR_H
Avatar billede arne_v Ekspert
13. oktober 2003 - 14:12 #4
#import "TrustValue.h"

????

Mener du ikke:

#include "TrustValue.h"
Avatar billede conrad Nybegynder
13. oktober 2003 - 14:19 #5
Jo selvfølgelig :-0 (pinlig), svarer du lige Arne
Avatar billede arne_v Ekspert
13. oktober 2003 - 14:22 #6
svar
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester