C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

erreur de compilation

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
Drakkhen
Guest





PostPosted: Mon May 17, 2004 11:16 am    Post subject: erreur de compilation Reply with quote



Bonjour,

J'ai une erreur de compilation et comme d'habitude en C++ je ne comprends
rien au message du compilo.

Le message du compilo est:
fatal error C1010: unexpected end of file while looking for precompiled
header directive


Voici le fichier d'entete (le nom du fichier est probGammaShort.h):

#ifndef PROBGAMMASHORT_H

#define PROBGAMMASHORT_H

double gamma (double x);

double r_huge ( void );

double r_epsilon ( void );

#endif



Voici le fichier cpp :



#include <stdlib>

#include <math>

#include "probGammaShort.h"

using namespace std;

double gamma ( double x )

{

double c[7] = {

-1.910444077728E-03,

8.4171387781295E-04,

-5.952379913043012E-04,

7.93650793500350248E-04,

-2.777777777777681622553E-03,

8.333333333333333331554247E-02,

5.7083835261E-03 };

double fact;

int i;

int n;

double p[8] = {

-1.71618513886549492533811E+00,

2.47656508055759199108314E+01,

-3.79804256470945635097577E+02,

6.29331155312818442661052E+02,

8.66966202790413211295064E+02,

-3.14512729688483675254357E+04,

-3.61444134186911729807069E+04,

6.64561438202405440627855E+04 };

bool parity;

double pi =

3.14159265358979323846264338327950288419716939937510E+00;

double q[8] = {

-3.08402300119738975254353E+01,

3.15350626979604161529144E+02,

-1.01515636749021914166146E+03,

-3.10777167157231109440444E+03,

2.25381184209801510330112E+04,

4.75584627752788110767815E+03,

-1.34659959864969306392456E+05,

-1.15132259675553483497211E+05 };

double sqrtpi = 0.9189385332046727417803297E+00;

double sum2;

double value;

double xbig = 35.040E+00;

double xden;

double xminin = 1.18E-38;

double xnum;

double y;

double y1;

double ysq;

double z;

//

parity = false;

fact = 1.0E+00;

n = 0;

y = x;

//

// Argument is negative.

//

if ( y <= 0.0E+00 )

{

y = -x;

y1 = ( double ) ( ( int ) ( y ) );

value = y - y1;

if ( value != 0.0E+00 )

{

if ( y1 != ( double ) ( ( int ) ( y1 * 0.5E+00 ) ) * 2.0E+00 )

{

parity = true;

}

fact = -pi / sin ( pi * value );

y = y + 1.0E+00;

}

else

{

value = r_huge ( );

return value;

}

}

//

// Argument < EPS

//

if ( y < r_epsilon ( ) )

{

if ( xminin <= y )

{

value = 1.0E+00 / y;

}

else

{

value = r_huge ( );

return value;

}

}

else if ( y < 12.0E+00 )

{

y1 = y;

//

// 0.0E+00 < argument < 1.0E+00

//

if ( y < 1.0E+00 )

{

z = y;

y = y + 1.0E+00;

}

//

// 1.0E+00 < argument < 12.0E+00, reduce argument if necessary.

//

else

{

n = int ( y ) - 1;

y = y - ( double ) ( n );

z = y - 1.0E+00;

}

//

// Evaluate approximation for 1.0E+00 < argument < 2.0.

//

xnum = 0.0E+00;

xden = 1.0E+00;

for ( i = 0; i < 8; i++ )

{

xnum = ( xnum + p[i] ) * z;

xden = xden * z + q[i];

}

value = xnum / xden + 1.0E+00;

//

// Adjust result for case 0.0E+00 < argument < 1.0.

//

if ( y1 < y )

{

value = value / y1;

}

//

// Adjust result for case 2.0E+00 < argument < 12.0.

//

else if ( y < y1 )

{

for ( i = 1; i <= n; i++ )

{

value = value * y;

y = y + 1.0E+00;

}

}

}

//

// Evaluate for 12 <= argument.

//

else

{

if ( y <= xbig )

{

ysq = y * y;

sum2 = c[6];

for ( i = 0; i < 6; i++ )

{

sum2 = sum2 / ysq + c[i];

}

sum2 = sum2 / y - y + sqrtpi;

sum2 = sum2 + ( y - 0.5E+00 ) * log ( y );

value = exp ( sum2 );

}

else

{

value = r_huge ( );

return value;

}

}

//

// Final adjustments and return.

//

if ( parity )

{

value = -value;

}

if ( fact != 1.0E+00 )

{

value = fact / value;

}

return value;

}



double r_huge ( void )

{return HUGE_VAL;

}







double r_epsilon ( void )

{

double r;

r = 1.0E+00;

while ( 1.0E+00 < ( double ) ( 1.0E+00 + r ) )

{

r = r / 2.0E+00;

}

return ( 2.0E+00 * r );

}



Pourriez-vous m'aider svp ?



merci.


Back to top
Drakkhen
Guest





PostPosted: Mon May 17, 2004 12:36 pm    Post subject: Re: erreur de compilation Reply with quote



L'erreur de compilation venait d'une option de compilation par defaut /Yu.
En la mettant en /YX cela marche.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.