dev-cpp-users Mailing List for Dev-C++ (Page 348)
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: vinay k <vin...@ya...> - 2003-07-16 04:04:17
|
Dear experts, I am a new user to Dev-C++ software. How can I profile my code? If i set that option in project options, it gives an error saying that mcount undefined in function x Can u suggest a solution to this? thanking you, vinay.k __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
|
From: David W <dav...@ms...> - 2003-07-15 21:17:04
|
How do I get DevKitAdv (GameBoy Advance GCC version) to work under Dev-C++? It should be something this: compille main.o and main.elf (don't know how to do that) ld -o main.elf main.o gcc -o main.elf main.cpp -lm objcopy -O binary main.elf main.bin Anybody that know howto achive this? Please don't tell me to use bat files, it ruins the whole purpose with Dev-C++(for me anyway). _________________________________________________________________ Hitta rätt köpare på MSN Köp & Sälj http://www.msn.se/koposalj |
|
From: Ioannis V. <iv...@em...> - 2003-07-15 20:20:56
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Hossein Haeri > Sent: Tuesday, July 15, 2003 10:23 PM > To: dev...@li... > Subject: Re: [Dev-C++] overloading delete > > > Daniel, > > > I found another > > > > (from memory) it was: > > void* operator delete(_segment Seg, void* _based(void*) > BasePtr, void* > > Memory) > > > > the variable names are my own, but I think the types are > right. This is for > > segments. > > > > I really do not remeber if that's mentioned in the Standard, nor am I > in the mood of finding such a fine in it (needle in a haystack). The above are not standard compliant. The basic headers one can define void *operator new(size_t); void operator delete(void *); void *operator new[](size_t); void operator delete[](void *); The way how to do that is enough stuff in TC++PL, 10.4.11, 15.6, 19.4.5. But they are standard compliant. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Hossein H. <ult...@em...> - 2003-07-15 19:25:11
|
Daniel,
> I found another
>
> (from memory) it was:
> void* operator delete(_segment Seg, void* _based(void*) BasePtr, void*
> Memory)
>
> the variable names are my own, but I think the types are right. This is for
> segments.
>
I really do not remeber if that's mentioned in the Standard, nor am I
in the mood of finding such a fine in it (needle in a haystack).
> My problem needed a call to _ffree, but you cannot access the C runtime
> library from another segment except the DEFAULT segment. So from your
> segment you call your operator delete which calls your stub function (a
> function in the DEFAULT segment) that then calls _ffree.
>
> #include "SomeHeader.h" // Default seg header with MyDelete()
>
> #pragma codeseg("MYSEG_SEG") // something like this
>
> void operator delete (params here)
> {
> MyDelete(params); // Calls MyDelete which calls _ffree()
> }
>
> void SomeFunc()
> {
> // Create obj
> delete obj;
> }
I'm not sure if this is Standard-compliant. It more seems to me to be
Implementation-Specific, isn't it? I rememeber reading interesting
points in Help documentations of BCB6. Maybe not a bad idea to try the
Help documentation of your own implementation.
I will return on it as I got in the mood. I will check BCB6 for you,
and if I had enough time, I will look it up in Standard as well!
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|
|
From: Hossein H. <ult...@em...> - 2003-07-15 19:10:20
|
Dear Per, > The void* parameter of delete is only guaranteed in linear addressing > mode. For 16-bit segmented code, delete might take a couple of other > parameter types, depending on memory model used. > > It might take void __near* and void __far *. > > The void __far * is for 16-bit Intel composed of a 16:16 bit pointer, > where the first 16 bit are the segment, and the next 16 bit are offset. > > However, a 16:16 pointer is still treated as a single parameter in the > code, i.e. you still write "delete myobj;", where myobj contains a pointer > returned by new. > > It is just code performing advanced pointer manipulation that needs to > know that the pointer is segmented. For memory areas < 64kB this isn't > a problem since the offset part spans 64kB. Arrays and memory blocks > larger than 64kB do require special treatment, such as conversion to void > __huge * to make sure that the offset part is always normalized 0..15 and > the segment is constantly adjusted too. You'r absolutely right! Thanks for reminding. Wishes, --Hossein -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup CareerBuilder.com has over 400,000 jobs. Be smarter about your job search http://corp.mail.com/careers |
|
From: Abhijit S. <mu...@gm...> - 2003-07-15 19:05:11
|
> In 16 bit your code is separated into 'segments' each a maximum of 64k in > size. 32-bit can have up to 2GB segments (!!!). 4G, right? (2^32). However, that's true only on a 32-bit system (as you've said)... what platform are you building on? On 16-bit (`real-mode') DOS, even though sizeof(farptr) will give you four, it cannot address 32-bits worth of memory. Far pointers work like this: 32 bits of farptr = 16 bits of segment . 16 bits of offset The effective address is actually calculated by multiplying the segment by 16 decimal (0x10 (which is equivalent to left-shifting by four)) and then ADDING the offset... so that if your far-ptr has this value: 0x1234abcd Written as: 1234:abcd Its effective address, which is worth 20-bits (and can therefore address 2^20 = 1M) is calculated as: 0x12340 + 0xabcd ------------- = 0x1cf0d Whereas, in the flat memory model(protected-mode), the effective address would itself be 0x1234abcd -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Daniel G. <sp...@ho...> - 2003-07-15 19:00:06
|
Thanks. I'm trying to use the large memory model at the moment but it hasn't gotten rid of the need for FAR. Maybe I've done something wrong somewhere, I need to check. Windows 9x has 16 bit code in it in places, such as Printer Drivers and other bits. >From: "Abhijit Shylanath" <mu...@gm...> >To: "Ioannis Vranos" ><iv...@em...>,<dev...@li...>,<sp...@ho...> >Subject: RE: [Dev-C++] new is a wrapper around malloc so... >Date: Wed, 16 Jul 2003 00:07:20 +0530 > > >Hello, Ioannis and Daniel. > > > I do not know what a Far pointer, but I do know that they exist. Can you > > tell us what does it mean? > >Well, you must know that we have four basic segments (on the 8086) - the >CS, >DS, SS and ES... by default, when a data pointer is defined, it is assumed >that the pointer resides in the data segment, and when a function pointer >is >defined, that it resides in the code segment. However, when a pointer is >flagged as `far', it means that the segment is also stored explicitly along >with the offset. So, basically, far pointers allow you to access the whole >(and overwhelmingly huge) 1M of the 8086. Basically, far means residing in >a >different segment, while near means residing in the same (the default) >segment. > >Daniel, in response to your original question: > >Assuming you code in Turbo-C++, you have three options: > >1. Use a memory-model in which the required pointer's type is far by >default. If you need far data (the most common), use compact (in which the >data pointers are still near). If you need far code, use (umm, not sure, >really) large or huge (check the docs). You'll need to say something like >this: > char *foo = (char *)malloc(WHATEVER); > >2. Use the farmalloc() function (in TC - in M$C, I've heard that it's named >halloc()). Corresponding frees should be done by farfree() (dunno about >M$C). > > char far *foo = (char far *)farmalloc(WHATEVER); > // ... > farfree(foo); > >3. The easiest - simply call `new'. AFAIK, you don't need to overload new: > > char far *big_one = new char far[200]; > // ^? > // Play around a bit with the syntax, I'm not sure that this works... > > I remember doing something like this sometime back. > >However, why do you need to use different segments at all? You should try >porting it to 32-bit protected-mode DOS (or even Windows console-mode), if >your application allows it. Sad as it is for me to say it, DOS is dead. >Anyway, here are a few links you might find interesting: > >* http://www.delorie.com/djgpp > DJGPP - A DOS protected-mode C/++ compiler based on GCC > >* http://sunsite.lanet.lv/ftp/mirror/x2ftp/msdos/programming/ > The X2FTP - hordes of information on related topics. > >HTH. > >-- >Abhijit Shylanath >Homepage: http://mudeth.tripod.com/ > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps1 >_______________________________________________ >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 _________________________________________________________________ Sign-up for a FREE BT Broadband connection today! http://www.msn.co.uk/specials/btbroadband |
|
From: Daniel G. <sp...@ho...> - 2003-07-15 18:57:35
|
I found another
(from memory) it was:
void* operator delete(_segment Seg, void* _based(void*) BasePtr, void*
Memory)
the variable names are my own, but I think the types are right. This is for
segments.
My problem needed a call to _ffree, but you cannot access the C runtime
library from another segment except the DEFAULT segment. So from your
segment you call your operator delete which calls your stub function (a
function in the DEFAULT segment) that then calls _ffree.
#include "SomeHeader.h" // Default seg header with MyDelete()
#pragma codeseg("MYSEG_SEG") // something like this
void operator delete (params here)
{
MyDelete(params); // Calls MyDelete which calls _ffree()
}
void SomeFunc()
{
// Create obj
delete obj;
}
>From: "Hossein Haeri" <ult...@em...>
>To: dev...@li...
>Subject: Re: [Dev-C++] overloading delete
>Date: Tue, 15 Jul 2003 13:15:09 -0500
>
>Dear Daniel,
>
> > What parameters does delete take? I'm being told by the compiler the
>first
> > is __segment and the second is a __based(void)* ?????
> > Is this right?
>
>If you only want the arguments, the following (the full signature) will
>convince you:
>
>void* operator delete(void*) throw();
>void* operator delete [] (void*) throw();
>
>I cite them directly from the Standard draft. But if you need more
>information take a look to Section 3.7.3.2 (Deallocation functions) in
>Standard. I don't have Accrobat Distiller. If I had I would send you
>the wholl chapter as a pdf file.
>
>You will also find good stuff in TC++PL:Spec. E.g., consider Section
>6.2.6.2, Section 15.6.1, and (the best at) Section 19.4.5.
>
>Regards,
>--Hossein
>
>
>--
>__________________________________________________________
>Sign-up for your own FREE Personalized E-mail at Mail.com
>http://www.mail.com/?sr=signup
>
>CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
>http://corp.mail.com/careers
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Parasoft
>Error proof Web apps, automate testing & more.
>Download & eval WebKing and get a free book.
>www.parasoft.com/bulletproofapps1
>_______________________________________________
>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
_________________________________________________________________
Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile
|
|
From: Daniel G. <sp...@ho...> - 2003-07-15 18:48:50
|
In 16 bit your code is separated into 'segments' each a maximum of 64k in size. 32-bit can have up to 2GB segments (!!!). A 'near' pointer can access variables etc. within its own segment, while FAR pointers can access anything. Likewise a FAR variable can be accessed from anywhere (by a FAR pointer), while a NEAR one (the default) is local to that segment. Think of it like a telephone numbering system. My number is, say, 401234. But that is no good to you unless you live local to me. If you tried typing 401234 into the phone you'd not reach me if you lived far away. SO if I gave you my "FAR" number, it would be 01172 401234 and you would be able to reach me even if you were not local. This is how I understand NEAR and FAR. >From: "Ioannis Vranos" <iv...@em...> >To: <dev...@li...> >Subject: RE: [Dev-C++] new is a wrapper around malloc so... >Date: Tue, 15 Jul 2003 20:25:46 +0300 > > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Daniel Glenfield > > Sent: Tuesday, July 15, 2003 10:13 AM > > To: dev...@li... > > Subject: [Dev-C++] new is a wrapper around malloc so... > > > > > > Hi guys, > > I'm writing some code for 16 bit and have code split into > > segments. This > > means I need to create a Far version of new, but I don't know > > much about > > malloc - can anyone show me what operator new looks like? > > >new is not a wrapper of malloc(). It is an entity of its own. In fact >malloc() should not be used in C++ because it does not call the object's >costructor. Also there is no guarantee that even for POD types new, delete >and the malloc() family,free() are interoperable. > >I do not know what a Far pointer, but I do know that they exist. Can you >tell us what does it mean? > > > >You can overide the operator new to define its functionality (e.g. to >provide space from an array of yours in the stack). It is what TC++PL names >"placement operator new". > > > > > > >Ioannis Vranos > >* Programming pages: http://www.noicys.freeurl.com >* Alternative URL 1: http://run.to/noicys >* Alternative URL 2: http://www.noicys.cjb.net > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps1 >_______________________________________________ >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 _________________________________________________________________ Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband |
|
From: Abhijit S. <mu...@gm...> - 2003-07-15 18:32:00
|
Hello, Ioannis and Daniel.
> I do not know what a Far pointer, but I do know that they exist. Can you
> tell us what does it mean?
Well, you must know that we have four basic segments (on the 8086) - the CS,
DS, SS and ES... by default, when a data pointer is defined, it is assumed
that the pointer resides in the data segment, and when a function pointer is
defined, that it resides in the code segment. However, when a pointer is
flagged as `far', it means that the segment is also stored explicitly along
with the offset. So, basically, far pointers allow you to access the whole
(and overwhelmingly huge) 1M of the 8086. Basically, far means residing in a
different segment, while near means residing in the same (the default)
segment.
Daniel, in response to your original question:
Assuming you code in Turbo-C++, you have three options:
1. Use a memory-model in which the required pointer's type is far by
default. If you need far data (the most common), use compact (in which the
data pointers are still near). If you need far code, use (umm, not sure,
really) large or huge (check the docs). You'll need to say something like
this:
char *foo = (char *)malloc(WHATEVER);
2. Use the farmalloc() function (in TC - in M$C, I've heard that it's named
halloc()). Corresponding frees should be done by farfree() (dunno about
M$C).
char far *foo = (char far *)farmalloc(WHATEVER);
// ...
farfree(foo);
3. The easiest - simply call `new'. AFAIK, you don't need to overload new:
char far *big_one = new char far[200];
// ^?
// Play around a bit with the syntax, I'm not sure that this works...
I remember doing something like this sometime back.
However, why do you need to use different segments at all? You should try
porting it to 32-bit protected-mode DOS (or even Windows console-mode), if
your application allows it. Sad as it is for me to say it, DOS is dead.
Anyway, here are a few links you might find interesting:
* http://www.delorie.com/djgpp
DJGPP - A DOS protected-mode C/++ compiler based on GCC
* http://sunsite.lanet.lv/ftp/mirror/x2ftp/msdos/programming/
The X2FTP - hordes of information on related topics.
HTH.
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|
|
From: Per W. <pw...@ia...> - 2003-07-15 18:31:44
|
The void* parameter of delete is only guaranteed in linear addressing mode. For 16-bit segmented code, delete might take a couple of other parameter types, depending on memory model used. It might take void __near* and void __far *. The void __far * is for 16-bit Intel composed of a 16:16 bit pointer, where the first 16 bit are the segment, and the next 16 bit are offset. However, a 16:16 pointer is still treated as a single parameter in the code, i.e. you still write "delete myobj;", where myobj contains a pointer returned by new. It is just code performing advanced pointer manipulation that needs to know that the pointer is segmented. For memory areas < 64kB this isn't a problem since the offset part spans 64kB. Arrays and memory blocks larger than 64kB do require special treatment, such as conversion to void __huge * to make sure that the offset part is always normalized 0..15 and the segment is constantly adjusted too. /Per W On Tue, 15 Jul 2003, Hossein Haeri wrote: > Dear Daniel, > > > What parameters does delete take? I'm being told by the compiler the first > > is __segment and the second is a __based(void)* ????? > > Is this right? > > If you only want the arguments, the following (the full signature) will > convince you: > > void* operator delete(void*) throw(); > void* operator delete [] (void*) throw(); > > I cite them directly from the Standard draft. But if you need more > information take a look to Section 3.7.3.2 (Deallocation functions) in > Standard. I don't have Accrobat Distiller. If I had I would send you > the wholl chapter as a pdf file. > > You will also find good stuff in TC++PL:Spec. E.g., consider Section > 6.2.6.2, Section 15.6.1, and (the best at) Section 19.4.5. > > Regards, > --Hossein > > > -- > __________________________________________________________ > Sign-up for your own FREE Personalized E-mail at Mail.com > http://www.mail.com/?sr=signup > > CareerBuilder.com has over 400,000 jobs. Be smarter about your job search > http://corp.mail.com/careers > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > 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: Hossein H. <ult...@em...> - 2003-07-15 18:16:00
|
Dear Daniel, > What parameters does delete take? I'm being told by the compiler the first > is __segment and the second is a __based(void)* ????? > Is this right? If you only want the arguments, the following (the full signature) will convince you: void* operator delete(void*) throw(); void* operator delete [] (void*) throw(); I cite them directly from the Standard draft. But if you need more information take a look to Section 3.7.3.2 (Deallocation functions) in Standard. I don't have Accrobat Distiller. If I had I would send you the wholl chapter as a pdf file. You will also find good stuff in TC++PL:Spec. E.g., consider Section 6.2.6.2, Section 15.6.1, and (the best at) Section 19.4.5. Regards, --Hossein -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup CareerBuilder.com has over 400,000 jobs. Be smarter about your job search http://corp.mail.com/careers |
|
From: Ioannis V. <iv...@em...> - 2003-07-15 18:08:49
|
> -----Original Message-----
> From: Ioannis Vranos [mailto:iv...@em...]
> Sent: Tuesday, July 15, 2003 9:00 PM
> To: Dev-C++ Mailing List (dev...@li...)
> Subject: RE: [Dev-C++] STL Map question
>
> if(whatever1[p->first]+whatever2[p->first]+.... == 0)
What I wrote above is not good, it's behaviour is implementation dependent.
The right approach is to check each return value against 0, since they are
pointer values.
So thee above should be:
if(!whatever1[p->first] && !whatever2[p->first] && ... &&
!whatevern[p->first])
{
//....
}
Sorry but apparently the caffeine had not reached my mind yet.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|
|
From: Ioannis V. <iv...@em...> - 2003-07-15 18:01:46
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Tuesday, July 15, 2003 6:37 PM > To: dev...@li... > Subject: [Dev-C++] overloading delete > > > What parameters does delete take? According to the C++ standard? >I'm being told by the > compiler the first > is __segment and the second is a __based(void)* ????? > Is this right? The above things arre not defined by the standard. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Ioannis V. <iv...@em...> - 2003-07-15 18:00:26
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Shane Bryldt
> Sent: Friday, July 11, 2003 11:53 PM
> To: Hossein Haeri
> Cc: C++
> Subject: Re: [Dev-C++] STL Map question
>=20
>=20
> Each Channel contains 3 UserList's as well. =20
> First, depicts all
> users in the Channel, the second depicts all the operators of=20
> the channel,
> and the third depicts the priviledged users who are not=20
> operators.=20
These above 3 UserList contain the connected-at-the-time kinds of people =
or
are their contents "constant", that is updated by another way?
> 2) The=20
> User class is
> being deleted, without being removed from the UserList. =20
> However, I can find
> no indication of this in the code. The code is many=20
> thousands of lines, it
> is not a small project by any means. Providing the source=20
> for the issue,
> would require the entire project as the issue is not=20
> specifically a syntax
> issue, but rather a situational issue. I do believe something has
> invalidated a User class, which a UserList has a pointer to,=20
> and when trying
> to use it, is causing a segmentation fault. I'm sure most of=20
> the experts
> here will agree with my conclusion and realize tracing this=20
> problem is no
> easy task.
You can place a special debugging code, a loop that checks that the =
entries
in all UserLists are consistent. An example is to sum up the sizes of =
each
map with the global to see where the problem is.
Then add a loop to verify each user using operator[]. Where you get as a
return value the pointer value 0 and in the UserList (which will be the =
one
that crashes) you get a pointer value then you have found the problem.
So make the above in a verify function which will be executed after =
every
complete entry update and which will be in the pseudocode-style:
// Assuming UserList is a typedef of a map
// and the UserList that crashes is the global
// because I do not remember.
void verify(const UserList &global, const UserList &whatever1, // etc)
{
=20
using namespace std;
UserList ::size_type sum=3Dwhatever1.size()+whatever.size()+//etc ;
if(sum!=3Dglobal.size())
{
for(UserList::const_iterator p=3Dglobal.begin(); p!=3Dglobal.end(); =
++p)
{
if(whatever1[p->first]+whatever2[p->first]+.... =3D=3D 0)
{
std::cerr<<"\n\nThe corrupted record is "<<p->first<<endl<<endl;
system("pause");
}
}
}
else cout<<"\n\nVerification phase passed\n\n";
}
=20
=20
>=20
> I've considered some commercial products like Purify, or some=20
> other memory
> tracking products, but I have no experience with any, since=20
> I've never had
> an issue I couldn't resolve purely with GDB. Since the=20
> problem traces back
> most likely to an invalid pointer reference, does anyone have=20
> suggestions on
> how I could possibly detect where the pointer is being deleted? I've
> considered the idea of using smart pointers to track the=20
> issue down, but
> again I'm not entirely certain of how to implement some code=20
> to track where
> the User is being deleted without being removed from the=20
> channels they are
> in... It could also potentially be an issue with overwritting=20
> memory, but
> with how often it is caused in exactly the same way, it's=20
> unlikely to be
> memory overbounding.
> I noticed a location where the key being used was being changed (a
> nickname), and in those cases, where the old code would just=20
> rename the
> nickname, I have now remove from the map and then readd to=20
> the map. When it
> tries to remove from the map is when it crashes. I can only=20
> assume that the
> problem is an invalid pointer, thus the map::find function is crashing
> because of invalid memory.=20
Do you check the result of map::find against map::end()?
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|
|
From: Rackley, N. P. <np...@sa...> - 2003-07-15 17:49:07
|
Is there also a good tutorial out there for how to get started with SDL? I'm using Windows 2000, and I haven't had much luck yet. Thanks! -DK |
|
From: Ioannis V. <iv...@em...> - 2003-07-15 17:26:06
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Tuesday, July 15, 2003 10:13 AM > To: dev...@li... > Subject: [Dev-C++] new is a wrapper around malloc so... > > > Hi guys, > I'm writing some code for 16 bit and have code split into > segments. This > means I need to create a Far version of new, but I don't know > much about > malloc - can anyone show me what operator new looks like? new is not a wrapper of malloc(). It is an entity of its own. In fact malloc() should not be used in C++ because it does not call the object's costructor. Also there is no guarantee that even for POD types new, delete and the malloc() family,free() are interoperable. I do not know what a Far pointer, but I do know that they exist. Can you tell us what does it mean? You can overide the operator new to define its functionality (e.g. to provide space from an array of yours in the stack). It is what TC++PL names "placement operator new". Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Daniel K. O. <dan...@ya...> - 2003-07-15 17:15:38
|
Did you try http://xmlsoft.org/ ? Daniel K. O. Rajan Bhide wrote: > Hi, > > I require to generate XML document using XML document generator through > my application code using C/C++ apis. I am trying this out using xerces > C++ library for Solaris platform with CC compiler. The xerces-c.22.0.so > library has a size of around 45MB, which is too much for a mere XML > document generation. Is there any way to build this library only with > the DOM apis with Document generation features, i.e no parsing api's are > required. Or Can anyone of u suggest any other C/C++ library for unix > which is small in size and provides XML document generation programming > api's. > > Thanks in advance, > > Rajan Bhide > |
|
From: Gabriel M. <g.m...@in...> - 2003-07-15 17:14:24
|
Thanks a lot!!! I changed the order of the libraries in the project options - Linker Parameters and now it compiles OK! Now the order is: -ltinyAudioLib -lpablioLIB_mme -lwinmm -ldsound I could never imagine this would cause of the error, becuase in MSVC the order of the libraries is not significant. I also tried to link the application with the library binaries originally compiled with MSVC, now I only get the following error: ====================== Info: resolving __iob by linking to __imp___iob (auto-import) ../../Libraries/tinyAudioLib/release\tinyAudioLib.lib(./pablioLIB_mme___Win32_Release/pa_win_wmme.obj)(.text+0x165):C:\LibroBoulanger\: variable '_iob' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details. make.exe: *** [devcpp/hellotableRT.exe] Error 1 Execution terminated ====================== have you any idea of what this error means? Where is the "detailed documentation for ld's --enable-auto-import" ? The _iob identifier is not present in the sources of the tinyAudioLib nor in the main program soruce file. Is it possible to get rid of such error in a way or another? thanks again Gabriel |
|
From: Rajan B. <rb...@nu...> - 2003-07-15 16:58:57
|
Hi, I require to generate XML document using XML document generator through = my application code using C/C++ apis. I am trying this out using xerces = C++ library for Solaris platform with CC compiler. The xerces-c.22.0.so = library has a size of around 45MB, which is too much for a mere XML = document generation. Is there any way to build this library only with = the DOM apis with Document generation features, i.e no parsing api's are = required. Or Can anyone of u suggest any other C/C++ library for unix = which is small in size and provides XML document generation programming = api's. Thanks in advance, Rajan Bhide |
|
From: <sol...@ya...> - 2003-07-15 16:32:31
|
Dev-C++ (IDE for MinGW) supports resource files, it compiles them right, through windres.exe. What Dev has not is a resource editor, so you have to create your dialog templates and such things that come in that files by hand (is this correct english?), from scratch. If you want a resource editor as the one with Borland or MSVisual, you can download the resource editor for Win-LCC. You can find it at http://www.objectcentral.com (I'm not sure about the domain extension, perhaps it is org). You can then use it producing the header files and the text resource files (those which have the .rc extension) and add them to your dev project. Rackley, Nathanael Pratt wrote: >Okay, I've been looking at the tutorial www.winprog.org/tutorial ><www.winprog.org/tutorial> > >Only one question so far - > >How do I work with Resource files in Dev-Cpp? So far, I don't think I've >been able to find anything in the program that supports them. Is this >something that is only seen in MSVC++ or BC++? I would like to know if (in >the case that resource files can't be used with Dev-Cpp) there is an >alternative to this method for doing menus and icons in the Windows API. > >Thanks! > >-DK > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps1 >_______________________________________________ >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: Daniel G. <sp...@ho...> - 2003-07-15 15:37:26
|
What parameters does delete take? I'm being told by the compiler the first is __segment and the second is a __based(void)* ????? Is this right? Daniel _________________________________________________________________ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger |
|
From: Rackley, N. P. <np...@sa...> - 2003-07-15 15:14:38
|
Okay, I've been looking at the tutorial www.winprog.org/tutorial <www.winprog.org/tutorial> Only one question so far - How do I work with Resource files in Dev-Cpp? So far, I don't think I've been able to find anything in the program that supports them. Is this something that is only seen in MSVC++ or BC++? I would like to know if (in the case that resource files can't be used with Dev-Cpp) there is an alternative to this method for doing menus and icons in the Windows API. Thanks! -DK |
|
From: Damien <g_...@ho...> - 2003-07-15 12:29:56
|
<html><div style='background-color:'><DIV><mailto:dev...@li...?subject=help><mailto:dev...@li...><mailto:dev...@li...?subject=subscribe><mailto:dev...@li...?subject=unsubscribe> <DIV>>Do I </DIV></DIV> <DIV></DIV>>have to re-compile such libraries with devcpp? (I hope I don't <DIV></DIV> <P>>have).</P> <P>Well, I think you might have to. Try the Import MSVC Project feature(go to File->Import), that might make recompiling those other projects easier. If your librbaries were not static, you could use a mingw util called reimp to convert MSVC libraries to Dev-C++ libraries.</P> <P> </P> <DIV></DIV> <DIV></DIV>>g++.exe devcpp/hellotable.o -o "devcpp\hellotableRT.exe" <DIV></DIV>>-L"C:/Dev-Cpp/lib" -L"../../Libraries/tinyAudioLib/devcpp" <DIV></DIV>>-L"../../Libraries/PortaudioMSVC/devcpp" -lkernel32 -luser32 -lgdi32 <DIV></DIV>>-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid <DIV></DIV>>-lodbc32 -lodbccp32 -lkernel32 -luser32 -lgdi32 -lwinspool <DIV></DIV>>-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 <DIV></DIV>>-lodbccp32 -lwinmm -ldsound -lpablioLIB_mme -ltinyAudioLib <DIV></DIV> <DIV></DIV> <DIV></DIV> <P>If in your new project you get linker errors, try placing -lwinmm, and -ldsound <STRONG>after</STRONG> -lpablioLIB_mme and -ltinyAudioLib. Go into the project options(ALT+P), and then to the Linker Parameters, and change the ordering.</P> <DIV></DIV></mailto:dev...@li...?subject=unsubscribe></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...></mailto:dev...@li...?subject=help></div><br clear=all><hr>The new <a href="http://g.msn.com/8HMOEN/2737??PS=">MSN 8:</a> smart spam protection and 2 months FREE* </html> |
|
From: Hossein H. <ult...@em...> - 2003-07-15 10:57:15
|
Shane, > > When it breaks out into GDB in the crash, > > it leaves me at > > a "map::find" statement, which, when I step into it, I find > > that the key (an > > std::string) is valid, but the data portion, a pointer to an > > allocated User, > > is somehow fubar'd, because if I try to print (no different > > than getting the > > value of a variable in VC++ debugger) the pointer, GDB itself > > will indicate > > that the program crashed while attempting to execute > > something by GDB. This > > means that 1) the code crashes and drops me into the > > debugger, and 2) it is > > in fact crashing because of the variable value, as executing > > the single > > operation of printing the value causes an internal crash that > > GDB recovers > > from, but ends execution of the program. > > > This is happening because you use the library in an improper C style way. > Had the map contained objects instead of pointers you would find no record > when you used the find() and would get User(0) when accessed the key using > operator[]. Better use C++ as C++ and not as C. Yep! I agree. Maybe not a bad idea to follow this. > > The problem I am seeing, I have never seen in all my time > > programming, and I > > have a good 8 years background with C. Further issues with > > this, may result > > in me reverting UserList to a true linked list > > implementation, instead of > > STL, which could be the culprit even though I don't want to > > blame it. > > > !!! The problem is your programming approach, not the standard library! I do not want to offend you, but perhaps he is right. You have tested everything, right? Why don't you test this one? (Forgive me if you have done it before.) > > Even > > reverting temporarily to a C linked list may help me in > > travelling the list > > in the debugger to find out where the problem is (like if > > it's the last or > > first element, etc)... Short of testing my new changes, this > > will be the > > next step, to revert to a very slow and simple linked list > > until I can track > > down the problem. At least I have some direction, I > > appreciate the help > > everyone has offered. > > > The standard library provides a double linked list implementation, > std::list. But your problem is that you code in C with classes, not C++! Probabely yeah! Regards, --Hossein -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup CareerBuilder.com has over 400,000 jobs. Be smarter about your job search http://corp.mail.com/careers |