User forums > General (but related to Code::Blocks)
Problems with graphics.h and winbgim.h; redefinition of 'int right'
harrykar:
--- Quote from: codeur on July 16, 2014, 01:23:51 am ---Thanks Harry, this explains why this error keeps on reappearing, while many people had no errors.
The typo is in the parameters declaration of function printimage.
--- End quote ---
exactly so codeur ;)
--- Quote ---This typo obviously slipped at some stage into the original distribution at colorado.edu.
--- End quote ---
I'm pretty new to winbgim library; i am aware of that library-and impact on that problem- definitely casualy; only because is used in a CS introductory book Problem Solving and Program Design in C i have to do a review for an educational institution; so far i ignore about library's existence and yes in the end 80's early 90's i bought (hardly with my few student's money) Borland's Pascal ,C compilers and assembler pack version 3.something but not remember had use that library. Back in that era graphics stuff were pretty new and strange/experimental for all us.
--- Quote ---It is not found in the distribution at http://winbgim.codecutter.net/ which was itself downloaded from colorado.edu before the typo got in. Codeblocks-EP uses the codecutter release which works OK.
--- End quote ---
So (if you remember well had not patch it in past) that typo was entered after you had download (either binary or source) your own copy for Codeblocks-EP and the typo was introduced later. Only in that manner make sense IMHO. Right now if you download the library (either the binary or the source) from winbgim.codecutter.net or Main's .../bgi site you can ensure that graphics.h as winbgim.h too continue to be erratic as were
--- Quote ---Your fix to the code is incorrect, which can explain why your program crashes afterwards. The correct code is:
--- Code: ---void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int top=0, int right=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
--- End code ---
--- End quote ---
No my fix was exactly as what you have written above. The crash was due (as you had hint me) to libbgi.a 's "oldness". Last but not least the new libbgi.a is smallest (-5KB) than the ancestral one mean the nowadays GCC is more effective than his great grandfather :)
Moreover is interesting note that make was not complained about graphics.h but about winbgim.h (on the same line:collumn --as gcc previously complained on graphics.h); see attachment ; graphics.h before build is erratic after winbgim.h 's correction and build graphics.h becomes correct;
--- Quote ---We are much obliged to you for resolving this old mystery.
--- End quote ---
You make me feel like Indiana Jones lol :D Thank you very much for your compliment you're welcome ;).
If permitted i will publicly
Thank especially you for your hint that help resolve the particular arcane,
Thank the people here that did and do hard work and permit us to use a very good IDE,
and for induction Thank all that people that permit open source, open edu, open mind and openess in general because permit all us live better
PS:
1. @codeur: Thank you for your email i reply later about C:B-EP
2. For the mods admins here: maybe is better insert a [resolved] in the object of the 1st post
My Best Regards
Harry G. K.
[attachment deleted by admin]
harrykar:
I saw around in the wild some people use winbgim.h instead of graphics.h ; seems that graphics.h were used with Borland's compiler/dev environment instead with other compilers/ dev environments people use winbgim.h. Personally i can say that graphics.h goes well with mingw/C:B or whatever IDE has mingw as backend.
Cause the limit of 2 files per post in the earlier post i preferred upload graphics.h so for the sake of completeness (for who has just some code using winbgim.h instead of graphics.h) here i upload the corrected winbgim.h
Cheers,
Harry
stahta01:
FYI: All files linked to a posts will be deleted at some future time.
This website admins deletes old attached files when the server space gets too low.
It is better to find a file hosting site and post links to the file on that site.
About winbgim.h.patch attachment.
Please learn to make file patches!!!
Wasting the bandwidth to download files that are NOT zipped is wasteful!!
Tim S.
harrykar:
--- Quote from: stahta01 on July 18, 2014, 08:55:57 pm ---FYI: All files linked to a posts will be deleted at some future time.
This website admins deletes old attached files when the server space gets too low.
--- End quote ---
Good to know thanks Tim
--- Quote ---It is better to find a file hosting site and post links to the file on that site.
--- End quote ---
Is just what i wrote above in a former post; upload here is only temporary; time to put files on github :)
--- Quote ---About winbgim.h.patch attachment.
Please learn to make file patches!!!
--- End quote ---
As i wrote above they aren't real patch files but a workaround to "elude" the dump upload system here
--- Quote ---Wasting the bandwidth to download files that are NOT zipped is wasteful!!
Tim S.
--- End quote ---
Don't got it, you're kidding me right ? :)
13.5KB wast bandwidth? and should be zipped? ???
LOL didn't did it not even when we were in paleolithic modems 35Kbps era; anyway next time i try to remember it
Cheers,
Harry G. K.
UjjwalBudha:
I tried Installing graphics.h and after that my C::B takes too long to start 5-7 mints please Help :-[
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version