.net won't find my math include file


#1

Hi,
Just written a simple plugin but when I go to build, i get the error:

fatal error C1083: Cannot open include file: ‘math’: No such file or directory

the code I have for the includes is (in part):
#include <string>

#include <iostream>

#include <math>

it finds the others ok, and math.h is in what appears to be the correct folder, i’m using the .net version of C++. Any clues, I’m new to plugins.

AnDy


#2

Could it be because string and iostream are C++ libs and therefore don’t need a “.h” extension, but the maths lib (which is standard C) needs the extension?

Just a guess? :shrug:


#3

it was because I didn’t have

#define REQUIRE_IOSTREAM

on the top line. A new learning curve for me :slight_smile: should be fun tho, I have some cool ideas for stuff to write, its like everything with me, slog slog, then all of a sudden “ding” as the penny drops, all seems clear, and off I skip over the sunset.

Now it complies ok, I just don’t get the output I expect.

AnDy


#4

if your header file is called “math.h”, then you include directive should be

#include <math[b].h[/b]>

iirc the #define REQUIRE_IOSTREAM just forces vc++ to use the .h versions of your c++ stdlib headers rather than the newer versions with no extensions…


#5

i did try using the .h extension on it, but maybe i was being thick, although this is another useful peice of info thanks for the info m8.

AnDy


#6

Is there a <cmath> as part of the standard library?

Simon


#7

See,

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrf_cmath_header.asp

“Defines the macros traditionally defined in the Standard C library header <math.h>.”

“Including this header also ensures that the names declared with external linkage in the Standard C library header are declared in the std namespace. In this implementation, the names may or may not also be declared in the global namespace, depending on the specific translation environment.”

-mk-


#8

The header you need is <cmath>. <math.h> is deprecated, like most of the old .h extension header files.


#9

i will try on friday, I’m stuck with no laptop at the moment, so I can’t play :frowning: weep

Thanks for all the help guys.


#10

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.