dev-cpp-users Mailing List for Dev-C++ (Page 29)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: André M. B. <and...@su...> - 2008-04-30 15:03:19
|
But MigGW does this distinction. Please try: printf(sizeof(double)) and printf(sizeof(long double)) Does anybody know who wrote a printf or a full stdio.h (fprintf, sprintf, etc) which supports long doubles for MingGW? Regards André -----Mensagem original----- De: Per Westermark [mailto:pw...@ia...] Enviada em: terça-feira, 29 de abril de 2008 02:39 Para: André Macário Barros Cc: Lista do Dev-C++ Assunto: Re: [Dev-C++] Reading and printing long double values MinGW is using the M$ libraries, so to my knowledge it isn't possible to print a long double using printf(). Note that M$ does not distinguish between double and long double, so they don't have a need for a long double formatting prefix. /pwm On Sun, 27 Apr 2008, André Macário Barros wrote: > Dear users, > > I´m having some problems trying to read/print > a long double value in C. > > Based on a documentation I´ve found, one of the > attempts was: > > ... > long double var=3.0; > ... > printf("printing a long double value-->%5.0Lg\n", var); > ... > > I´ve already tested: %LE and %LF and none of these > options worked. > > Does anybody know how to read and print? > Thanks! > > Andre > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 > 09:39 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao ne > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.5/1401 - Release Date: 28/4/2008 07:18 No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.6/1407 - Release Date: 30/4/2008 11:35 |
From: ?? ? <do_...@pe...> - 2008-04-30 02:30:14
|
<html><body><style>A {color:#4383B3; font-family:arial} TD {font-family:arial}</style><table cellpadding=0 cellspacing=0 border=0 width=506 style='border:1px solid #cccccc' align=center><tr><td valign=top style ='background: url("http://www.perfspot.com/images/e/b/t.gif" ) repeat-x ' align = center ><img src= 'http://www.perfspot.com/images/spacer.gif' width=210 height=45><Br><A href = '' ><img border = 0 src = 'http://imgsrv5.perfspot.com/pics/profile/f/db/ih/profile_DC3C7FDD-F0B5-41D9 -879B-8167DC9BAEA2_tn.jpg' ></a></td><td valign=top ><img src= 'http://www.perfspot.com/images/e/b/i2.gif' width=294 height=143><Br><B style='color:#00B300; font-size: 15pt' >李石 何</B ></td></tr><tr><td valign=top style='padding:5px 15px 5px 15px; font-size:11pt; color:#666666;' colspan=2><Br><span style ='color:#E45C04'><B style='font-size:12pt'>Take a look at my new website.</B> The site is great for sharing pictures, videos, music and blogs. It is also a great way to meet new people and stay in touch with your friends.</span><Br><br><div align=center><A href = 'http://www.perfspot.com/j/10898612' >http://www.perfspot.com/j/10898612</a ><Br><Br></div>This site is 100% free but incredibly valuable. If you <A href = 'http://www.perfspot.com/j/10898612' >click this link</a> you will be taken to a join page that once completed will automatically make you my friend so we can easily stay in touch.<Br><Br></td></tr><tr bgcolor=#F6F6F6 colspan=2><td valign=top style='padding:10px;border-top:1px solid #BDD0E1;color:#666666;font-size:8pt' colspan=2>此份邮件显示李石 何 (sun...@gm...)已邀请您加入。 <Br> <Br> 如果您希望不再被PerfSpot.com联系,请点击此处。 <Br> <A href= 'http://www.perfspot.com/u.asp?e=Dev%2Dcpp%2Dusers%40lists%2Esourceforge%2En et' >http://www.perfspot.com/u.asp?e=Dev%2Dcpp%2Dusers%40lists%2Esourceforge%2En et</a> <Br> <Br> 如有问题或需要帮助,请联系我们的支持部门; <Br> <Br> 免费电话(美国):1-888-311-PERF (311-7373) <Br> 直拨(国际):(1)602-273-3758 <Br> 电子邮件:su...@Pe... <Br> <Br> PerfSpot.com | 4800 N. Scottsdale Rd Suite 4500 | Scottsdale, AZ 85251 | USA <Br> </td></tr></table></body><html> |
From: Per W. <pw...@ia...> - 2008-04-29 09:28:07
|
Remember that the stream can't do everything. It doesn't know what fields it is serializing, so it can't handle fields that are missing or having a changed definition between two versions of a class. The stream can handle endian differences, but do not know what it means for an object if it changes between 32 and 64 bits, or if it is safe to truncate the high 32 bits if loading a 64-bit value into a 32-bit field. But of course all requied helper functions should be implemented outside the serializable classes. /pwm On Tue, 29 Apr 2008, Derek Clarke wrote: > Although I'd put the fancy stuff in my own stream implementations > rather than the object serialise functions. > > That way you don't spread platform specific code around dozens of > classes, at the possible cost of a little robustness. > > On Tue, Apr 29, 2008 at 9:18 AM, Derek Clarke <de...@ci...> wrote: > > Absolutely. > > > > I just communicated the essence of the concept and left making it > > bombproof as an exercise for the reader :-) > > > > > > > > On Mon, Apr 28, 2008 at 5:31 PM, Per Westermark <pw...@ia...> wrote: > > > But remember that you may quite often want to make the serialize a lot > > > more advanced, with versioning information. > > > > > > Serialize is best when the same version of an application on the same > > > architecture will load a saved state. > > > > > > Life may quickly get complicated if moving between different > > > architectures. If you write a 32-bit int and the other program expects > > > an int to be 64 bits large, the serialize will fail. > > > > > > Another thing is when a new version have added more state information in > > > the class. It is quite probable that the end user expects a new version of > > > an application to be able to continue using the existing state > > > information. > > > > > > I often make the serialize methods use text format (together with a bit of > > > glue helper functions) to make the serialize a bit more forgiving. It is > > > also possible to use binary formats. It's just a question about how to > > > handle potential overflows, and to make sure that missing/invalid fields > > > gets reasonable defaults. > > > > > > /pwm > > > > > > > > > > > > On Mon, 28 Apr 2008, Derek Clarke wrote: > > > > > > > A good way is to add serialise operators to the class: > > > > > > > > ostream& hero::operator>>(ostream& stream) > > > > { > > > > mapid >> stream; > > > > posx >> stream; > > > > posy >> stream; > > > > return stream; > > > > } > > > > > > > > istream& hero::operator <<(istream& stream) > > > > { > > > > mapid << stream: > > > > posx << stream; > > > > posy << stream; > > > > return stream; > > > > } > > > > > > > > On Mon, Apr 28, 2008 at 6:40 AM, Samuel Hulley <tal...@gm...> wrote: > > > > > Hi, > > > > > I am attempting to load variables from files but im not sure what > > > > > todo because the variables are different types and sizes. > > > > > Here is the source: > > > > > > > > > > #pragma once > > > > > #include <fstream> > > > > > using namespace std; > > > > > > > > > > class hero > > > > > { > > > > > public: > > > > > void setname(string first, string last) > > > > > { > > > > > fname = first; > > > > > lname = last; > > > > > return; > > > > > } > > > > > > > > > > void setmap(int mp) > > > > > { > > > > > mapid = mp; > > > > > return; > > > > > } > > > > > > > > > > void setpos(int x, int y) > > > > > { > > > > > posx = x; > > > > > posy = y; > > > > > return; > > > > > } > > > > > > > > > > void setmapx(int x) > > > > > { > > > > > posx = x; > > > > > return; > > > > > } > > > > > > > > > > void setmapy(int y) > > > > > { > > > > > posy = y; > > > > > return; > > > > > } > > > > > > > > > > int getmap() > > > > > { > > > > > return mapid; > > > > > } > > > > > > > > > > int getmapx() > > > > > { > > > > > return posx; > > > > > } > > > > > > > > > > int getmapy() > > > > > { > > > > > return posy; > > > > > } > > > > > > > > > > void loadinfo() > > > > > { > > > > > // This is where I will load the config. > > > > > } > > > > > > > > > > private: > > > > > // Map variables. > > > > > int mapid; > > > > > int posx; > > > > > int posy; > > > > > }; > > > > > > > > > > Yours Truly > > > > > Samuel Hulley. > > > > > > > > > > ------------------------------------------------------------------------- > > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > > > Don't miss this year's exciting event. There's still time to save $100. > > > > > Use priority code J8TL2D2. > > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > > _______________________________________________ > > > > > Dev-cpp-users mailing list > > > > > Dev...@li... > > > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > > Don't miss this year's exciting event. There's still time to save $100. > > > > Use priority code J8TL2D2. > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > > |
From: Derek C. <de...@ci...> - 2008-04-29 08:24:38
|
Although I'd put the fancy stuff in my own stream implementations rather than the object serialise functions. That way you don't spread platform specific code around dozens of classes, at the possible cost of a little robustness. On Tue, Apr 29, 2008 at 9:18 AM, Derek Clarke <de...@ci...> wrote: > Absolutely. > > I just communicated the essence of the concept and left making it > bombproof as an exercise for the reader :-) > > > > On Mon, Apr 28, 2008 at 5:31 PM, Per Westermark <pw...@ia...> wrote: > > But remember that you may quite often want to make the serialize a lot > > more advanced, with versioning information. > > > > Serialize is best when the same version of an application on the same > > architecture will load a saved state. > > > > Life may quickly get complicated if moving between different > > architectures. If you write a 32-bit int and the other program expects > > an int to be 64 bits large, the serialize will fail. > > > > Another thing is when a new version have added more state information in > > the class. It is quite probable that the end user expects a new version of > > an application to be able to continue using the existing state > > information. > > > > I often make the serialize methods use text format (together with a bit of > > glue helper functions) to make the serialize a bit more forgiving. It is > > also possible to use binary formats. It's just a question about how to > > handle potential overflows, and to make sure that missing/invalid fields > > gets reasonable defaults. > > > > /pwm > > > > > > > > On Mon, 28 Apr 2008, Derek Clarke wrote: > > > > > A good way is to add serialise operators to the class: > > > > > > ostream& hero::operator>>(ostream& stream) > > > { > > > mapid >> stream; > > > posx >> stream; > > > posy >> stream; > > > return stream; > > > } > > > > > > istream& hero::operator <<(istream& stream) > > > { > > > mapid << stream: > > > posx << stream; > > > posy << stream; > > > return stream; > > > } > > > > > > On Mon, Apr 28, 2008 at 6:40 AM, Samuel Hulley <tal...@gm...> wrote: > > > > Hi, > > > > I am attempting to load variables from files but im not sure what > > > > todo because the variables are different types and sizes. > > > > Here is the source: > > > > > > > > #pragma once > > > > #include <fstream> > > > > using namespace std; > > > > > > > > class hero > > > > { > > > > public: > > > > void setname(string first, string last) > > > > { > > > > fname = first; > > > > lname = last; > > > > return; > > > > } > > > > > > > > void setmap(int mp) > > > > { > > > > mapid = mp; > > > > return; > > > > } > > > > > > > > void setpos(int x, int y) > > > > { > > > > posx = x; > > > > posy = y; > > > > return; > > > > } > > > > > > > > void setmapx(int x) > > > > { > > > > posx = x; > > > > return; > > > > } > > > > > > > > void setmapy(int y) > > > > { > > > > posy = y; > > > > return; > > > > } > > > > > > > > int getmap() > > > > { > > > > return mapid; > > > > } > > > > > > > > int getmapx() > > > > { > > > > return posx; > > > > } > > > > > > > > int getmapy() > > > > { > > > > return posy; > > > > } > > > > > > > > void loadinfo() > > > > { > > > > // This is where I will load the config. > > > > } > > > > > > > > private: > > > > // Map variables. > > > > int mapid; > > > > int posx; > > > > int posy; > > > > }; > > > > > > > > Yours Truly > > > > Samuel Hulley. > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > > Don't miss this year's exciting event. There's still time to save $100. > > > > Use priority code J8TL2D2. > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > Don't miss this year's exciting event. There's still time to save $100. > > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > |
From: Derek C. <de...@ci...> - 2008-04-29 08:18:13
|
Absolutely. I just communicated the essence of the concept and left making it bombproof as an exercise for the reader :-) On Mon, Apr 28, 2008 at 5:31 PM, Per Westermark <pw...@ia...> wrote: > But remember that you may quite often want to make the serialize a lot > more advanced, with versioning information. > > Serialize is best when the same version of an application on the same > architecture will load a saved state. > > Life may quickly get complicated if moving between different > architectures. If you write a 32-bit int and the other program expects > an int to be 64 bits large, the serialize will fail. > > Another thing is when a new version have added more state information in > the class. It is quite probable that the end user expects a new version of > an application to be able to continue using the existing state > information. > > I often make the serialize methods use text format (together with a bit of > glue helper functions) to make the serialize a bit more forgiving. It is > also possible to use binary formats. It's just a question about how to > handle potential overflows, and to make sure that missing/invalid fields > gets reasonable defaults. > > /pwm > > > > On Mon, 28 Apr 2008, Derek Clarke wrote: > > > A good way is to add serialise operators to the class: > > > > ostream& hero::operator>>(ostream& stream) > > { > > mapid >> stream; > > posx >> stream; > > posy >> stream; > > return stream; > > } > > > > istream& hero::operator <<(istream& stream) > > { > > mapid << stream: > > posx << stream; > > posy << stream; > > return stream; > > } > > > > On Mon, Apr 28, 2008 at 6:40 AM, Samuel Hulley <tal...@gm...> wrote: > > > Hi, > > > I am attempting to load variables from files but im not sure what > > > todo because the variables are different types and sizes. > > > Here is the source: > > > > > > #pragma once > > > #include <fstream> > > > using namespace std; > > > > > > class hero > > > { > > > public: > > > void setname(string first, string last) > > > { > > > fname = first; > > > lname = last; > > > return; > > > } > > > > > > void setmap(int mp) > > > { > > > mapid = mp; > > > return; > > > } > > > > > > void setpos(int x, int y) > > > { > > > posx = x; > > > posy = y; > > > return; > > > } > > > > > > void setmapx(int x) > > > { > > > posx = x; > > > return; > > > } > > > > > > void setmapy(int y) > > > { > > > posy = y; > > > return; > > > } > > > > > > int getmap() > > > { > > > return mapid; > > > } > > > > > > int getmapx() > > > { > > > return posx; > > > } > > > > > > int getmapy() > > > { > > > return posy; > > > } > > > > > > void loadinfo() > > > { > > > // This is where I will load the config. > > > } > > > > > > private: > > > // Map variables. > > > int mapid; > > > int posx; > > > int posy; > > > }; > > > > > > Yours Truly > > > Samuel Hulley. > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > > Don't miss this year's exciting event. There's still time to save $100. > > > Use priority code J8TL2D2. > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > |
From: Jan M. <jan...@vo...> - 2008-04-29 08:03:43
|
Hello, I would like to ask how to add to a project some .rc file. But just using makefile and gcc and make. Not using the IDE of Dev-C++ or any other tool. So if I have some main.c and menu.rc how can I make an executable file. Thank you a lot. Jan Mura jan...@vo... |
From: Per W. <pw...@ia...> - 2008-04-29 05:39:31
|
MinGW is using the M$ libraries, so to my knowledge it isn't possible to print a long double using printf(). Note that M$ does not distinguish between double and long double, so they don't have a need for a long double formatting prefix. /pwm On Sun, 27 Apr 2008, André Macário Barros wrote: > Dear users, > > I´m having some problems trying to read/print > a long double value in C. > > Based on a documentation I´ve found, one of the > attempts was: > > ... > long double var=3.0; > ... > printf("printing a long double value-->%5.0Lg\n", var); > ... > > I´ve already tested: %LE and %LF and none of these > options worked. > > Does anybody know how to read and print? > Thanks! > > Andre > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 > 09:39 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Per W. <pw...@ia...> - 2008-04-28 16:31:42
|
But remember that you may quite often want to make the serialize a lot more advanced, with versioning information. Serialize is best when the same version of an application on the same architecture will load a saved state. Life may quickly get complicated if moving between different architectures. If you write a 32-bit int and the other program expects an int to be 64 bits large, the serialize will fail. Another thing is when a new version have added more state information in the class. It is quite probable that the end user expects a new version of an application to be able to continue using the existing state information. I often make the serialize methods use text format (together with a bit of glue helper functions) to make the serialize a bit more forgiving. It is also possible to use binary formats. It's just a question about how to handle potential overflows, and to make sure that missing/invalid fields gets reasonable defaults. /pwm On Mon, 28 Apr 2008, Derek Clarke wrote: > A good way is to add serialise operators to the class: > > ostream& hero::operator>>(ostream& stream) > { > mapid >> stream; > posx >> stream; > posy >> stream; > return stream; > } > > istream& hero::operator <<(istream& stream) > { > mapid << stream: > posx << stream; > posy << stream; > return stream; > } > > On Mon, Apr 28, 2008 at 6:40 AM, Samuel Hulley <tal...@gm...> wrote: > > Hi, > > I am attempting to load variables from files but im not sure what > > todo because the variables are different types and sizes. > > Here is the source: > > > > #pragma once > > #include <fstream> > > using namespace std; > > > > class hero > > { > > public: > > void setname(string first, string last) > > { > > fname = first; > > lname = last; > > return; > > } > > > > void setmap(int mp) > > { > > mapid = mp; > > return; > > } > > > > void setpos(int x, int y) > > { > > posx = x; > > posy = y; > > return; > > } > > > > void setmapx(int x) > > { > > posx = x; > > return; > > } > > > > void setmapy(int y) > > { > > posy = y; > > return; > > } > > > > int getmap() > > { > > return mapid; > > } > > > > int getmapx() > > { > > return posx; > > } > > > > int getmapy() > > { > > return posy; > > } > > > > void loadinfo() > > { > > // This is where I will load the config. > > } > > > > private: > > // Map variables. > > int mapid; > > int posx; > > int posy; > > }; > > > > Yours Truly > > Samuel Hulley. > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Derek C. <de...@ci...> - 2008-04-28 10:08:30
|
A good way is to add serialise operators to the class: ostream& hero::operator>>(ostream& stream) { mapid >> stream; posx >> stream; posy >> stream; return stream; } istream& hero::operator <<(istream& stream) { mapid << stream: posx << stream; posy << stream; return stream; } On Mon, Apr 28, 2008 at 6:40 AM, Samuel Hulley <tal...@gm...> wrote: > Hi, > I am attempting to load variables from files but im not sure what > todo because the variables are different types and sizes. > Here is the source: > > #pragma once > #include <fstream> > using namespace std; > > class hero > { > public: > void setname(string first, string last) > { > fname = first; > lname = last; > return; > } > > void setmap(int mp) > { > mapid = mp; > return; > } > > void setpos(int x, int y) > { > posx = x; > posy = y; > return; > } > > void setmapx(int x) > { > posx = x; > return; > } > > void setmapy(int y) > { > posy = y; > return; > } > > int getmap() > { > return mapid; > } > > int getmapx() > { > return posx; > } > > int getmapy() > { > return posy; > } > > void loadinfo() > { > // This is where I will load the config. > } > > private: > // Map variables. > int mapid; > int posx; > int posy; > }; > > Yours Truly > Samuel Hulley. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Per W. <pw...@ia...> - 2008-04-28 08:58:04
|
Decide if you want to use a binary file, or an ASCII file. If you go for text, you can encode: name="hello" map=2 pos=<1,2> ... and then char buf[1000]; char *p,*name; while (fgets(buf,sizeof(buf),f)) { p = strip_white(buf); if (p == '\n') continue; name = get_name(&p); if (name) { p = strip_white(p); if (p != '=') { complain(); return -1; } p = strip_white(++p); if (!strcmp(name,"name")) { if (!get_string(p,my_string,sizeof(my_string))) return -1; } else if (!strcmp(name,"map")) { if (!get_integer(p,0,10)) return -1; } else if (!strcmp(name,"pos")) { if (!get_position(p,&pos)) return -1; } else { complain(); return -1; } } } xx.setname(name); xx.setpos(pos); ... /pwm On Mon, 28 Apr 2008, Samuel Hulley wrote: > Hi, > I am attempting to load variables from files but im not sure what > todo because the variables are different types and sizes. > Here is the source: > > #pragma once > #include <fstream> > using namespace std; > > class hero > { > public: > void setname(string first, string last) > { > fname = first; > lname = last; > return; > } > > void setmap(int mp) > { > mapid = mp; > return; > } > > void setpos(int x, int y) > { > posx = x; > posy = y; > return; > } > > void setmapx(int x) > { > posx = x; > return; > } > > void setmapy(int y) > { > posy = y; > return; > } > > int getmap() > { > return mapid; > } > > int getmapx() > { > return posx; > } > > int getmapy() > { > return posy; > } > > void loadinfo() > { > // This is where I will load the config. > } > > private: > // Map variables. > int mapid; > int posx; > int posy; > }; > > Yours Truly > Samuel Hulley. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Samuel H. <tal...@gm...> - 2008-04-28 05:40:22
|
Hi, I am attempting to load variables from files but im not sure what todo because the variables are different types and sizes. Here is the source: #pragma once #include <fstream> using namespace std; class hero { public: void setname(string first, string last) { fname = first; lname = last; return; } void setmap(int mp) { mapid = mp; return; } void setpos(int x, int y) { posx = x; posy = y; return; } void setmapx(int x) { posx = x; return; } void setmapy(int y) { posy = y; return; } int getmap() { return mapid; } int getmapx() { return posx; } int getmapy() { return posy; } void loadinfo() { // This is where I will load the config. } private: // Map variables. int mapid; int posx; int posy; }; Yours Truly Samuel Hulley. |
From: André M. B. <and...@su...> - 2008-04-27 21:57:07
|
Hi, Checking a little bit more, I found message #3 in which Ioannis Vranos said: http://www.velocityreviews.com/forums/t289111-printf-and-long-double.html Writing the same code in Borland, it worked fine! Thanks anyway! Andre -----Mensagem original----- De: Iván Sánchez Luque [mailto:iva...@gm...] Enviada em: domingo, 27 de abril de 2008 18:02 Para: André Macário Barros Cc: Lista do Dev-C++ Assunto: Re: [Dev-C++] Reading and printing long double values http://www.cplusplus.com/reference/clibrary/cstdio/printf.html André Macário Barros wrote: > Dear users, > > I´m having some problems trying to read/print > a long double value in C. > > Based on a documentation I´ve found, one of the > attempts was: > > ... > long double var=3.0; > ... > printf("printing a long double value-->%5.0Lg\n", var); > ... > > I´ve already tested: %LE and %LF and none of these > options worked. > > Does anybody know how to read and print? > Thanks! > > Andre > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 > 09:39 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao ne > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 09:39 No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 09:39 |
From: Iván S. L. <iva...@gm...> - 2008-04-27 21:02:21
|
http://www.cplusplus.com/reference/clibrary/cstdio/printf.html André Macário Barros wrote: > Dear users, > > I´m having some problems trying to read/print > a long double value in C. > > Based on a documentation I´ve found, one of the > attempts was: > > ... > long double var=3.0; > ... > printf("printing a long double value-->%5.0Lg\n", var); > ... > > I´ve already tested: %LE and %LF and none of these > options worked. > > Does anybody know how to read and print? > Thanks! > > Andre > > No virus found in this outgoing message. > Checked by AVG. > Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 > 09:39 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
From: André M. B. <and...@su...> - 2008-04-27 19:22:52
|
Dear users, I´m having some problems trying to read/print a long double value in C. Based on a documentation I´ve found, one of the attempts was: ... long double var=3.0; ... printf("printing a long double value-->%5.0Lg\n", var); ... I´ve already tested: %LE and %LF and none of these options worked. Does anybody know how to read and print? Thanks! Andre No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.5/1400 - Release Date: 27/4/2008 09:39 |
From: Reid T. <rei...@at...> - 2008-04-23 22:59:03
|
Kleber Eduardo Clemente wrote: > Hi Guys, > > > > Such as I Said before, i’m beggening in C++. > > Questions: - Don’t we have a variable format “Date”? > > - How can I get the date *today*? Is there a function > for this? > > Tks! > search for time on this page http://www.linuxmanpages.com/man3/ and read each link that the search finds |
From: matheus r. <mfr...@gm...> - 2008-04-23 21:06:15
|
there are also other functions, like ctime, time etc... 2008/4/23 matheus ribeiro <mfr...@gm...>: > try gettimeofday. And be prepared to read a bit. C++ is not a walk at the > park ;) > > 2008/4/23 Kleber Eduardo Clemente <kle...@da...>: > > > Hi Guys, > > > > > > > > Such as I Said before, i'm beggening in C++. > > > > Questions: - Don't we have a variable format "Date"? > > > > - How can I get the date *today*? Is there a function > > for this? > > > > Tks! > > > > > > > > []'s > > > > > > > > *Kleber Eduardo Clemente* > > Posto Avançado MRS - Datasul HCM > > Fone: (47) 3802-8848 > > Mail: kle...@da... > > Antes de imprimir este e-mail, pergunte-se: "É realmente necessário?" > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > > Don't miss this year's exciting event. There's still time to save $100. > > Use priority code J8TL2D2. > > > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > |
From: matheus r. <mfr...@gm...> - 2008-04-23 21:04:18
|
try gettimeofday. And be prepared to read a bit. C++ is not a walk at the park ;) 2008/4/23 Kleber Eduardo Clemente <kle...@da...>: > Hi Guys, > > > > Such as I Said before, i'm beggening in C++. > > Questions: - Don't we have a variable format "Date"? > > - How can I get the date *today*? Is there a function for > this? > > Tks! > > > > []'s > > > > *Kleber Eduardo Clemente* > Posto Avançado MRS - Datasul HCM > Fone: (47) 3802-8848 > Mail: kle...@da... > Antes de imprimir este e-mail, pergunte-se: "É realmente necessário?" > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
From: Kleber E. C. <kle...@da...> - 2008-04-23 20:39:37
|
Hi Guys, Such as I Said before, i'm beggening in C++. Questions: - Don't we have a variable format "Date"? - How can I get the date today? Is there a function for this? Tks! []'s Kleber Eduardo Clemente Posto Avançado MRS - Datasul HCM Fone: (47) 3802-8848 Mail: kle...@da... <mailto:kle...@da...> Antes de imprimir este e-mail, pergunte-se: "É realmente necessário?" |
From: Kleber E. C. <kle...@da...> - 2008-04-23 14:00:51
|
Hello People, I'm Kleber Clemente, i'm from Brazil and I'm 20 years old. I'm coursing Engineering of the Computation (first semester) and now, I'm learning C++. Hugs! Att., Kleber Eduardo Clemente Posto Avançado MRS - Datasul HCM Fone: (47) 3802-8848 Mail: kle...@da... <mailto:kle...@da...> Antes de imprimir este e-mail, pergunte-se: "É realmente necessário?" |
From: Per W. <pw...@ia...> - 2008-04-19 12:15:55
|
We can't affect the help file, since the project is stopped. All someone can do is write a web page and regularly post a link to. /pwm On Fri, 18 Apr 2008, Eric wrote: > (1) Sorry I was a bit naughty not finishing it off > (2) how can we write this in to the DevC++ help files "setprecision" does > not come up at all in version 4.9.9.2 > (3) how can we do anything to make the help file better, so we dont have > bang our heads &/or rip our hair out > > (3) spell chequeer does not work after converting HTML mail to plain text > version, (and Microsoft want to rule the computer O.S world, goodness me > where are we going?) > > >From Eric > > ----- Original Message ----- > From: Geo...@ao... > To: dev...@li... > Sent: Friday, 18 April, 2008 2:54 AM > Subject: Re: [Dev-C++] Dev-cpp-users Digest, Vol 23, Issue 8 > > > Try this > > #include <iostream> > #include <iomanip> > > float x=1; > > > int main(int argc, char *argv[]) > { > std::cout << std::setprecision(1) << "1/3 =" << x/3 << "\n"; > printf("1/3 = %.9f \n", x/3); > system("PAUSE"); > return EXIT_SUCCESS; > } > > >From GeorgeAPerry > > > > > > > > Need a new ride? Check out the largest site for U.S. used car listings at > AOL Autos. > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao > ne > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.519 / Virus Database: 269.23.0/1382 - Release Date: 16-Apr-08 > 5:34 PM > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Eric <eri...@wo...> - 2008-04-17 18:50:54
|
(1) Sorry I was a bit naughty not finishing it off (2) how can we write this in to the DevC++ help files "setprecision" does not come up at all in version 4.9.9.2 (3) how can we do anything to make the help file better, so we dont have bang our heads &/or rip our hair out (3) spell chequeer does not work after converting HTML mail to plain text version, (and Microsoft want to rule the computer O.S world, goodness me where are we going?) >From Eric ----- Original Message ----- From: Geo...@ao... To: dev...@li... Sent: Friday, 18 April, 2008 2:54 AM Subject: Re: [Dev-C++] Dev-cpp-users Digest, Vol 23, Issue 8 Try this #include <iostream> #include <iomanip> float x=1; int main(int argc, char *argv[]) { std::cout << std::setprecision(1) << "1/3 =" << x/3 << "\n"; printf("1/3 = %.9f \n", x/3); system("PAUSE"); return EXIT_SUCCESS; } >From GeorgeAPerry Need a new ride? Check out the largest site for U.S. used car listings at AOL Autos. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao ne _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.23.0/1382 - Release Date: 16-Apr-08 5:34 PM |
From: <Geo...@ao...> - 2008-04-17 14:55:30
|
Try this #include <iostream> #include <iomanip> float x=1; int main(int argc, char *argv[]) { std::cout << std::setprecision(1) << "1/3 =" << x/3 << "\n"; printf("1/3 = %.9f \n", x/3); system("PAUSE"); return EXIT_SUCCESS; } >From GeorgeAPerry **************Need a new ride? Check out the largest site for U.S. used car listings at AOL Autos. (http://autos.aol.com/used?NCID=aolcmp00300000002851) |
From: 何. <sun...@gm...> - 2008-04-14 03:16:33
|
Hi everybody, I hava write a half of a Link list, but when i test some function of it, I find some problems that i don't know why, can anybody show me why will be the result like this? Here is the program in c++, thank you very much! > #include <iostream> > using namespace std; > > #define TRUE 1 > #define FALSE 0 > #define OK 1 > #define ERROR 0 > #define INFEASIBLE -1 > #define OVERFLOW -2 > > #define LIST_INIT_SIZE 100 > #define LISTINCREMENT 10 > > typedef int ElemType; > typedef int Status; > > typedef struct{ > ElemType *Elem; > int length; > int listsize; > }SqList; > > Status InitList_Sq(SqList &L){ > //构造一个空的线性表L; > L.Elem = (ElemType *)malloc(LIST_INIT_SIZE*sizeof(ElemType)); > if(!L.Elem) exit(OVERFLOW); > L.length = 0; > L.listsize = LIST_INIT_SIZE; > return OK; > }//InitList_Sq > > Status ListInsert_Sq(SqList &L, int i, ElemType e){ > //在顺序线性表L中第i个位置之前插入新的元素e, > //Insert element e into the List L in position i > //i的合法值为 1 <= i <= ListLength_Sq(L)+1 > int * q, * p; > ElemType * newbase; > if(i < 1 || i > L.length+1) return ERROR; > if(L.length >= L.listsize){ > newbase = (ElemType *)realloc(L.Elem, (L.listsize + > LISTINCREMENT)*sizeof(ElemType)); > if(!newbase) exit(OVERFLOW); > L.Elem = newbase; > L.listsize += LISTINCREMENT; > } > q = &(L.Elem[i-1]); > for(p = &(L.Elem[L.length - 1]); p >= q; --p) *(p+1) = *p; > *q = e; > ++L.length; > return OK; > } > > Status ListDelete_Sq(SqList &L, int i, ElemType &e){ > //删除链表中的第i个元素, 用e返回其值 > //Delete from List L in position i, return its value with e > if(i < 1 || i >L.listsize) return ERROR; > int * p = &(L.Elem[i-1]); > e = *p; > ElemType *q = L.Elem + L.length - 1; > for(++p; p <= q; ++p) *(p-1) = *p; > --L.length; > return OK; > } > > Status ListShow(SqList &L){ > //显示顺序链表L的每个元素 > //Show the element of List L > int *p = &(L.Elem[L.length - 1]), *q = &(L.Elem[0]); > printf("The Element of List is:\n"); > for( ; q <= p; ++q) > printf("%d ", L.Elem[*(q)-1]); > printf("\n\n"); > return OK; > } > > int main() > { > SqList L1; > InitList_Sq(L1); > SqList L2; > InitList_Sq(L2); > int i, j; > for(i = 1; i <= 10; ++i) > ListInsert_Sq(L1, i, i); > for(j=1; j <= 5; ++j){ > i = 6; > ElemType e; > ListDelete_Sq(L1, i, e); > ListInsert_Sq(L2, j, e); > } > ListShow(L1); > ListShow(L2); > return 0; > } > I will be waiting here for you help, thank you! |
From: Per W. <pw...@ia...> - 2008-04-10 08:58:20
|
MinGW (the compiler you are using) do support *.a files just as well as any other gcc version. It also supports Win32 *.lib files. What language are you using? C or C++? If you use C, the linker will look for a synbol _hypotenuse in the *.a file. If you use C++, the compiler will name-mangle the symbol, to encode the data types and in some cases the compilation switches. This is a common reason why a C++ program fails to link with a C library (unless the header file says extern "C" symbol) or why a C++ program fails to link with a C++ library compiled with too different compiler settings or with a different version of the C++ compiler. A quickie to look for this problem is to run the command "strings" (not in Win32, so you have to download a copy) on your object file in your project, and on the *.a file and check if the hypotenuse reference looks identical. /pwm On Thu, 10 Apr 2008, Samuel Hulley wrote: > Hi, > For so long I have been using a different compiler, but now I am using > Dev-C++, In my old compiler I was able to create a header file and place > something like this in it: > > > double hypotenuse(double sidea,double sideb); > > Then include it into my app, set the .a file and use it, but now I get > an error message saying: > > > [Linker error] undefined reference to `hypotenuse(double, double)' > > Any ideas? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Samuel H. <tal...@gm...> - 2008-04-10 07:56:43
|
Hi, For so long I have been using a different compiler, but now I am using Dev-C++, In my old compiler I was able to create a header file and place something like this in it: > double hypotenuse(double sidea,double sideb); Then include it into my app, set the .a file and use it, but now I get an error message saying: > [Linker error] undefined reference to `hypotenuse(double, double)' Any ideas? |