dev-cpp-users Mailing List for Dev-C++ (Page 61)
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: Lloyd <ll...@cd...> - 2007-05-21 09:48:54
|
Thank you Jonathan for your vary detailed reply. I works now. (I was confused with the concept of call by reference :( ). I was aware of the leak, but just to demonstrate the problem I wrote this program. Thank you very much for your quick reply. Thanks and Regards, Lloyd On Mon, 2007-05-21 at 11:14 +0200, Jonathan Winterflood wrote: > Hi, > > You are missing a level of indirection: > the 'a' you are setting here (a=temp) is a local variable in the > function 'call', so you can access the int that it points to, but not > the pointer that main knows > > The a that main knows is always an uninitialized pointer, and you're > just lucky it's not segfaulting :D > > to change the pointer main knows, you need a pointer or a reference to > that pointer. ie.: > (by pointer) > bool call(int **a) { > static int x; > ++x; > int *temp=new int; > *temp=x; > *a=temp; > cout<<"call->"<<x<<","<<**a<<endl; > return true; > } > and > call(&a); > > or > (by reference) > bool call(int* &a) { // no further changes > > Also, you have a memory leak: you loose the new ints you create > (indeed it's a small leak, but consider this: I was leaking 192bytes > in a loop and in 2 minutes, I ate up all my 2Gb of RAM....) > > Regards, > Jonathan > > On 5/21/07, Lloyd <ll...@cd...> wrote: > Hi , > > This is a small program and its output > > #include<iostream> > using namespace std; > > bool call(int *a) > { > static int x; > ++x; > int *temp=new int; > *temp=x; > a=temp; > cout<<"call->"<<x<<","<<*a<<endl; > return true; > } > > int main() > { > int *a; > for(int i=0;i<10;++i) > { > call(a); > cout<<"val->"<<*a<<endl; > } > return 0; > } > > Outputcall->1,1 > val->0 > call->2,2 > val->0 > call->3,3 > val->0 > ...... > ... > > The output which I wanted is > > Outputcall->1,1 > val->1 > call->2,2 > val->2 > call->3,3 > val->3 > ...... > .... > > The modification of the pointer in the function is reflected > in the > calling function. Would anybody tell me the reason for this > mistake? > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and > take > control of your XML. No limits. Just data. Click to get it > now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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 > > > > -- > <Morpheus> linux, c'est une question de VI ou de MORE ______________________________________ Scanned and protected by Email scanner |
From: Jonathan W. <jon...@gm...> - 2007-05-21 09:36:58
|
You're welcome, If you're still confused by references, consider this: they are the same as pointers, i.e. they reference other data, but C++ hides some of the dangers of pointers with them: you cannot change the pointer that the reference uses, plus they simplify notation where you don't need the extra liberty/functionality. >I was aware of the leak [...] I suspected that :) Regards, Jonathan On 5/21/07, Lloyd <ll...@cd...> wrote: > > Thank you Jonathan for your vary detailed reply. I works now. (I was > confused with the concept of call by reference :( ). I was aware of the > leak, but just to demonstrate the problem I wrote this program. > > Thank you very much for your quick reply. > > Thanks and Regards, > Lloyd > > > > On Mon, 2007-05-21 at 11:14 +0200, Jonathan Winterflood wrote: > > Hi, > > > > You are missing a level of indirection: > > the 'a' you are setting here (a=temp) is a local variable in the > > function 'call', so you can access the int that it points to, but not > > the pointer that main knows > > > > The a that main knows is always an uninitialized pointer, and you're > > just lucky it's not segfaulting :D > > > > to change the pointer main knows, you need a pointer or a reference to > > that pointer. ie.: > > (by pointer) > > bool call(int **a) { > > static int x; > > ++x; > > int *temp=new int; > > *temp=x; > > *a=temp; > > cout<<"call->"<<x<<","<<**a<<endl; > > return true; > > } > > and > > call(&a); > > > > or > > (by reference) > > bool call(int* &a) { // no further changes > > > > Also, you have a memory leak: you loose the new ints you create > > (indeed it's a small leak, but consider this: I was leaking 192bytes > > in a loop and in 2 minutes, I ate up all my 2Gb of RAM....) > > > > Regards, > > Jonathan > > > > On 5/21/07, Lloyd <ll...@cd...> wrote: > > Hi , > > > > This is a small program and its output > > > > #include<iostream> > > using namespace std; > > > > bool call(int *a) > > { > > static int x; > > ++x; > > int *temp=new int; > > *temp=x; > > a=temp; > > cout<<"call->"<<x<<","<<*a<<endl; > > return true; > > } > > > > int main() > > { > > int *a; > > for(int i=0;i<10;++i) > > { > > call(a); > > cout<<"val->"<<*a<<endl; > > } > > return 0; > > } > > > > Outputcall->1,1 > > val->0 > > call->2,2 > > val->0 > > call->3,3 > > val->0 > > ...... > > ... > > > > The output which I wanted is > > > > Outputcall->1,1 > > val->1 > > call->2,2 > > val->2 > > call->3,3 > > val->3 > > ...... > > .... > > > > The modification of the pointer in the function is reflected > > in the > > calling function. Would anybody tell me the reason for this > > mistake? > > > > Thanks and Regards, > > Lloyd > > > > > > > > > > ______________________________________ > > Scanned and protected by Email scanner > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and > > take > > control of your XML. No limits. Just data. Click to get it > > now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > 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 > > > > > > > > -- > > <Morpheus> linux, c'est une question de VI ou de MORE > > > ______________________________________ > Scanned and protected by Email scanner > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Per W. <pw...@ia...> - 2007-05-21 09:14:51
|
The a pointer in the function call() is just a copy of the a pointer in main(). Hence, your allocated pointer will not be transmitted back. You must modify call() to either take a reference to a pointer, or send i a pointer to a pointer. This will give call() the address of the pointer a in main(), so that it knows where to store the pointer value returned from new. /pwm On Mon, 21 May 2007, Lloyd wrote: > Hi , > > This is a small program and its output > > #include<iostream> > using namespace std; > > bool call(int *a) > { > static int x; > ++x; > int *temp=new int; > *temp=x; > a=temp; > cout<<"call->"<<x<<","<<*a<<endl; > return true; > } > > int main() > { > int *a; > for(int i=0;i<10;++i) > { > call(a); > cout<<"val->"<<*a<<endl; > } > return 0; > } > > Outputcall->1,1 > val->0 > call->2,2 > val->0 > call->3,3 > val->0 > ...... > ... > > The output which I wanted is > > Outputcall->1,1 > val->1 > call->2,2 > val->2 > call->3,3 > val->3 > ..... > .... > > The modification of the pointer in the function is reflected in the > calling function. Would anybody tell me the reason for this mistake? > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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: Jonathan W. <jon...@gm...> - 2007-05-21 09:14:06
|
Hi, You are missing a level of indirection: the 'a' you are setting here (a=temp) is a local variable in the function 'call', so you can access the int that it points to, but not the pointer that main knows The a that main knows is always an uninitialized pointer, and you're just lucky it's not segfaulting :D to change the pointer main knows, you need a pointer or a reference to that pointer. ie.: (by pointer) bool call(int **a) { static int x; ++x; int *temp=new int; *temp=x; *a=temp; cout<<"call->"<<x<<","<<**a<<endl; return true; } and call(&a); or (by reference) bool call(int* &a) { // no further changes Also, you have a memory leak: you loose the new ints you create (indeed it's a small leak, but consider this: I was leaking 192bytes in a loop and in 2 minutes, I ate up all my 2Gb of RAM....) Regards, Jonathan On 5/21/07, Lloyd <ll...@cd...> wrote: > > Hi , > > This is a small program and its output > > #include<iostream> > using namespace std; > > bool call(int *a) > { > static int x; > ++x; > int *temp=new int; > *temp=x; > a=temp; > cout<<"call->"<<x<<","<<*a<<endl; > return true; > } > > int main() > { > int *a; > for(int i=0;i<10;++i) > { > call(a); > cout<<"val->"<<*a<<endl; > } > return 0; > } > > Outputcall->1,1 > val->0 > call->2,2 > val->0 > call->3,3 > val->0 > ...... > ... > > The output which I wanted is > > Outputcall->1,1 > val->1 > call->2,2 > val->2 > call->3,3 > val->3 > ..... > .... > > The modification of the pointer in the function is reflected in the > calling function. Would anybody tell me the reason for this mistake? > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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 > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Lloyd <ll...@cd...> - 2007-05-21 08:55:17
|
Sorry some typing error are occured... please check this mail... On Mon, 2007-05-21 at 14:25 +0530, Lloyd wrote: > Hi , > > This is a small program and its output > > #include<iostream> > using namespace std; > > bool call(int *a) > { > static int x; > ++x; > int *temp=new int; > *temp=x; > a=temp; > cout<<"call->"<<x<<","<<*a<<endl; > return true; > } > > int main() > { > int *a; > for(int i=0;i<10;++i) > { > call(a); > cout<<"val->"<<*a<<endl; > } > return 0; > } > > Output > call->1,1 > val->0 > call->2,2 > val->0 > call->3,3 > val->0 > ....... > .... > > The output which I wanted is > > Output > call->1,1 > val->1 > call->2,2 > val->2 > call->3,3 > val->3 > ...... > ..... > > The modification of the pointer in the function is not reflected in the > calling function. Would anybody tell me the reason for this mistake? > > Thanks and Regards, > Lloyd > > > > > ______________________________________ > Scanned and protected by Email scanner > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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 ______________________________________ Scanned and protected by Email scanner |
From: Lloyd <ll...@cd...> - 2007-05-21 08:48:31
|
Hi , This is a small program and its output #include<iostream> using namespace std; bool call(int *a) { static int x; ++x; int *temp=new int; *temp=x; a=temp; cout<<"call->"<<x<<","<<*a<<endl; return true; } int main() { int *a; for(int i=0;i<10;++i) { call(a); cout<<"val->"<<*a<<endl; } return 0; } Outputcall->1,1 val->0 call->2,2 val->0 call->3,3 val->0 ...... ... The output which I wanted is Outputcall->1,1 val->1 call->2,2 val->2 call->3,3 val->3 ..... .... The modification of the pointer in the function is reflected in the calling function. Would anybody tell me the reason for this mistake? Thanks and Regards, Lloyd ______________________________________ Scanned and protected by Email scanner |
From: Per W. <pw...@ia...> - 2007-05-20 19:11:34
|
NULL is a symbol defined in the standard header files. Hence, any c file that makes use of the NULL symbol needs to include any of the standard headers that will define NULL. /pwm On Sun, 20 May 2007, Jan Mura wrote: > Well, it really works now. Anyway I do not understand it at all, it had > problem only with this NULL and no function from standard headers I use > there. > > But thank you very much. > > Jan Mura . > > ----- Original Message ----- > From: "Per Westermark" <pw...@ia...> > To: "Jan Mura" <jan...@vo...> > Cc: <dev...@li...> > Sent: Sunday, May 20, 2007 7:42 PM > Subject: Re: [Dev-C++] Problems with compiling > > > > It isn't enough to include andy standard header files in one of your c > > files. > > > > All c files that contains references to functions from the standard > > library, or functions from other c files must include the relevant header > > files. > > > > /pwm > > > > On Sun, 20 May 2007, Jan Mura wrote: > > > > > Hello, > > > > > > I would like to ask something about compiling of files under gcc.exe > > > (Dev-Cpp on Win XP). > > > Iam trying to compile two files which should produce one executable > file. > > > One of the file is main.c in which I include all > > > standard headers and header file for main and the other source file. > > > > > > And under console I am trying to do something like: > > > > > > gcc.exe main.c bet_list.c -o ruleta.exe > > > > > > And the output is like: > > > bet_list.c: In function `print_list': > > > bet_list.c:9: error: `NULL' undeclared (first use in this function) > > > bet_list.c:9: error: (Each undeclared identifier is reported only once > > > bet_list.c:9: error: for each function it appears in.) > > > bet_list.c: In function `empty_list': > > > bet_list.c:30: error: `NULL' undeclared (first use in this function) > > > bet_list.c: In function `in_list': > > > bet_list.c:77: error: `NULL' undeclared (first use in this > > > ... > > > and so on for every NULL in bet_list.c > > > > > > If I compile just bet_list.c and I include the main() function in this > file > > > together with including the standard headers, the compilation is without > > > errors. > > > I think the NULL is declared in stdlib.h which I include of course. > > > > > > Thank you for your hints. > > > > > > Jan Mura > > > jan...@vo... > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > _______________________________________________ > > > 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 > > > > > > > > > > > __________ Informace od NOD32 2278 (20070520) __________ > > > > Tato zprava byla proverena antivirovym systemem NOD32. > > http://www.nod32.cz > > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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...> - 2007-05-20 18:37:59
|
Well, it really works now. Anyway I do not understand it at all, it had problem only with this NULL and no function from standard headers I use there. But thank you very much. Jan Mura . ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "Jan Mura" <jan...@vo...> Cc: <dev...@li...> Sent: Sunday, May 20, 2007 7:42 PM Subject: Re: [Dev-C++] Problems with compiling > It isn't enough to include andy standard header files in one of your c > files. > > All c files that contains references to functions from the standard > library, or functions from other c files must include the relevant header > files. > > /pwm > > On Sun, 20 May 2007, Jan Mura wrote: > > > Hello, > > > > I would like to ask something about compiling of files under gcc.exe > > (Dev-Cpp on Win XP). > > Iam trying to compile two files which should produce one executable file. > > One of the file is main.c in which I include all > > standard headers and header file for main and the other source file. > > > > And under console I am trying to do something like: > > > > gcc.exe main.c bet_list.c -o ruleta.exe > > > > And the output is like: > > bet_list.c: In function `print_list': > > bet_list.c:9: error: `NULL' undeclared (first use in this function) > > bet_list.c:9: error: (Each undeclared identifier is reported only once > > bet_list.c:9: error: for each function it appears in.) > > bet_list.c: In function `empty_list': > > bet_list.c:30: error: `NULL' undeclared (first use in this function) > > bet_list.c: In function `in_list': > > bet_list.c:77: error: `NULL' undeclared (first use in this > > ... > > and so on for every NULL in bet_list.c > > > > If I compile just bet_list.c and I include the main() function in this file > > together with including the standard headers, the compilation is without > > errors. > > I think the NULL is declared in stdlib.h which I include of course. > > > > Thank you for your hints. > > > > Jan Mura > > jan...@vo... > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > 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 > > > > > > __________ Informace od NOD32 2278 (20070520) __________ > > Tato zprava byla proverena antivirovym systemem NOD32. > http://www.nod32.cz > > |
From: Per W. <pw...@ia...> - 2007-05-20 17:43:43
|
It isn't enough to include andy standard header files in one of your c files. All c files that contains references to functions from the standard library, or functions from other c files must include the relevant header files. /pwm On Sun, 20 May 2007, Jan Mura wrote: > Hello, > > I would like to ask something about compiling of files under gcc.exe > (Dev-Cpp on Win XP). > Iam trying to compile two files which should produce one executable file. > One of the file is main.c in which I include all > standard headers and header file for main and the other source file. > > And under console I am trying to do something like: > > gcc.exe main.c bet_list.c -o ruleta.exe > > And the output is like: > bet_list.c: In function `print_list': > bet_list.c:9: error: `NULL' undeclared (first use in this function) > bet_list.c:9: error: (Each undeclared identifier is reported only once > bet_list.c:9: error: for each function it appears in.) > bet_list.c: In function `empty_list': > bet_list.c:30: error: `NULL' undeclared (first use in this function) > bet_list.c: In function `in_list': > bet_list.c:77: error: `NULL' undeclared (first use in this > ... > and so on for every NULL in bet_list.c > > If I compile just bet_list.c and I include the main() function in this file > together with including the standard headers, the compilation is without > errors. > I think the NULL is declared in stdlib.h which I include of course. > > Thank you for your hints. > > Jan Mura > jan...@vo... > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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...> - 2007-05-20 14:48:03
|
Hello, I would like to ask something about compiling of files under gcc.exe (Dev-Cpp on Win XP). Iam trying to compile two files which should produce one executable file. One of the file is main.c in which I include all standard headers and header file for main and the other source file. And under console I am trying to do something like: gcc.exe main.c bet_list.c -o ruleta.exe And the output is like: bet_list.c: In function `print_list': bet_list.c:9: error: `NULL' undeclared (first use in this function) bet_list.c:9: error: (Each undeclared identifier is reported only once bet_list.c:9: error: for each function it appears in.) bet_list.c: In function `empty_list': bet_list.c:30: error: `NULL' undeclared (first use in this function) bet_list.c: In function `in_list': bet_list.c:77: error: `NULL' undeclared (first use in this ... and so on for every NULL in bet_list.c If I compile just bet_list.c and I include the main() function in this file together with including the standard headers, the compilation is without errors. I think the NULL is declared in stdlib.h which I include of course. Thank you for your hints. Jan Mura jan...@vo... |
From: Jonathan W. <jon...@gm...> - 2007-05-20 13:14:37
|
Hi, Did you use the Dev-Cpp + mingw package or only Dev-Cpp? Mingw (Minimal Gnu for Windows) contains the compiler, make, etc. Dev-Cpp is just the IDE. Jonathan On 5/18/07, Andrea Bencini <and...@ti...> wrote: > > I download and install "Dev-C++ 4.9.9.2" > When I start Dev-C++" I receive the following message: > > "There doesn't seem to be GNU Make file in PATH or in Dev-C++'s Bin path. > Plese make sure that you have GNU Make and adjust Bin setting or sytem > PATH > environment variable and that make setting in Compilre Option contains > correct filename, otherwise you will not be able to compile anything." > > I add in the system PATH environment the "C:\Dev-Cpp\Bin"; the complite > path > is: > > "C:\Programmi\OpenVPN\bin;C:\Programmi\SSH Communications Security\SSH > Secure Shell;C:\Dev-Cpp\Bin" > > but I receive again the above message. > > Can you help me? > thank > Andrea > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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 > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Andrea B. <and...@ti...> - 2007-05-18 17:19:03
|
I download and install "Dev-C++ 4.9.9.2" When I start Dev-C++" I receive the following message: "There doesn't seem to be GNU Make file in PATH or in Dev-C++'s Bin path. Plese make sure that you have GNU Make and adjust Bin setting or sytem PATH environment variable and that make setting in Compilre Option contains correct filename, otherwise you will not be able to compile anything." I add in the system PATH environment the "C:\Dev-Cpp\Bin"; the complite path is: "C:\Programmi\OpenVPN\bin;C:\Programmi\SSH Communications Security\SSH Secure Shell;C:\Dev-Cpp\Bin" but I receive again the above message. Can you help me? thank Andrea |
From: Lloyd <ll...@cd...> - 2007-05-16 14:43:45
|
Hi, I want to overload the new operator. My requirement is to print a message and use the global operator new from the overloaded new "function". I am using the global new in my program I just want it to use my overloaded new by just including a namespace... This is the way I am trying to implement it... but compiler gives me the errors... How can I do this? The code:- #include<iostream> using namespace std; namespace x { void* operator new(size_t); } void* x::operator new(size_t x) { cout<<"hai"<<endl; //how to use global new instead of malloc? return malloc(x); } using namespace x; int main() { int *a=new int(1); return 0; } This is the error:- operator.cpp:20: error: call of overloaded `operator new(unsigned int)' is ambiguous /usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c+ +/3.4.3/new:82: note: candidates are: void* operator new(size_t) operator.cpp:10: note: void* x::operator new(size_t) Thanks and Regards, Lloyd Awaiting for your help :) ______________________________________ Scanned and protected by Email scanner |
From: Joe F. <fl...@so...> - 2007-05-16 12:25:17
|
Help please. I've installed "Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2" and MSYS-1.0.10.exe and pointed MSYS' mingw directory pointer to c:/Dev-Cpp. Now, I'm trying to build "rxspencer-alpha3.8.g3.tar.gz" from http://arglist.com/regex/rxspencer-alpha3.8.g3.tar.gz, but it fails on "make" with: gcc -Wl,--base-file,.libs/librxspencer-0.dll-base -Wl,-e,_DllMainCRTStartup@12 -o .libs/librxspencer-0.dll regcomp.lo regerror.lo regexec.lo regfree.lo c:\dev-cpp\bin\..\lib\gcc\mingw32\4.1.2\..\..\..\..\mingw32\bin\ld.exe: warning: cannot find entry symbol _DllMainCRTStartup@12; defaulting to 00401000 c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16' collect2: ld returned 1 exit status make[1]: *** [librxspencer.la] Error 1 make[1]: Leaving directory `/home/Joe/rxspencer-alpha3.8.g3' make: *** [all] Error 2 Any ideas how to fix this? Sorry for the noob question. Joe P.S. The entire configure, make MSYS output is below. ----------------------------------------------------------------------------------------------------------------------- Joe@CUSTOM ~/rxspencer-alpha3.8.g3 $ ./configure checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets ${MAKE}... yes checking build system type... i686-pc-mingw32 checking host system type... i686-pc-mingw32 checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.exe checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... .exe checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... none checking for ld used by GCC... c:/dev-cpp/mingw32/bin/ld.exe checking if the linker (c:/dev-cpp/mingw32/bin/ld.exe) is GNU ld... yes checking for c:/dev-cpp/mingw32/bin/ld.exe option to reload object files... -r checking for BSD-compatible nm... /mingw/bin/nm checking whether ln -s works... yes checking how to recognise dependant libraries... file_magic file format pei*-i386(.*architecture: i386)? checking command to parse /mingw/bin/nm output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... no checking dlfcn.h presence... no checking for dlfcn.h... no checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -DDLL_EXPORT checking if gcc PIC flag -DDLL_EXPORT works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (c:/dev-cpp/mingw32/bin/ld.exe) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... Win32 ld.exe checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes creating libtool configure: creating ./config.status config.status: creating Makefile config.status: executing depfiles commands Joe@CUSTOM ~/rxspencer-alpha3.8.g3 $ make make all-am make[1]: Entering directory `/home/Joe/rxspencer-alpha3.8.g3' /bin/sh ./libtool --mode=link gcc -g -O2 -o librxspencer.la -rpath /usr/local/lib -version-info 0:2:0 -no-undefined -module regcomp.lo regerror.lo regexec.lo regfree.lo rm -fr .libs/librxspencer.la .libs/librxspencer.* .libs/librxspencer.* generating symbol list for `librxspencer.la' dlltool --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 --output-def .libs/librxspencer-0.dll-def regcomp.lo regerror.lo regexec.lo regfree.lo sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < .libs/librxspencer-0.dll-def > .libs/librxspencer.exp if test "x`head -1 .libs/librxspencer.exp`" = xEXPORTS; then cp .libs/librxspencer.exp .libs/librxspencer-0.dll-def; else echo EXPORTS > .libs/librxspencer-0.dll-def; _lt_hint=1; cat .libs/librxspencer.exp | while read symbol; do set dummy $symbol; case $# in 2) echo " $2 @ $_lt_hint ; " >> .libs/librxspencer-0.dll-def;; *) echo " $2 @ $_lt_hint $3 ; " >> .libs/librxspencer-0.dll-def;; esac; _lt_hint=`expr 1 + $_lt_hint`; done; fi gcc -Wl,--base-file,.libs/librxspencer-0.dll-base -Wl,-e,_DllMainCRTStartup@12 -o .libs/librxspencer-0.dll regcomp.lo regerror.lo regexec.lo regfree.lo c:\dev-cpp\bin\..\lib\gcc\mingw32\4.1.2\..\..\..\..\mingw32\bin\ld.exe: warning: cannot find entry symbol _DllMainCRTStartup@12; defaulting to 00401000 c:/dev-cpp/bin/../lib/gcc/mingw32/4.1.2/../../../libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16' collect2: ld returned 1 exit status make[1]: *** [librxspencer.la] Error 1 make[1]: Leaving directory `/home/Joe/rxspencer-alpha3.8.g3' make: *** [all] Error 2 Joe@CUSTOM ~/rxspencer-alpha3.8.g3 $ ----------------------------------------------------------------------------------------------------------------------- |
From: seb_kramm <seb...@ya...> - 2007-05-14 15:53:16
|
Frank Morgan a écrit : > I was interested in downloading the Glibc Manual from a link at > http://www.bloodshed.net/dev/doc/index.html , but when I went to > download it, I got a message stating, "The requested URL > /manual/glibc-2.2.3/html_chapter/libc_toc.html was not found on this > server." > > Is this manual available elsewhere for download? If so, where and how > can I find it? Ever heard of something named Google ? ;-)))))) http://www.google.com/search?q=glibc First hit... |
From: Jonathan W. <jon...@gm...> - 2007-05-13 07:26:25
|
It seems to be a linker error Do you have a 'main' in your source? Are you sure you define all he functions you declare? Jonathan On 5/12/07, Mux0x55 <mu...@gm...> wrote: > > Jonathan Winterflood ha scritto: > > That's a _bit_ better > > I guess you're trying to compile a Project. am I right? > > Is it a C++ or C project? > Is it a window application, console application, static library, DLL or an > empty project? (as named in the New Project wizard) > > Is there any source in the project? > Are you trying to use any special libraries? > Do you have the latest version of Dev-c++? (4.9.9.2) > > Jonathan > > On 5/12/07, Mux0x55 <mu...@gm...> wrote: > > > > [buil error] [Pro1.exe] error 1; that's all. > > Can You Help me? > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > 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 > > > > > > -- > <Morpheus> linux, c'est une question de VI ou de MORE > > I've the lastest version of Dev-c++... I'm trying to compile a project. > There 6 source files. I'm try to compile a console application. All sources > are written in C. So It's a C project. > Thank You > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Per W. <pw...@ia...> - 2007-05-13 01:17:21
|
Without looking around for it - have you looked at the MinGW site? Dev-C++ is not a compiler, just an IDE. The actual compiler (and libraries) are available the MinGW site. Some of the libraries anre standard GNU libraries, i.e. information is also available from the gnu site. Some of the libraries are on the other hand M$-based, and information can be found on the Microsoft MSDN site. /pwm On Sat, 12 May 2007, Frank Morgan wrote: > I was interested in downloading the Glibc Manual from a link at > http://www.bloodshed.net/dev/doc/index.html , but when I went to > download it, I got a message stating, "The requested URL > /manual/glibc-2.2.3/html_chapter/libc_toc.html was not found on this > server." > > Is this manual available elsewhere for download? If so, where and how > can I find it? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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: Oladipo O. <gen...@ya...> - 2007-05-12 22:35:57
|
to the guy who had the problem with bool (Mux0x0): my guess is your library probably is old (i'm not sure if Standard C-99 has the bool data type), and maybe contains a line like this: enum bool { false = 0, true }; and it conflicts with the builtin bool datatype. you might get away with renaming your source files so they have the extension '.c' (lowercase) if you have access to the library sources. to Jan: i guess you're implementing a linked list. in that case, you'd want to allocate each item separately, and then queue them like this: struct list * item_first = malloc(sizeof(struct list)); struct list * item_next = malloc(sizeof(struct list)); item_first->next = item_next; that way, you'll have clean pointers to all your allocated objects, instead of having to do something like this: item_first->next->next = malloc(sizeof(struct list)); or so i think, anyway. and you'll need to deallocate each struct separately, so i think my method is better (if you don't have another pointer to the allocated data, you might end up with memory leaks). --------------------------------- Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your freeaccount today. |
From: Frank M. <ent...@gm...> - 2007-05-12 21:11:18
|
I was interested in downloading the Glibc Manual from a link at http://www.bloodshed.net/dev/doc/index.html , but when I went to download it, I got a message stating, "The requested URL /manual/glibc-2.2.3/html_chapter/libc_toc.html was not found on this server." Is this manual available elsewhere for download? If so, where and how can I find it? |
From: Mux0x55 <mu...@gm...> - 2007-05-12 19:01:44
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Jonathan Winterflood ha scritto: <blockquote cite="mid:c4d...@ma..." type="cite">That's a _bit_ better<br> <br> I guess you're trying to compile a Project. am I right?<br> <br> Is it a C++ or C project?<br> Is it a window application, console application, static library, DLL or an empty project? (as named in the New Project wizard) <br> <br> Is there any source in the project?<br> Are you trying to use any special libraries?<br> Do you have the latest version of Dev-c++? (<a moz-do-not-send="true" href="http://4.9.9.2">4.9.9.2</a>)<br> <br> Jonathan<br> <br> <div><span class="gmail_quote">On 5/12/07, <b class="gmail_sendername">Mux0x55</b> <<a moz-do-not-send="true" href="mailto:mu...@gm...">mu...@gm...</a>> wrote:</span> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">[buil error] [Pro1.exe] error 1; that's all.<br> Can You Help me?<br> <br> -------------------------------------------------------------------------<br> This SF.net email is sponsored by DB2 Express<br> Download DB2 Express C - the FREE version of DB2 express and take <br> control of your XML. No limits. Just data. Click to get it now.<br> <a moz-do-not-send="true" href="http://sourceforge.net/powerbar/db2/">http://sourceforge.net/powerbar/db2/</a><br> _______________________________________________<br> Dev-cpp-users mailing list <br> <a moz-do-not-send="true" href="mailto:Dev...@li...">Dev...@li...</a><br> TO UNSUBSCRIBE: <a moz-do-not-send="true" href="http://www23.brinkster.com/noicys/devcpp/ub.htm">http://www23.brinkster.com/noicys/devcpp/ub.htm </a><br> <a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https://lists.sourceforge.net/lists/listinfo/dev-cpp-users</a><br> </blockquote> </div> <br> <br clear="all"> <br> -- <br> <Morpheus> linux, c'est une question de VI ou de MORE </blockquote> I've the lastest version of Dev-c++... I'm trying to compile a project. There 6 source files. I'm try to compile a console application. All sources are written in C. So It's a C project.<br> Thank You<br> </body> </html> |
From: Jonathan W. <jon...@gm...> - 2007-05-12 09:23:05
|
That's a _bit_ better I guess you're trying to compile a Project. am I right? Is it a C++ or C project? Is it a window application, console application, static library, DLL or an empty project? (as named in the New Project wizard) Is there any source in the project? Are you trying to use any special libraries? Do you have the latest version of Dev-c++? (4.9.9.2) Jonathan On 5/12/07, Mux0x55 <mu...@gm...> wrote: > > [buil error] [Pro1.exe] error 1; that's all. > Can You Help me? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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 > -- <Morpheus> linux, c'est une question de VI ou de MORE |
From: Philip B. <phi...@pb...> - 2007-05-12 09:14:04
|
Hi everyone, I am wondering if anyone has a list of the pragma comments that MinGw = supports. For example with Visual C++ you can include a library in the = code itself, you don't need to go to project options and so on to do it. Is there an = equivalent in MinGw? Thanks in advance. Regards Philip Bennefall |
From: Mux0x55 <mu...@gm...> - 2007-05-11 22:30:35
|
[buil error] [Pro1.exe] error 1; that's all. Can You Help me? |
From: Jonathan W. <jon...@gm...> - 2007-05-11 22:21:09
|
You'll have to be rather more precise than that.... What is giving you Error 1? What were you trying to do? Jonathan On 5/12/07, Mux0x55 <mu...@gm...> wrote: > > Error 1: Can You help me? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > 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: Mux0x55 <mu...@gm...> - 2007-05-11 22:17:39
|
Error 1: Can You help me? |