dev-cpp-users Mailing List for Dev-C++ (Page 687)
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: <jos...@ya...> - 2001-07-03 12:29:18
|
I remember that when I updated to the newest version of Mingw 2 months ago I had to unpack only some of the files to make it work. Unpacking everything didn't work. I can't remember now which files were, sorry. Chemanuel --- jar...@ig... escribió: > Hi, > > I've tried (naively) to unpack the recent > mingw-1.0-20010608.tar.gz > package into the Dev-C++ directory > since I need gcc-2.95.3 > Unfortunately, now g++ produces an > error message: can't exec > C:/DEV-C_~/BIN/cpp0.exe > > Even if I copy cpp0.exe from > lib/gcc-lib/mingw32/2-93-3.4 > into Dev-C++/Bin > I get this message. > > What's going wrong? > > Thanks for any hint, > > > Helmut Jarausch > > Lehrstuhl fuer Numerische Mathematik > Institute of Technology, RWTH Aachen > D 52056 Aachen, Germany > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _______________________________________________________________ Do You Yahoo!? Yahoo! Messenger: Comunicación instantánea gratis con tu gente - http://messenger.yahoo.es |
|
From: <jos...@ya...> - 2001-07-03 12:24:43
|
The file you need is libcomctl32.a This is the path I have in my PC. C:\Dev-C++\Lib\libcomctl32.a Chemanuel --- Yoshiaki Goya <yos...@re...> escribió: > Hello, > I am very new to Dev-C++. > Now, I am creating Win32 application using Dev-C++ and want to use > common control such as toolbar. > When I compile the project, linker says "g++: comctl32.lib: No such > file > or directory". > I set compiler option to "-l comctl32.lib" in project options and add > library pathes. > However, it does not work. > > How can I link the library? > > Thanks in advance. > -Yoshiaki > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _______________________________________________________________ Do You Yahoo!? Yahoo! Messenger: Comunicación instantánea gratis con tu gente - http://messenger.yahoo.es |
|
From: <jar...@ig...> - 2001-07-03 12:23:40
|
Hi, I've tried (naively) to unpack the recent mingw-1.0-20010608.tar.gz package into the Dev-C++ directory since I need gcc-2.95.3 Unfortunately, now g++ produces an error message: can't exec C:/DEV-C_~/BIN/cpp0.exe Even if I copy cpp0.exe from lib/gcc-lib/mingw32/2-93-3.4 into Dev-C++/Bin I get this message. What's going wrong? Thanks for any hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik Institute of Technology, RWTH Aachen D 52056 Aachen, Germany |
|
From: Yoshiaki G. <yos...@re...> - 2001-07-03 12:11:32
|
Hello, I am very new to Dev-C++. Now, I am creating Win32 application using Dev-C++ and want to use common control such as toolbar. When I compile the project, linker says "g++: comctl32.lib: No such file or directory". I set compiler option to "-l comctl32.lib" in project options and add library pathes. However, it does not work. How can I link the library? Thanks in advance. -Yoshiaki |
|
From: Ioannis V. <no...@ya...> - 2001-07-03 11:29:09
|
This is not an error. A structure's space in memory is not the summary
of the sizeof() of everyone of its members. It may occupy more memory
due to compiler's memory management technique. For more information read
section 8.7 in K&R 2. For example a compiler's memory management can be
a connected list of structs (compilers, operating systems e.t.c. are
written in C/C++ too). So in the example of K&R it has a list of unions
connected structs:
typedef long Align;
union header
{
struct
{
union header *ptr; /* points to next block */
unsigned size;
}s;
Align x;
};
typedef union header Header;
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Jeethu
Rao
Sent: Tuesday, July 03, 2001 5:52 AM
To: Dev CPP Mailing List
Subject: [Dev-C++] [Dev-C++]: Errors in structures
Hi,
I've noticed this strange little Bug.I'm not certain weather its a bug
or a feature.
The size of this structure is actually 13 bytes.
But sizeof(header) says its 16.
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
unsigned char fname_sz;
}header;
No, if I comment out the fname_sz member,
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
//unsigned char fname_sz;
}header;
sizeof(header) returns 12.
Is the compiler trying to align structure on DWORD boundaries?
How do I get rid of this Bug/Feature ?
Thnx,
Jeethu Rao
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Elias P. <eli...@ao...> - 2001-07-03 11:08:03
|
> It is not a bug, it is compiler feature. For some optimizations some c++
> compilers adjust the size of structue to the multiple of 8.
>
I think it is only a multiple of 4. The reason is that the compiler you are
using is for a 32bit processor. You will find the same thing on any other
compiler which outputs 32bit object code as well. (A 64bit processor
probably will use 8 byte.) The reason for this is, for a 32-processor the
memory is just a block of 32 bit long units, and 32 bits are 4 bytes. So
every variable (even structs) should start on a 4 bytes boundary. That's
why they have to be aligned to the length of a multiple of 4 bytes.
To turn the alignment of structs off in mingw, try this (the code will
not be portable anymore then though, because if you compile with another
compiler like MSVC, it won't recognize it):
struct mystruct {
char a;
int b;
} __attribute__((packed)) c;
sizeof(c) should now be 5, one char (1) and one int (4).
Regards,
Elias Pschernig
|
|
From: Johannes P. <joh...@pr...> - 2001-07-03 07:07:04
|
>Date: Tue, 03 Jul 2001 09:16:19 +0200
>To: dev...@li...
>From: Johannes Pretorius <joh...@pr...>
>Subject: RE: [Dev-C++] [Dev-C++]: Errors in structures
>
>
>Action : Response
>Mood : Friendly
>Subject : Data Type mismatch in C/C++ gcc ,mingW32 compiler
>
>Considering this Feature . It is making it hard to read a fixed structure
>size from a file or a memory stream for
>instance for the compiler has decided that the structure must be
>optimized. Meaning that if a other compiler
>created the file then the program will not read the correct size of the
>contents in to contain all the data.
>
>Considering this if I turn all compiler option of from the DevC++ IDE the
>result is still the same.
>else I dont know or cant see how this can be usefull in complaince wise..
>
>Or am I missing something ???
>
>Thanks for your help so far
>
>Johannes
>
>
>
>At 11:35 04/07/2001 +0530, you wrote:
>>It is not a bug, it is compiler feature. For some optimizations some c++
>>compilers adjust the size of structue to the multiple of 8.
>>
>>
>>Hi there
>>-------------
>>I am sorry to say that I dont have an answer for you . The LibC help file
>>does say that the Data Types can vary from Compiler
>>to Compiler But I WOULD like to show what I have also picked up with your
>>Code
>>
>>//Snippet - START
>>#include <iostream.h>
>>#include <stdlib.h>
>>#include <limits.h>
>>
>>struct tea_hdr{
>> int version; //-- 1
>> char jte[3]; // -- 2
>> //char fname_sz; // -- 3
>> //char infile_size; // -- 4
>>// char infile_crc; // -- 5
>>
>> }header;
>>
>>
>>int main()
>>{
>> cout<<"Char Minimum : "<<CHAR_MIN<<endl;
>> cout<<"Char Max : "<<CHAR_MAX<<endl;
>> cout<<"Unsigned Char Max : "<<UCHAR_MAX<<endl;
>> cout <<"Header : "<<sizeof(header)<<endl;
>> cout<<"Struct : "<<sizeof(tea_hdr)<<endl;
>> system("PAUSE");
>> return 0;
>>}
>>
>>//Snippet END
>>
>>Now if you compile it as follow the Size of the Structure is 8 (The integer
>>(5) and the char[3]) That is ok.,
>>
>>Now remove the comment before item 3 and compile and run Again.. The size
>>is STILL the same ?? Is this just my
>>PC.. must I reboot.. BUT there is more.
>>
>>Now uncomment item 4 .. Compile and RUN.. SIZE is 12 that is 4 bytes
>>extra,But there is still more
>>
>>Now uncomment item 5 and compile and run.. IT stays at 12 bytes again..
>>This seems to be variable
>>items count related. I have sifted the vars around and nothing is with
>>there posisions..
>>Also it only starts when MIXING variables in the structure.. I have a
>>feeling that this is something
>>that can be compiler related.. BUT what I did notice in the 'stddef.h' File
>>is that the MingW32 oaks have
>>a prob with the defs of the Gcc compiler and has added some macro to fix it
>>.. I wonder if maybe something else
>>also was missed that can relate to this. That the problem can maybe be at
>>the MingW32 project.
>>
>>I don't have any answer's just maybes. but maybe it can help you in getting
>>to a answer For IF I cam correct you are trying to
>>read the information into the structure from a File .. like the header of a
>>MP3..
>>
>>I dont have any other Ideas atound this but I hope you get a solution
>>
>>Good luck
>>
>>Johannes
>>
>>
>>
>>
>>
>>
>>At 09:22 03/07/2001 +0530, you wrote:
>> >Hi,
>> >
>> >I've noticed this strange little Bug.I'm not certain weather its a bug or a
>> >feature.
>> >
>> >The size of this structure is actually 13 bytes.
>> >
>> >But sizeof(header) says its 16.
>> >
>> >struct tea_hdr
>> > {
>> > char jte[3];
>> > unsigned char version;
>> > DWORD infile_size;
>> > DWORD infile_crc;
>> > unsigned char fname_sz;
>> > }header;
>> >
>> >No, if I comment out the fname_sz member,
>> >
>> >struct tea_hdr
>> > {
>> > char jte[3];
>> > unsigned char version;
>> > DWORD infile_size;
>> > DWORD infile_crc;
>> > //unsigned char fname_sz;
>> > }header;
>> >
>> >sizeof(header) returns 12.
>> >
>> >Is the compiler trying to align structure on DWORD boundaries?
>> >
>> >How do I get rid of this Bug/Feature ?
>> >
>> >Thnx,
>> >Jeethu Rao
>> >
>> >
>> >_______________________________________________
>> >Dev-cpp-users mailing list
>> >Dev...@li...
>> >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>>
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>>
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Johannes P. <joh...@pr...> - 2001-07-03 07:07:00
|
>Date: Tue, 03 Jul 2001 09:16:19 +0200
>To: dev...@li...
>From: Johannes Pretorius <joh...@pr...>
>Subject: RE: [Dev-C++] [Dev-C++]: Errors in structures
>
>
>Action : Response
>Mood : Friendly
>Subject : Data Type mismatch in C/C++ gcc ,mingW32 compiler
>
>Considering this Feature . It is making it hard to read a fixed structure
>size from a file or a memory stream for
>instance for the compiler has decided that the structure must be
>optimized. Meaning that if a other compiler
>created the file then the program will not read the correct size of the
>contents in to contain all the data.
>
>Considering this if I turn all compiler option of from the DevC++ IDE the
>result is still the same.
>else I dont know or cant see how this can be usefull in complaince wise..
>
>Or am I missing something ???
>
>Thanks for your help so far
>
>Johannes
>
>
>
>At 11:35 04/07/2001 +0530, you wrote:
>>It is not a bug, it is compiler feature. For some optimizations some c++
>>compilers adjust the size of structue to the multiple of 8.
>>
>>
>>Hi there
>>-------------
>>I am sorry to say that I dont have an answer for you . The LibC help file
>>does say that the Data Types can vary from Compiler
>>to Compiler But I WOULD like to show what I have also picked up with your
>>Code
>>
>>//Snippet - START
>>#include <iostream.h>
>>#include <stdlib.h>
>>#include <limits.h>
>>
>>struct tea_hdr{
>> int version; //-- 1
>> char jte[3]; // -- 2
>> //char fname_sz; // -- 3
>> //char infile_size; // -- 4
>>// char infile_crc; // -- 5
>>
>> }header;
>>
>>
>>int main()
>>{
>> cout<<"Char Minimum : "<<CHAR_MIN<<endl;
>> cout<<"Char Max : "<<CHAR_MAX<<endl;
>> cout<<"Unsigned Char Max : "<<UCHAR_MAX<<endl;
>> cout <<"Header : "<<sizeof(header)<<endl;
>> cout<<"Struct : "<<sizeof(tea_hdr)<<endl;
>> system("PAUSE");
>> return 0;
>>}
>>
>>//Snippet END
>>
>>Now if you compile it as follow the Size of the Structure is 8 (The integer
>>(5) and the char[3]) That is ok.,
>>
>>Now remove the comment before item 3 and compile and run Again.. The size
>>is STILL the same ?? Is this just my
>>PC.. must I reboot.. BUT there is more.
>>
>>Now uncomment item 4 .. Compile and RUN.. SIZE is 12 that is 4 bytes
>>extra,But there is still more
>>
>>Now uncomment item 5 and compile and run.. IT stays at 12 bytes again..
>>This seems to be variable
>>items count related. I have sifted the vars around and nothing is with
>>there posisions..
>>Also it only starts when MIXING variables in the structure.. I have a
>>feeling that this is something
>>that can be compiler related.. BUT what I did notice in the 'stddef.h' File
>>is that the MingW32 oaks have
>>a prob with the defs of the Gcc compiler and has added some macro to fix it
>>.. I wonder if maybe something else
>>also was missed that can relate to this. That the problem can maybe be at
>>the MingW32 project.
>>
>>I don't have any answer's just maybes. but maybe it can help you in getting
>>to a answer For IF I cam correct you are trying to
>>read the information into the structure from a File .. like the header of a
>>MP3..
>>
>>I dont have any other Ideas atound this but I hope you get a solution
>>
>>Good luck
>>
>>Johannes
>>
>>
>>
>>
>>
>>
>>At 09:22 03/07/2001 +0530, you wrote:
>> >Hi,
>> >
>> >I've noticed this strange little Bug.I'm not certain weather its a bug or a
>> >feature.
>> >
>> >The size of this structure is actually 13 bytes.
>> >
>> >But sizeof(header) says its 16.
>> >
>> >struct tea_hdr
>> > {
>> > char jte[3];
>> > unsigned char version;
>> > DWORD infile_size;
>> > DWORD infile_crc;
>> > unsigned char fname_sz;
>> > }header;
>> >
>> >No, if I comment out the fname_sz member,
>> >
>> >struct tea_hdr
>> > {
>> > char jte[3];
>> > unsigned char version;
>> > DWORD infile_size;
>> > DWORD infile_crc;
>> > //unsigned char fname_sz;
>> > }header;
>> >
>> >sizeof(header) returns 12.
>> >
>> >Is the compiler trying to align structure on DWORD boundaries?
>> >
>> >How do I get rid of this Bug/Feature ?
>> >
>> >Thnx,
>> >Jeethu Rao
>> >
>> >
>> >_______________________________________________
>> >Dev-cpp-users mailing list
>> >Dev...@li...
>> >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>>
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>>
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Lover of C++ <lo...@gl...> - 2001-07-03 06:07:55
|
It is not a bug, it is compiler feature. For some optimizations some c++
compilers adjust the size of structue to the multiple of 8.
Hi there
-------------
I am sorry to say that I dont have an answer for you . The LibC help file
does say that the Data Types can vary from Compiler
to Compiler But I WOULD like to show what I have also picked up with your
Code
//Snippet - START
#include <iostream.h>
#include <stdlib.h>
#include <limits.h>
struct tea_hdr{
int version; //-- 1
char jte[3]; // -- 2
//char fname_sz; // -- 3
//char infile_size; // -- 4
// char infile_crc; // -- 5
}header;
int main()
{
cout<<"Char Minimum : "<<CHAR_MIN<<endl;
cout<<"Char Max : "<<CHAR_MAX<<endl;
cout<<"Unsigned Char Max : "<<UCHAR_MAX<<endl;
cout <<"Header : "<<sizeof(header)<<endl;
cout<<"Struct : "<<sizeof(tea_hdr)<<endl;
system("PAUSE");
return 0;
}
//Snippet END
Now if you compile it as follow the Size of the Structure is 8 (The integer
(5) and the char[3]) That is ok.,
Now remove the comment before item 3 and compile and run Again.. The size
is STILL the same ?? Is this just my
PC.. must I reboot.. BUT there is more.
Now uncomment item 4 .. Compile and RUN.. SIZE is 12 that is 4 bytes
extra,But there is still more
Now uncomment item 5 and compile and run.. IT stays at 12 bytes again..
This seems to be variable
items count related. I have sifted the vars around and nothing is with
there posisions..
Also it only starts when MIXING variables in the structure.. I have a
feeling that this is something
that can be compiler related.. BUT what I did notice in the 'stddef.h' File
is that the MingW32 oaks have
a prob with the defs of the Gcc compiler and has added some macro to fix it
.. I wonder if maybe something else
also was missed that can relate to this. That the problem can maybe be at
the MingW32 project.
I don't have any answer's just maybes. but maybe it can help you in getting
to a answer For IF I cam correct you are trying to
read the information into the structure from a File .. like the header of a
MP3..
I dont have any other Ideas atound this but I hope you get a solution
Good luck
Johannes
At 09:22 03/07/2001 +0530, you wrote:
>Hi,
>
>I've noticed this strange little Bug.I'm not certain weather its a bug or a
>feature.
>
>The size of this structure is actually 13 bytes.
>
>But sizeof(header) says its 16.
>
>struct tea_hdr
> {
> char jte[3];
> unsigned char version;
> DWORD infile_size;
> DWORD infile_crc;
> unsigned char fname_sz;
> }header;
>
>No, if I comment out the fname_sz member,
>
>struct tea_hdr
> {
> char jte[3];
> unsigned char version;
> DWORD infile_size;
> DWORD infile_crc;
> //unsigned char fname_sz;
> }header;
>
>sizeof(header) returns 12.
>
>Is the compiler trying to align structure on DWORD boundaries?
>
>How do I get rid of this Bug/Feature ?
>
>Thnx,
>Jeethu Rao
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Johannes P. <joh...@pr...> - 2001-07-03 05:44:45
|
Hi there
-------------
I am sorry to say that I dont have an answer for you . The LibC help file
does say that the Data Types can vary from Compiler
to Compiler But I WOULD like to show what I have also picked up with your Code
//Snippet - START
#include <iostream.h>
#include <stdlib.h>
#include <limits.h>
struct tea_hdr{
int version; //-- 1
char jte[3]; // -- 2
//char fname_sz; // -- 3
//char infile_size; // -- 4
// char infile_crc; // -- 5
}header;
int main()
{
cout<<"Char Minimum : "<<CHAR_MIN<<endl;
cout<<"Char Max : "<<CHAR_MAX<<endl;
cout<<"Unsigned Char Max : "<<UCHAR_MAX<<endl;
cout <<"Header : "<<sizeof(header)<<endl;
cout<<"Struct : "<<sizeof(tea_hdr)<<endl;
system("PAUSE");
return 0;
}
//Snippet END
Now if you compile it as follow the Size of the Structure is 8 (The integer
(5) and the char[3]) That is ok.,
Now remove the comment before item 3 and compile and run Again.. The size
is STILL the same ?? Is this just my
PC.. must I reboot.. BUT there is more.
Now uncomment item 4 .. Compile and RUN.. SIZE is 12 that is 4 bytes
extra,But there is still more
Now uncomment item 5 and compile and run.. IT stays at 12 bytes again..
This seems to be variable
items count related. I have sifted the vars around and nothing is with
there posisions..
Also it only starts when MIXING variables in the structure.. I have a
feeling that this is something
that can be compiler related.. BUT what I did notice in the 'stddef.h' File
is that the MingW32 oaks have
a prob with the defs of the Gcc compiler and has added some macro to fix it
.. I wonder if maybe something else
also was missed that can relate to this. That the problem can maybe be at
the MingW32 project.
I don't have any answer's just maybes. but maybe it can help you in getting
to a answer For IF I cam correct you are trying to
read the information into the structure from a File .. like the header of a
MP3..
I dont have any other Ideas atound this but I hope you get a solution
Good luck
Johannes
At 09:22 03/07/2001 +0530, you wrote:
>Hi,
>
>I've noticed this strange little Bug.I'm not certain weather its a bug or a
>feature.
>
>The size of this structure is actually 13 bytes.
>
>But sizeof(header) says its 16.
>
>struct tea_hdr
> {
> char jte[3];
> unsigned char version;
> DWORD infile_size;
> DWORD infile_crc;
> unsigned char fname_sz;
> }header;
>
>No, if I comment out the fname_sz member,
>
>struct tea_hdr
> {
> char jte[3];
> unsigned char version;
> DWORD infile_size;
> DWORD infile_crc;
> //unsigned char fname_sz;
> }header;
>
>sizeof(header) returns 12.
>
>Is the compiler trying to align structure on DWORD boundaries?
>
>How do I get rid of this Bug/Feature ?
>
>Thnx,
>Jeethu Rao
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Jeethu R. <je...@sa...> - 2001-07-03 03:51:10
|
Hi,
I've noticed this strange little Bug.I'm not certain weather its a bug or a
feature.
The size of this structure is actually 13 bytes.
But sizeof(header) says its 16.
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
unsigned char fname_sz;
}header;
No, if I comment out the fname_sz member,
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
//unsigned char fname_sz;
}header;
sizeof(header) returns 12.
Is the compiler trying to align structure on DWORD boundaries?
How do I get rid of this Bug/Feature ?
Thnx,
Jeethu Rao
|
|
From: Jeethu R. <je...@sa...> - 2001-07-02 03:47:00
|
Hi,
I'm writing a small program for which, I use fwrite to write the output to a
binary file. But I can write with it successfully, but the last member of
the structure is not written. What could be the problem ? here is a brief
snippet
of the fwrite section.
Thanks Johannes Pretorius for your last suggestion regarding seperating
filename and pathnames. Although
Johanne's code did'nt work, he gave me a brief Idea of how it could be done.
the code is given below the first snip.
Although its quite long, it meets its design consderation(Safety!).
Johannes, you may not like the malloc() i too
don't like it but it seems to be ok out there.
Thnx,
Jeethu Rao
<Snippet>
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
unsigned char fname_sz;
};
tea_hdr header;
strncpy((char*)header.jte,"JTE",3);
header.version = 1;
header.infile_size = (DWORD)fil_len;
header.infile_crc = crc32;
header.fname_sz =(unsigned char)strlen(filename);
if(strlen(filename)>255)
{
fclose(outfile);
Terror=err_fname_too_long;
return Terror;
}
if((fwrite(&header,sizeof(header),1,outfile))!=1) //This writes everything
except fname_sz
{
cout<<"Error Here"<<endl;
fclose(outfile);
Terror=err_opt_file;
return Terror;
}
</Snippet>
int TEA::encipher_file(char* filename,char* outfilename,unsigned long*
password )
{
FILE* infile;
FILE* outfile;
err_msgs Terror;
if((infile = fopen(filename,"rb"))==NULL)
{
Terror = err_no_input_file;
return Terror;
}
fclose(infile); // Just for a while
if((outfile = fopen(outfilename,"wb"))==NULL)
{
fclose(infile);
Terror = err_opt_file;
return Terror;
}
//Now that the Bad Guys are taken care of, lets Continue the Good Work
DWORD crc32;
long crc_len;
long fil_len;
int crc_result;
crc_result = crc32file(filename,&crc32,&crc_len);
fil_len=flength(filename);
if(fil_len ==-1)
{
fclose(outfile);
Terror = err_no_input_file;
return Terror;
}
if(crc_result==-1)
{
fclose(outfile);
Terror = err_calc_crc;
return Terror;
}
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
unsigned char fname_sz;
};
tea_hdr header;
strncpy((char*)header.jte,"JTE",3);
header.version = 1;
header.infile_size = (DWORD)fil_len;
header.infile_crc = crc32;
header.fname_sz =(unsigned char)strlen(filename);
cout<<"sizeof(header) = "<< sizeof(header)<<endl;
printf("header.jte = %s3\n",header.jte);
printf("header.version = %i\n",header.version);
printf("header.infile_size = %u\n",header.infile_size);
printf("header.infile_crc = %u\n",header.infile_crc);
printf("header.fname_sz = %d\n",header.fname_sz);
if(strlen(filename)>255)
{
fclose(outfile);
Terror=err_fname_too_long;
return Terror;
}
if((fwrite(&header,sizeof(header),1,outfile))!=1)
{
cout<<"Error Here"<<endl;
fclose(outfile);
Terror=err_opt_file;
return Terror;
}
if(fwrite(filename,strlen(filename),1,outfile)!=1)
{
fclose(outfile);
Terror=err_opt_file;
return Terror;
}
long infilebuf_sz = fil_len+(fil_len%8);
char* infilebuf =(char*)malloc(infilebuf_sz);
char inbuf[8];
char outbuf[8];
if(infilebuf==NULL)
{
fclose(outfile);
Terror=err_no_mem;
return Terror;
}
infile = fopen(filename,"rb");
memset(infilebuf,'\0',infilebuf_sz);
if(fread(infilebuf,fil_len,1,infile)!=1)
{
free(infilebuf);
fclose(infile);
fclose(outfile);
Terror=err_input_file;
return Terror;
}
for(int x=0;x<infilebuf_sz;x+=8) // might be <= ?
{
strncpy(inbuf,infilebuf+x,8);
encipher((unsigned long*)inbuf,(unsigned long*)outbuf,password);
if(fwrite((char*)&outbuf,8,1,outfile)!=1)
{
Terror=err_opt_file;
return Terror;
}
}
free(infilebuf);
fclose(infile);
fclose(outfile);
return 0;
}
char* TEA::err2msg(int err)
{
//errmsg loctemp;
//loctemp = err;
switch(err)
{
case err_ok:
return "No Error Encountered\n";
break;
case err_no_input_file:
return "Input File Does Not Exist\n";
break;
case err_no_output_file:
return "Output File Already Exists\n";
break;
case err_opt_file:
return "Error while writing Output File\n";
break;
case err_input_file:
return "Error while reading input file\n";
break;
case err_calc_crc:
return "Error while calculating CRC32\n";
break;
case err_fname_too_long:
return "Error: The input filename is greater that 255 characters\n";
break;
case err_no_mem:
return "Error: Not enough memory\n";
break;
}
}
<SNIPPET>
//The working code for seperating filenames and pathnames
BOOL getFileName(char *SourceString,char *cpFileDir, char *cpFileName)
{
int iPos = 0;
char *cpCutOffPoint;
char *caSourceString = (char*)malloc(strlen(SourceString)+1);
if(caSourceString==NULL)
{
return FALSE;
}
if(strlen(SourceString)==0)
{
free(caSourceString);
return FALSE;
}
strcpy(caSourceString,SourceString);
strrev(caSourceString);
cpCutOffPoint = strchr(caSourceString,'\\');
if(cpCutOffPoint==NULL)
{
strcpy(cpFileName,caSourceString);
strrev(cpFileName);
free(caSourceString);
return TRUE;
}
strcpy(cpFileDir,cpCutOffPoint);
strrev(cpFileDir);
iPos = strlen(caSourceString)-strlen(cpFileDir);
strncpy(cpFileName,caSourceString,iPos);
cpFileName[iPos]='\0';
strrev(cpFileName);
free(caSourceString);
return TRUE;
}
</SNIPPET>
|
|
From: Iuri K. <IK...@am...> - 2001-07-01 23:05:27
|
I need to make a telnet client in C++ but I haven't socket.h
in.h and the other libs needed for sockets.
Where can I find these libs(non-FTP pref)?
Or could someone mail them to me: ik...@am...
Thanks, Iuri
|
|
From: Phil S. <fy...@qw...> - 2001-07-01 17:29:49
|
Thanks for the clarification. I thought I had tried that, but I put in empty brackets, which gave me redeclaration errors. so close... Szczepan Holyszewski wrote: > > ----- Original Message ----- > From: "Phil Schulz" <fy...@qw...> > To: <dev...@li...> > Sent: Sunday, July 01, 2001 1:21 AM > Subject: [Dev-C++] declaring two classes with pointers to each other? > > > > > I want to create two classes that contain > > pointers to each other, but I keep getting > > "Syntax error before *" I know a class can > > contain a pointer to itself, but why not to > > others before it is fully defined? > > You are forgetting forward declarations. Here are your > files fixed. I removed the irrelevant "using namespace std;" > directives. > > Hope this helps. > > Szczepan Holyszewski > ru...@po... > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users -- Fy...@qw... |
|
From: Charles <cha...@at...> - 2001-07-01 17:27:56
|
Luigi - > I have installed the Cygnus Insight debugger, and tried to debug a simple console mode application (the "hello world"). > When I click the debug icon from the Dev C++ IDE (vers. 4) among the other windows (source, console, ...) a "warning" pops up, it says: GDB (title of the window) i386 architecture file may be incompatible with i386:intel target... First be sure that you have downloaded the Insight version 5 debugger from http://www.bloodshed.net/dev/. There are enormous improvements over the earlier version and it is configured to work with Dev-C++ on Windows machines (if that is what you are running). Well, it's not perfect but it crashes far less often. > Then when I click on the run icon (in the source window) the program hangs. What message do you get in the Console Window when that happens? What happens when you enter RUN in the console window? Verify that the Target is set to EXEC in the Target Selection area. From the Source Window click on File, then Target Settings. Chuck |
|
From: <csc...@gm...> - 2001-07-01 15:24:22
|
help |
|
From: Szczepan H. <ru...@po...> - 2001-07-01 14:51:45
|
----- Original Message -----
From: "Phil Schulz" <fy...@qw...>
To: <dev...@li...>
Sent: Sunday, July 01, 2001 1:21 AM
Subject: [Dev-C++] declaring two classes with pointers to each other?
>
> I want to create two classes that contain
> pointers to each other, but I keep getting
> "Syntax error before *" I know a class can
> contain a pointer to itself, but why not to
> others before it is fully defined?
Because the compiler must at least know that the identifier
used before * is a class name. When you define a class with
a pointer to itself, the compiler knows it because the current
class name has already been parsed as such.
class Foo { // Now we know Foo is a class name
public:
Foo* other; // OK, we already know Foo is a class name
};
But here you have a different scenario. Let's say you are
compiling book.cpp. There must be a line in your file that says:
#include "book.h"
Your compiler goes to the file book.h and eventually encounters
this line:
#include "author.h"
Please note that the definition of class Book hasn't been
reached yet.
Now we are in "author.h" and again we include book.h. But now
the content of book.h is skipped due to the BOOK_H define. This
is very important: the definition of class Book gets skipped
and the compiler still doesn't know what Book means!
Now we are back in "author.h" and we are parsing the definition
of class Author.
class Author
{
public:
Book* works[20]; //Ouch! What do you mean by Book?
};
> The classes are declared in their own header files,
> which are reciprocally included in the other... The
> function coding were in separate .cpp files.. What
> am I forgetting?
You are forgetting forward declarations. Here are your
files fixed. I removed the irrelevant "using namespace std;"
directives.
-----author.h----
#ifndef AUTHOR_H
#define AUTHOR_H
#include "book.h"
class Book; //forward declaration
class Author
{
public:
Book* works[20];
};
#endif
---book.h----
#ifndef BOOK_H
#define BOOK_H
#include "author.h"
class Author; //forward declaration
class Book
{
public:
Author* authorP;
};
#endif
Depending on the context, the compiler may actually encounter
some forward declarations _after_ the coresponding class
definition, but don't worry, it's _perfectly_legal_.
If you still don't like the idea of forward declaractions
ending up backward, then you may choose another solution,
one that is used by most code-generating CASE tools. You
can create a separate file in which you put forward
declarations of all classes in your project. You then
include this file from every header in your project, either
before any other include or before any of _your_ includes.
Here is what it would look like:
---library.h---
#ifndef LIBRARY_H
#define LIBRARY_H
class Author;
class Book;
#endif
-----author.h----
#ifndef AUTHOR_H
#define AUTHOR_H
#include "library.h" //forward declarations
#include "book.h"
class Author
{
public:
Book* works[20];
};
#endif
---book.h----
#ifndef BOOK_H
#define BOOK_H
#include "library.h" //forward declarations
#include "author.h"
class Book
{
public:
Author* authorP;
};
#endif
Hope this helps.
Szczepan Holyszewski
ru...@po...
|
|
From: Luigi S. <gi...@li...> - 2001-07-01 05:21:59
|
Hello , I have installed the Cygnus Insight debugger, and tried to debug a simple console mode application (the "hello world"). When I click the debug icon from the Dev C++ IDE (vers. 4) among the other windows (source, console, ...) a "warning" pops up, it says: GDB (title of the window) i386 architecture file may be incompatible with i386:intel target Then when I click on the run icon (in the source window) the program hangs. I've already tried to reinstall the Cygnus Insight debugger and then both the Dev C++ and Cygnus Insight debugger, but this is of no help. Does anybody know what is going on? -- gisan |
|
From: Phil S. <fy...@qw...> - 2001-06-30 23:20:15
|
I want to create two classes that contain pointers to each other, but I
keep getting "Syntax error before *" I know a class can contain a
pointer to itself, but why not to others before it is fully defined?
The classes are declared in their own header files, which are
reciprocally included in the other... The function coding were in
separate .cpp files.. What am I forgetting?
-----author.h---- The stripped down versions..
#ifndef AUTHOR_H
#define AUTHOR_H
#include "book.h"
using namespace std;
class Author
{
public:
Book* works[20];
};
#endif
---book.h----
#ifndef BOOK_H
#define BOOK_H
#include "author.h"
using namespace std;
class Book
{
public:
Author* authorP;
};
#endif
--
Fy...@qw...
|
|
From: Ioannis V. <no...@ya...> - 2001-06-29 12:27:40
|
Hint: You will use strstr() and strcpy()... Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jeethu Rao Sent: Friday, June 29, 2001 7:01 AM To: Dev CPP Mailing List Subject: [Dev-C++] Seperating the Filename and folder path from a string Hi, I'm writing a small command line encryption utility. For this, I need to seperate the Folder path and filename from a single string. I vaguely remember that there was a function to do this in the standard C library. Can someone please tell me the name and the header file for that function. Or else i'll have to manually code a function which does this. Thnx, Jeethu Rao _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ya...> - 2001-06-29 12:21:25
|
In C++ as a language you can write assembly directly in style
inline void test()
{
asm(...);
}
I do not know anything about assembly but it has an example at
http://www.research.att.com/~bs/esc99.html
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Jeethu
Rao
Sent: Friday, June 29, 2001 7:01 AM
To: Dev CPP Mailing List
Subject: [Dev-C++] [Dev-C++]: Inline Assembly Code
Hi,
I was wondering how to include assembly level code in C++ files. Can I
do it inline (like in the good old Turbo C) or do I have to create a Lib
in MASM32 or NASM and then Link ?
Thnx in advance,
Jeethu Rao
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Johannes P. <joh...@pr...> - 2001-06-29 07:46:02
|
Lo there ------------ I have had the same problem writing plugins for Sonique and I think it is a Micro$oft thing for I have also tried to compile the DLL with Borland Compilers Like borland C++ 5 (not the Builder) and it still does not work if a Micro$oft product pick the DLL up and opens it.. OK lets be honest if you look at the DLL the function names does look different than what you made it But that realy does not effect the way it is read (considering it is static or not) I have noticed that the Borland Compilers add Debug info entry points to the DLL even if you say exclude that :( Anyways coming back to the Bloodshed DLL. If you compile the DLL the linker will say the following Warning: no export definition file provided dllwrap will create one, but may not be what you want No that says that ya must write a def file for this dll to say where the entry points are If I amm correct.. But hey that is geussing.. Anyways when creating a DLL project the example given there is kinda good and okay.. Well that is enough blabing.. I hope some of this may help in a way to solve the problem for I dont know a answer for this yet.. have tried a lot of stuff but no answer yet.. Good Luck Johannes PS : Sorry I am sending to your private but the list does not accept all my mail meaning you will never see this.. At 00:07 29/06/2001 -0700, you wrote: >I tried Bloodshed Dev-C++ v4 and v4.01, neither was able to compile a DLL >that works. I am using Visual Basic to test my DLLs, so all I have to do is >be able to export functions for it to see. It always gives me the error that >it does not know the entry point to my DLL. I do have an entry point, and >the same code compiles and makes a working dll with Visual C++. Please tell >me what I might be doing wrong. (Or if anyone can, please include sample >code of a working DLL that does anything simple even. A function that >returns a number is simple enough.) Thank You. > >-James Alton > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: James A. <ja...@ol...> - 2001-06-29 07:05:41
|
I tried Bloodshed Dev-C++ v4 and v4.01, neither was able to compile a DLL that works. I am using Visual Basic to test my DLLs, so all I have to do is be able to export functions for it to see. It always gives me the error that it does not know the entry point to my DLL. I do have an entry point, and the same code compiles and makes a working dll with Visual C++. Please tell me what I might be doing wrong. (Or if anyone can, please include sample code of a working DLL that does anything simple even. A function that returns a number is simple enough.) Thank You. -James Alton |
|
From: <Red...@se...> - 2001-06-29 06:28:19
|
hi,
i have two qestions:
1) Support Devc++ function strftime()?
2) How i make Submenu in this form:
File Show Tools etc...
Open
Save
Send to > Notepad
Exit Mail client
...
Sorry, my english is not perfect. If this letter contains errors, debug=
. ;)
Thanks
Ian (Redge is not my real name)
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Take se nezeptali na Vas nazor? Stante se clenem OnlinePanelu
a Vase nazory budou slyset. http://www.onlinepanel.cz
|
|
From: Jeethu R. <je...@sa...> - 2001-06-29 04:59:59
|
Hi, try the OpenGL tutorial at http://www.gamecoding.co.uk/. They've got a very good OpenGL tutorial, specifically targeting Dev C++. They also have a small zip file in their Download section with the GL and GLUT headers and libs for Dev C++. Hope this helps you. Regards, Jeethu Rao www.jeethurao.com -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Brasier Sent: Wednesday, June 27, 2001 8:51 AM To: dev...@li... Subject: [Dev-C++] DEVC++'s OPENGL.... Hi, I wonder if you can tell me if DEVC++'s OpenGL has glaux libraries?? I am learning from nehe.gamedev.net now and in tutorial 7 they say i need a glaux library so i am going to get devC++ as my compiler but i need to know if it has that... Thanks Steve.B Oh and thanks to johanne and everyone else who helped me with my earlier problems!!! _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |