Sign in to follow this  

stderr problem

This topic is 3849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, im quite new to this c++ game programming. started out last year and im using allegro. im trying to learn how to make tile based game using allegro and found this website : http://www.ccpssolutions.com/agps/agps_p2.html so i tried to compile the source code, but it returned an error : 'stderr' undeclared (first use this function) im not really good at c++ programming so i don't understand what it means, so can anybody help? the "Part I" of the tutorial is working fine.

Share this post


Link to post
Share on other sites
I'm not familiar with allegro but undeclared message as it say, means that linker cannot find definition of command stderr.
stderr is added via #include <stdio.h> at top of the document [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by streamer
I'm not familiar with allegro but undeclared message as it say, means that linker cannot find definition of command stderr.
stderr is added via #include <stdio.h> at top of the document [smile]


For C++, the correct header is "#include <cstdio>". Note the absence of a ".h" file type suffix.

However, you could also #include <iostream> (again no ".h") and use std::cerr instead.

Share this post


Link to post
Share on other sites
hey, thanks a lot! that problem is gone now, but there's a few more errors :

- 'text_mode' is deprecated
- 'textprintf' is deprecated

anyway the code compiled. just asking what the error means.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fishcake
hey, thanks a lot! that problem is gone now, but there's a few more errors :

- 'text_mode' is deprecated
- 'textprintf' is deprecated

anyway the code compiled. just asking what the error means.


Deprecation is a common feature of software APIs.

When older versions are replaced by newer ones, sometimes new ways of doing things are used. The older ones are then marked "deprecated", which means they are only included for compatibility with old code, and these features should not be depended on when writing new code. Deprecation often, but not always, implies that the old functions, etc will be removed completely at some point in the future when the API developers believe that most code has been "ported" to the newer way of doing things.

However, dues to peoples not unreasonable desire to keep backwards compatibility for long periods of time (for example OS programs that still work under windows XP) these features may never be truly removed.

It would be best to research your API documentation, most sane developers will mention what is the preferred replacements when they deprecate something.

Share this post


Link to post
Share on other sites

This topic is 3849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this