dev-cpp-users Mailing List for Dev-C++ (Page 314)
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: Shay S. <swt...@ho...> - 2003-09-26 19:54:53
|
<html><div style='background-color:'><DIV> <DIV> <DIV><FONT size=2>Hi..</FONT></DIV> <DIV><FONT size=2>i just downloaded one of the versions of your compiler (dev - C++ 5 beta 8 4.9.8.0) and i went to start writing a program and it is saying that it cant compile my prorgram. so i was wondering if there was any information that you could email me back, with telling me how i can get it to compile, or is it just the compiler software that is causing this problem. Please email me back with any possible information. </FONT></DIV> <DIV><FONT size=2> Sincerely,</FONT></DIV> <DIV><FONT size=2> Shay</FONT></DIV></DIV></DIV></div><br clear=all><hr> <a href="http://g.msn.com/8HMAENUS/2740??PS=">Instant message during games with MSN Messenger 6.0. Download it now FREE! </a> </html> |
|
From: Matthews <dem...@uw...> - 2003-09-26 11:53:14
|
I would do that, but currently my email is accessible only through a
computer with no working disk drive/cd drive, etc. My coding is on another
computer, therefore you see the problem :D This should be fixed soon,
though, as I'm going to be getting a new computer within the next few days.
At 08:51 AM 25/09/2003 +0200, Per Westermark wrote:
>Nice to ear.
>
>One thing. Since source code is so very unforgiving about even the
>smallest spelling errors it is always a good idea to cut and paste any
>source code in the mails.
>
>/Per W
>
>On Wed, 24 Sep 2003, Matthews wrote:
>
>> Thanks a lot Per. It's working perfectly now. And the
>> > info.input = (char*)malloc(...);
>> was a mistype by me in the email, which is why I got no errors :p
>>
>> At 11:19 PM 21/09/2003 +0200, Per Westermark wrote:
>> >prj_info.input is a pointer to a pointer to char.
>> >
>> >If you want to store 10 lines in it:
>> >
>> >info.input = (char**)malloc(10*sizeof(char*));
>> >info.input[0] = (char*)malloc(sizeof(char)*(strlen("mystr1")+1));
>> >...
>> >info.input[9] = (char*)malloc(sizeof(char)*(strlen("mystr10")+1));
>> >
>> >strcpy(info.input[0],"mystr1");
>> >...
>> >strcpy(info.input[9],"mystr10");
>> >
>> >Question: Don't you ever try to get the compiler to generate as many
>> >warnings as possible, and then check up on the warnings?
>> >
>> >The compiler would definitely become a bit worried when you do:
>> > info.input = (char*)malloc(...);
>> >since you are typecasting to the wrong type.
>> >
>> >Take two steps back and think a bit about your code and what you want to
>> >do. Check up on all data types, and exactly what you allocate.
>> >
>> >That little realloc() line you have is very, very interesting. You are
>> >reallocating the wrong thing - did you intend to reallocate the array
>> >of pointers to text strings, or a specific string buffer in the array?
>> >- and you are forgetting that the new pointer is the RETURN VALUE of the
>> >realloc() call.
>> >
>> >/Per W
>> >
>> >On Sat, 20 Sep 2003, Matthews wrote:
>> >
>> >> Still giving me the same crash :\
>> >>
>> >> At 11:32 AM 20/09/2003 +0200, Per Westermark wrote:
>> >> >When you allocate buffers for strings, you must allocate room for
>> >> >strlen(str)+1
>> >> >characters, or the termination character '\0' will not fit.
>> >> >
>> >> >/Per W
>> >> >
>> >> >On Fri, 19 Sep 2003, Matthews wrote:
>> >> >
>> >> >> I'm working on a program to generate makefiles for me, and I
>> currently have
>> >> >> it set up to read different sections of a file to generate the
options.
>> >> >> One section is %input, which has a list of filenames to include, eg.
>> >> >>
>> >> >> prj.txt
>> >> >>
>> >> >> %input
>> >> >> main.c
>> >> >> vid.c
>> >> >> gui.c
>> >> >>
>> >> >> I read these into a struct organized like so:
>> >> >>
>> >> >> struct prj_info
>> >> >> {
>> >> >> ...
>> >> >> char **input;
>> >> >> ...
>> >> >> }
>> >> >>
>> >> >> And I allocate space based on how many files there are (an array of
>> >> >> strings, basically)
>> >> >>
>> >> >> My problem is that I get errors when running the following C code:
>> >> >>
>> >> >> if(!strncmp("%include",t,strlen(t)-1))
>> >> >> {
>> >> >> count = 0;
>> >> >> skip_line(buf);
>> >> >> getword(buf,t);
>> >> >> longest_length = strlen(t);
>> >> >> info.input = (char *)malloc((sizeof(char)*longest_len)*1);
>> >> >> if(!info.input)
>> >> >> {
>> >> >> printf("OH NOS\n");
>> >> >> return 0;
>> >> >> }
>> >> >> //CRASH HERE
>> >> >> strcpy(info.input[count],t);
>> >> >> while(*buf!='%')
>> >> >> {
>> >> >> while(*buf=='#'||isspace(*buf)) skip_line(buf);
>> >> >> getword(buf,t);
>> >> >> if(strlen(t)>longest_length) longest_length = strlen(t);
>> >> >> count++;
>> >> >> realloc(info.input,(sizeof(char)*longest_length)*count);
>> >> >> if(!info.input)
>> >> >> {
>> >> >> printf("ERR0RZ\n");
>> >> >> return 0;
>> >> >> }
>> >> >> strcpy(info.input[count],t);
>> >> >> skip_line(buf);
>> >> >> }
>> >> >> }
>> >> >>
>> >> >> Buf is the dumped contents of a file (like prj.txt), getword()
places a
>> >> >> word from buf into t and skip_line() skips to the next line in buf.
>> >> >>
>> >> >> The code compiles fine, but crashes at the first strcpy(). Any help
>> would
>> >> >> be appreciated.
>> >> >>
>> >> >>
>> >> >> -------------------------------------------------------
>> >> >> This sf.net email is sponsored by:ThinkGeek
>> >> >> Welcome to geek heaven.
>> >> >> http://thinkgeek.com/sf
>> >> >> _______________________________________________
>> >> >> Dev-cpp-users mailing list
>> >> >> Dev...@li...
>> >> >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> >> >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >> -------------------------------------------------------
>> >> This sf.net email is sponsored by:ThinkGeek
>> >> Welcome to geek heaven.
>> >> http://thinkgeek.com/sf
>> >> _______________________________________________
>> >> Dev-cpp-users mailing list
>> >> Dev...@li...
>> >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>> >>
>> >
>> >
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> 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: Vlada D. <dj...@im...> - 2003-09-26 06:28:47
|
I think you should try comp.os.ms-windows.programmer.win32 ----- Original Message ----- From: "Frank Wagner" <F.W...@wi...> To: <dev...@li...> Sent: Thursday, September 25, 2003 3:38 PM Subject: [Dev-C++] The Right Newsgroup Hello, I use DEV-C++ to write programs in C++ with Cygwin and MinGW under Windows. Does somebody know a proper Newsgroup that best fit my needs? Thanks in advance Frank ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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: Mark S. <mar...@li...> - 2003-09-25 13:43:49
|
Problem sorted sorry for the posting, a search gave me http://www.yeohhs.com/shareware/winbgi_DevCpp.zip Yeoh's solution Regards Mark --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 The information contained in this e-mail message (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an addressee, any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited. If you have received this communication in error, please contact us immediately so that we can correct the error. |
|
From: Frank W. <F.W...@wi...> - 2003-09-25 13:40:11
|
Hello, I use DEV-C++ to write programs in C++ with Cygwin and MinGW under Windows. Does somebody know a proper Newsgroup that best fit my needs? Thanks in advance Frank |
|
From: Mark S. <mar...@li...> - 2003-09-25 13:10:44
|
can anyone give any tips on how to compile the bgidemo downloadable from http://www.ispras.ru/~knizhnik/winbgi.zip using devc++ 4.9.8.1 I seem to get a lot of linker errors (below are just the beginning) Compiler: Default compiler Building Makefile: "C:\lcc\projects\winbgi\Makefile.win" Executing make clean rm -f bgidemo.o bgidemo2.exe g++.exe -c bgidemo.c -o bgidemo.o -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" bgidemo.c: In function `void LineToDemo()': bgidemo.c:900: warning: assignment to `int' from `double' bgidemo.c:900: warning: argument to `int' from `double' g++.exe bgidemo.o -o "bgidemo2.exe" -L"C:/Dev-Cpp/lib" -s winbgi.lib winbgi.lib(winbgi.obj.b)(.text+0x2c):winbgi.cpp: undefined reference to `??2@YAPAXI@Z' winbgi.lib(winbgi.obj.b)(.text+0x57):winbgi.cpp: undefined reference to `??3@YAXPAX@Z' winbgi.lib(winbgi.obj.b)(.text+0x14b):winbgi.cpp: undefined reference to `_imp__SetTextColor@8' winbgi.lib(winbgi.obj.b)(.text+0x204):winbgi.cpp: undefined reference to `_imp__GetCurrentPositionEx@8' winbgi.lib(winbgi.obj.b)(.text+0x234):winbgi.cpp: undefined reference to `_imp__GetCurrentPositionEx@8' winbgi.lib(winbgi.obj.b)(.text+0x302):winbgi.cpp: undefined reference to `_imp__SetPaletteEntries@16' winbgi.lib(winbgi.obj.b)(.text+0x30f):winbgi.cpp: undefined reference to `_imp__RealizePalette@4' winbgi.lib(winbgi.obj.b)(.text+0x370):winbgi.cpp: undefined reference to `_imp__SetPaletteEntries@16' winbgi.lib(winbgi.obj.b)(.text+0x37d):winbgi.cpp: undefined reference to `_imp__RealizePalette@4' Thanks in advance Mark --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 The information contained in this e-mail message (and any attachment transmitted herewith) is privileged and confidential and is intended for the exclusive use of the addressee(s). If you are not an addressee, any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited. If you have received this communication in error, please contact us immediately so that we can correct the error. |
|
From: Roger C. <rc...@ic...> - 2003-09-25 10:30:11
|
Dear friends, I wrote the program bellow. It opens a file, records 1 to 5 some times into a file and close it. Then it opens the same file again, reads its contents and close it. First, I defined count from 1 to 5 (hex) getting correct results. (See attached file: GeraOk.cpp) Then, I defined count from 9 to d (hex) getting wrong results. (See attached file: GeraOk.cpp) I do not understand the reason. Could someone explain it and give a solution. Also, I could not get rid of the warning message. Which is the include file that should be used in order to do not use a deprecated header? Thanks for your help Roger --- Some files have not been scanned Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.505 / Virus Database: 302 - Release Date: 30/7/2003 |
|
From: Ivan S. P. M. <iv...@if...> - 2003-09-25 08:31:38
|
Hi all. I'm using the last version of dev, and I am having problems with compilat= ion of=20 one file of a program. The problem is, that when I try to compile all the= files,=20 i got the error 19 E:\Ivan\Inicia=E7=E3o\For Marconi\safe ProgC++ 2.5 (3D 1.1)\Matrix.cp= p:3 fstream: No such file or directory. but the library is declared correctly, and also works in different files = in the=20 program.=20 #include "Matrix.h" #include <fstream> I've tried to put in the antiquade form, like fstream.h, but doesn't work= =20 either. What can it be? Thanks in advance. Ivan S>P<M Grupo de Vis=E3o Cibern=E9tica - IFSC - USP - Brasil ------------------------------------------------- Mensagem enviada atrav=E9s do WebMail IFSC: ultra3000.if.sc.usp.br ~ |
|
From: Per W. <pw...@ia...> - 2003-09-25 06:53:03
|
Nice to ear.
One thing. Since source code is so very unforgiving about even the
smallest spelling errors it is always a good idea to cut and paste any
source code in the mails.
/Per W
On Wed, 24 Sep 2003, Matthews wrote:
> Thanks a lot Per. It's working perfectly now. And the
> > info.input = (char*)malloc(...);
> was a mistype by me in the email, which is why I got no errors :p
>
> At 11:19 PM 21/09/2003 +0200, Per Westermark wrote:
> >prj_info.input is a pointer to a pointer to char.
> >
> >If you want to store 10 lines in it:
> >
> >info.input = (char**)malloc(10*sizeof(char*));
> >info.input[0] = (char*)malloc(sizeof(char)*(strlen("mystr1")+1));
> >...
> >info.input[9] = (char*)malloc(sizeof(char)*(strlen("mystr10")+1));
> >
> >strcpy(info.input[0],"mystr1");
> >...
> >strcpy(info.input[9],"mystr10");
> >
> >Question: Don't you ever try to get the compiler to generate as many
> >warnings as possible, and then check up on the warnings?
> >
> >The compiler would definitely become a bit worried when you do:
> > info.input = (char*)malloc(...);
> >since you are typecasting to the wrong type.
> >
> >Take two steps back and think a bit about your code and what you want to
> >do. Check up on all data types, and exactly what you allocate.
> >
> >That little realloc() line you have is very, very interesting. You are
> >reallocating the wrong thing - did you intend to reallocate the array
> >of pointers to text strings, or a specific string buffer in the array?
> >- and you are forgetting that the new pointer is the RETURN VALUE of the
> >realloc() call.
> >
> >/Per W
> >
> >On Sat, 20 Sep 2003, Matthews wrote:
> >
> >> Still giving me the same crash :\
> >>
> >> At 11:32 AM 20/09/2003 +0200, Per Westermark wrote:
> >> >When you allocate buffers for strings, you must allocate room for
> >> >strlen(str)+1
> >> >characters, or the termination character '\0' will not fit.
> >> >
> >> >/Per W
> >> >
> >> >On Fri, 19 Sep 2003, Matthews wrote:
> >> >
> >> >> I'm working on a program to generate makefiles for me, and I
> currently have
> >> >> it set up to read different sections of a file to generate the options.
> >> >> One section is %input, which has a list of filenames to include, eg.
> >> >>
> >> >> prj.txt
> >> >>
> >> >> %input
> >> >> main.c
> >> >> vid.c
> >> >> gui.c
> >> >>
> >> >> I read these into a struct organized like so:
> >> >>
> >> >> struct prj_info
> >> >> {
> >> >> ...
> >> >> char **input;
> >> >> ...
> >> >> }
> >> >>
> >> >> And I allocate space based on how many files there are (an array of
> >> >> strings, basically)
> >> >>
> >> >> My problem is that I get errors when running the following C code:
> >> >>
> >> >> if(!strncmp("%include",t,strlen(t)-1))
> >> >> {
> >> >> count = 0;
> >> >> skip_line(buf);
> >> >> getword(buf,t);
> >> >> longest_length = strlen(t);
> >> >> info.input = (char *)malloc((sizeof(char)*longest_len)*1);
> >> >> if(!info.input)
> >> >> {
> >> >> printf("OH NOS\n");
> >> >> return 0;
> >> >> }
> >> >> //CRASH HERE
> >> >> strcpy(info.input[count],t);
> >> >> while(*buf!='%')
> >> >> {
> >> >> while(*buf=='#'||isspace(*buf)) skip_line(buf);
> >> >> getword(buf,t);
> >> >> if(strlen(t)>longest_length) longest_length = strlen(t);
> >> >> count++;
> >> >> realloc(info.input,(sizeof(char)*longest_length)*count);
> >> >> if(!info.input)
> >> >> {
> >> >> printf("ERR0RZ\n");
> >> >> return 0;
> >> >> }
> >> >> strcpy(info.input[count],t);
> >> >> skip_line(buf);
> >> >> }
> >> >> }
> >> >>
> >> >> Buf is the dumped contents of a file (like prj.txt), getword() places a
> >> >> word from buf into t and skip_line() skips to the next line in buf.
> >> >>
> >> >> The code compiles fine, but crashes at the first strcpy(). Any help
> would
> >> >> be appreciated.
> >> >>
> >> >>
> >> >> -------------------------------------------------------
> >> >> This sf.net email is sponsored by:ThinkGeek
> >> >> Welcome to geek heaven.
> >> >> http://thinkgeek.com/sf
> >> >> _______________________________________________
> >> >> Dev-cpp-users mailing list
> >> >> Dev...@li...
> >> >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> >> >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >> >>
> >> >
> >> >
> >>
> >>
> >> -------------------------------------------------------
> >> This sf.net email is sponsored by:ThinkGeek
> >> Welcome to geek heaven.
> >> http://thinkgeek.com/sf
> >> _______________________________________________
> >> Dev-cpp-users mailing list
> >> Dev...@li...
> >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >>
> >
> >
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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: Jirka P. <gp...@ce...> - 2003-09-25 01:33:07
|
Hello =20 When I compile my DLL project it says that export definition file not found, how do I make on and How to say to the linker where that file is? =20 Thank You =20 George =20 -------------------- MMS telefon SonyEricsson T610 ji=BE od 5577 K=E8. http://user.centrum.c= z/redir.php?url=3Dhttp://www.oskar.cz |
|
From: Matthews <dem...@uw...> - 2003-09-24 22:22:58
|
Thanks a lot Per. It's working perfectly now. And the
> info.input = (char*)malloc(...);
was a mistype by me in the email, which is why I got no errors :p
At 11:19 PM 21/09/2003 +0200, Per Westermark wrote:
>prj_info.input is a pointer to a pointer to char.
>
>If you want to store 10 lines in it:
>
>info.input = (char**)malloc(10*sizeof(char*));
>info.input[0] = (char*)malloc(sizeof(char)*(strlen("mystr1")+1));
>...
>info.input[9] = (char*)malloc(sizeof(char)*(strlen("mystr10")+1));
>
>strcpy(info.input[0],"mystr1");
>...
>strcpy(info.input[9],"mystr10");
>
>Question: Don't you ever try to get the compiler to generate as many
>warnings as possible, and then check up on the warnings?
>
>The compiler would definitely become a bit worried when you do:
> info.input = (char*)malloc(...);
>since you are typecasting to the wrong type.
>
>Take two steps back and think a bit about your code and what you want to
>do. Check up on all data types, and exactly what you allocate.
>
>That little realloc() line you have is very, very interesting. You are
>reallocating the wrong thing - did you intend to reallocate the array
>of pointers to text strings, or a specific string buffer in the array?
>- and you are forgetting that the new pointer is the RETURN VALUE of the
>realloc() call.
>
>/Per W
>
>On Sat, 20 Sep 2003, Matthews wrote:
>
>> Still giving me the same crash :\
>>
>> At 11:32 AM 20/09/2003 +0200, Per Westermark wrote:
>> >When you allocate buffers for strings, you must allocate room for
>> >strlen(str)+1
>> >characters, or the termination character '\0' will not fit.
>> >
>> >/Per W
>> >
>> >On Fri, 19 Sep 2003, Matthews wrote:
>> >
>> >> I'm working on a program to generate makefiles for me, and I
currently have
>> >> it set up to read different sections of a file to generate the options.
>> >> One section is %input, which has a list of filenames to include, eg.
>> >>
>> >> prj.txt
>> >>
>> >> %input
>> >> main.c
>> >> vid.c
>> >> gui.c
>> >>
>> >> I read these into a struct organized like so:
>> >>
>> >> struct prj_info
>> >> {
>> >> ...
>> >> char **input;
>> >> ...
>> >> }
>> >>
>> >> And I allocate space based on how many files there are (an array of
>> >> strings, basically)
>> >>
>> >> My problem is that I get errors when running the following C code:
>> >>
>> >> if(!strncmp("%include",t,strlen(t)-1))
>> >> {
>> >> count = 0;
>> >> skip_line(buf);
>> >> getword(buf,t);
>> >> longest_length = strlen(t);
>> >> info.input = (char *)malloc((sizeof(char)*longest_len)*1);
>> >> if(!info.input)
>> >> {
>> >> printf("OH NOS\n");
>> >> return 0;
>> >> }
>> >> //CRASH HERE
>> >> strcpy(info.input[count],t);
>> >> while(*buf!='%')
>> >> {
>> >> while(*buf=='#'||isspace(*buf)) skip_line(buf);
>> >> getword(buf,t);
>> >> if(strlen(t)>longest_length) longest_length = strlen(t);
>> >> count++;
>> >> realloc(info.input,(sizeof(char)*longest_length)*count);
>> >> if(!info.input)
>> >> {
>> >> printf("ERR0RZ\n");
>> >> return 0;
>> >> }
>> >> strcpy(info.input[count],t);
>> >> skip_line(buf);
>> >> }
>> >> }
>> >>
>> >> Buf is the dumped contents of a file (like prj.txt), getword() places a
>> >> word from buf into t and skip_line() skips to the next line in buf.
>> >>
>> >> The code compiles fine, but crashes at the first strcpy(). Any help
would
>> >> be appreciated.
>> >>
>> >>
>> >> -------------------------------------------------------
>> >> This sf.net email is sponsored by:ThinkGeek
>> >> Welcome to geek heaven.
>> >> http://thinkgeek.com/sf
>> >> _______________________________________________
>> >> Dev-cpp-users mailing list
>> >> Dev...@li...
>> >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>> >>
>> >
>> >
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> 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: <or...@vp...> - 2003-09-24 18:13:44
|
Carlos García del Monte wrote: > Did you add the switches -I"C:\MinGW\include" > -I"C:\MinGW\include\c++\3.2" -L"C:\MinGW\lib" ( -mconsole (or -mwindows) > and -lmsvcrt (adapted to your directories) ? Because I noticed that when > all that is not there it doesn't find any header or library. If you wan't to use MinGW from the command line, then you should download the latest MinGW package, and install it. That way gcc will find everything, and no need to add -L and -I stuff (except for your own libs and includes). It is also a good idea to put the .../gcc/bin directory to your PATH, that way you can use gcc from anywhere. The usage is as follows (roughly): gcc -Wall -c -o source1.o source1.cpp gcc -Wall -c -o source2.o source2.cpp ... gcc -o program.exe source1.o source2.o ... You may replace gcc with g++ for c++ code. You can ask me about usage from command line, as I have used it a lot, and I still use it a lot nowadays. Alan, if you could post the errors you get, that would help the most. -- Greetings, Balázs |
|
From: <sol...@ya...> - 2003-09-24 16:40:02
|
Did you add the switches -I"C:\MinGW\include" -I"C:\MinGW\include\c++\3.2" -L"C:\MinGW\lib" ( -mconsole (or -mwindows) and -lmsvcrt (adapted to your directories) ? Because I noticed that when all that is not there it doesn't find any header or library. Ala...@mx... wrote: > Hi, I'm testing Dev-Cpp and GCC compliler, and I'd like to use GCC (g++) >for command-line compiling in WinNT, but I've got troubles and I don't know >why... I've checked the MingGW site and the compiler optiosn that I'm using >are correct.... I haven't been able to compile any suurcefile using g++ >(Packed in dev-cpp) in command-line... Does somebody have a idea or a site >where I can get information? > > THANKS. Alan > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >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: <Ala...@mx...> - 2003-09-24 16:11:41
|
Hi, I'm testing Dev-Cpp and GCC compliler, and I'd like to use GCC (g++) for command-line compiling in WinNT, but I've got troubles and I don't know why... I've checked the MingGW site and the compiler optiosn that I'm using are correct.... I haven't been able to compile any suurcefile using g++ (Packed in dev-cpp) in command-line... Does somebody have a idea or a site where I can get information? THANKS. Alan |
|
From: <rog...@em...> - 2003-09-24 12:48:56
|
Dear friends, I wrote the program bellow. It opens a file, records 1 to 5 some times into a file and close it. Then it opens the same file again, reads its contents and close it. First, I defined count from 1 to 5 (hex) getting correct results. (See attached file: GeraOk.cpp) Then, I defined count from 9 to d (hex) getting wrong results. (See attached file: GeraOk.cpp) I do not understand the reason. Could someone explain it and give a solution. Also, I could not get rid of the warning message. Which is the include file that should be used in order to do not use a deprecated header? Thanks for your help Roger |
|
From: Hossein H. <ult...@em...> - 2003-09-24 08:01:10
|
Dear stefan, > Never answer from pure memory... ;-) Good Idea! > The correct syntax (verified in .NET) is: > > typedef class GenericIterator<T> BasicIterator; Or perhaps the better solution is: typedef typename GenericIterator<T> BasicIterator; (After all, GenericIterator<> may be a struct. Then for human- beeings, and not for compilers, the latter is more intuitive.) Regards, --Hossein -- __________________________________________________________ Sign-up for your own 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: Per W. <pw...@ia...> - 2003-09-24 03:32:30
|
The enum has nothing to do with it.
if ('u') ...
is the same as
if ('u' != 0) ...
so the expression will be
if (letter2 != 'u' || 1 || 1 || 1 || 1) ...
which reduces to
if (1) ...
which is obviously always true.
/Per W
On Wed, 24 Sep 2003, Nathan Stanley wrote:
> I'm not sure, but I think this depends on the type of 'letter2' in the if statement. Your example code showed: value letter
> I don't know if you meant letter2 there, but if so.. you are using an enum in your conditional, so this code would be working as expected.
>
> Someone more learned would know more about this.
> ----- Original Message -----
> From: -
> To: dev...@li...
> Sent: Wednesday, September 24, 2003 6:00 AM
> Subject: [Dev-C++] IF
>
>
> problem with if statement:
> if (letter2 != 'u' || 'v' || 's' || 't' || 'a') {
> cout<<"An error has occured, check you typed in only u, v, s, t or a."<<endl;
> exit();
> }
>
> Compiles ok but after checking i've realised it believes the values are part of an earlier enum declaration:
>
> enum value{u,v,s,t,a};
> value letter;
>
> How do i tell the compiler i want charactors, not enum values?
|
|
From: Nathan S. <liv...@ho...> - 2003-09-23 21:58:20
|
I'm not sure, but I think this depends on the type of 'letter2' in the =
if statement. Your example code showed: value letter
I don't know if you meant letter2 there, but if so.. you are using an =
enum in your conditional, so this code would be working as expected.
Someone more learned would know more about this.
----- Original Message -----=20
From: -=20
To: dev...@li...=20
Sent: Wednesday, September 24, 2003 6:00 AM
Subject: [Dev-C++] IF
problem with if statement:
if (letter2 !=3D 'u' || 'v' || 's' || 't' || 'a') {
cout<<"An error has occured, check you typed in only u, v, s, t or =
a."<<endl;
exit();
}
Compiles ok but after checking i've realised it believes the values =
are part of an earlier enum declaration:
enum value{u,v,s,t,a};
value letter;
How do i tell the compiler i want charactors, not enum values? |
|
From: Per W. <pw...@ia...> - 2003-09-23 21:20:22
|
Almost correct. If I understand the original goal, I'd recommend:
if (letter2 != 'u' && letter2 != 'v'
&& letter2 != 's' && letter2 != 't'
&& letter2 != 'a') {
cout << "Only u,v,s,t,a are allowed" << endl;
exit();
}
Using || isn't so good since an expression:
if (var != value1 || var != value2)
will degenerate to the constant expression:
if (1)
when value1 != value2.
Note that
if (letter2 != 'u' && letter2 != 'v' && ...)
can be rewritten as
if (!(letter2 == 'u' || letter2 == 'v' || letter2 == ...))
which is a simple rewrite of a logical expression.
Whenver changing between a && expression and a || expression - either
way is done by:
1: Inverting total result:
if (xxx) interchanged with if (!(xxx))
2: Inverting every sub-statement in the expression
== interchanged with !=
< interchanged with >=
etc.
About the original mail:
if (letter2 != u' || 'v' || 's' || 't' || 'a')
is the same as:
if (letter2 != 'u' || 'v' != 0 || 's' != 0 || 't' != 0 || 'a' != 0)
which is a constant expression that is always true:
if (1)
since any character except '\0' are different from 0.
/Per W
On Tue, 23 Sep 2003, Geoff Baker wrote:
> You have to declare each side of the '||' as a seperate check.
>
> ie:
>
> if ((letter2 != 'u') || (letter2 != 'v') || (letter2 != 's') || (letter2 !=
> 't') || (letter2 != 'a')) {
> cout<<"An error has occured, check you typed in only u, v, s, t or
> a."<<endl;
> exit();
> }
>
> I do not know for sure if the brackets inside the '||' are required but this
> should fix your problem
>
> -geoff
>
> -----Original Message-----
> From: - [mailto:ali...@nt...]
> Sent: September 23, 2003 2:00 PM
> To: dev...@li...
> Subject: [Dev-C++] IF [faked-from][sls]
>
>
> problem with if statement:
> if (letter2 != 'u' || 'v' || 's' || 't' || 'a') {
> cout<<"An error has occured, check you typed in only u, v, s, t or
> a."<<endl;
> exit();
> }
>
> Compiles ok but after checking i've realised it believes the values are part
> of an earlier enum declaration:
>
> enum value{u,v,s,t,a};
> value letter;
>
> How do i tell the compiler i want charactors, not enum values?
>
>
|
|
From: Per W. <pw...@ia...> - 2003-09-23 21:07:30
|
The read_int() and write_int() functions are the standard way of writing
portable files or data streams etc. Since the file is normalized, it
doesn't matter what machine created it. Obviously, such a file should be
binary so it doesn't contain any newline translations.
One other method often used, is to use htonl(), htons(), ntohl(), ntohs()
to convert between host and network byte order.
In this case, the network byte order is most significant byte first
(lowest address) and it is then possible to write the result of a htons()
or htonl() and write directly:
uint32_t n =3D htonl(my_long);
write(&n,1,sizeof(uint32_t),f);
/Per W
On Tue, 23 Sep 2003, OROSZI Bal=E1zs wrote:
> Hi!
>
> As I see a lot of things are told about this shifting stuff, so I think
> I might also add something.
> Bit shifting/or-ing/and-ing and so on, are VERY VERY useful things.
> There might be times, when you need to use all 8 bits of a byte. For
> example, when you have a big-big table (2D), and all you want to know,
> whether one cell is alive or not - 1 byte to store each cell is too much
> waste. Use 1 byte to store 8 cells, and use bit-masking to get the bits.
> But this is only one example, there are hundreds.
>
> And I also want to add something for the endiannes-stuff. Lets consider,
> that you wan't to save a 4 byte integer in binary form into a file
> (binary - save the int in 4 bytes to a file). You will probably begin
> pondering about endianness, and write specific loading code for big- and
> little-endian machines. However, there is a tricky solution to evade the
> endiannes problem, and saving an integer in binary form and loading it
> back will work on both big and little endian machines with the exact
> same code. Here it is (let's consider, that int is 4 bytes, but you may
> rewrite it to uint32_t to be sure):
>
> void write_int(FILE *outfile, int i)
> {
> putc( i&0x000000ff,outfile); /* Write the last byte */
> putc((i&0x0000ff00)>>8,outfile); /* etc. */
> putc((i&0x00ff0000)>>16,outfile);
> putc((i&0xff000000)>>24,outfile);
> }
>
> int read_int(FILE *infile)
> {
> int i=3D0;
>
> i |=3D ( (int)getc(infile)); /* Read the last byte: 0x000000xx */
> i |=3D (((int)getc(infile))<<8); /* Next: 0x000000xx<<8 =3D 0x0000xx0=
0 */
> i |=3D (((int)getc(infile))<<16); /* etc. */
> i |=3D (((int)getc(infile))<<24);
> return i;
> }
>
> The code above doesn't use any explicit conversion from int to char*,
> which is - lets say it - ugly. It works, because bit-shifting is
> "endian-free" i.e. it doesn't depend on endiannes. It works on both
> types of machines. As you can see, it uses the so-blessed shifting and
> bit-masking operators to ahcieve this goal.
>
> I hope I could add something useful.
> --
> Greetings,
> Bal=E1zs
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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: Geoff B. <Geo...@Vc...> - 2003-09-23 20:38:34
|
You have to declare each side of the '||' as a seperate check.
ie:
if ((letter2 != 'u') || (letter2 != 'v') || (letter2 != 's') || (letter2 !=
't') || (letter2 != 'a')) {
cout<<"An error has occured, check you typed in only u, v, s, t or
a."<<endl;
exit();
}
I do not know for sure if the brackets inside the '||' are required but this
should fix your problem
-geoff
-----Original Message-----
From: - [mailto:ali...@nt...]
Sent: September 23, 2003 2:00 PM
To: dev...@li...
Subject: [Dev-C++] IF [faked-from][sls]
problem with if statement:
if (letter2 != 'u' || 'v' || 's' || 't' || 'a') {
cout<<"An error has occured, check you typed in only u, v, s, t or
a."<<endl;
exit();
}
Compiles ok but after checking i've realised it believes the values are part
of an earlier enum declaration:
enum value{u,v,s,t,a};
value letter;
How do i tell the compiler i want charactors, not enum values?
|
|
From: - <ali...@nt...> - 2003-09-23 20:01:50
|
problem with if statement:
if (letter2 !=3D 'u' || 'v' || 's' || 't' || 'a') {
cout<<"An error has occured, check you typed in only u, v, s, t or =
a."<<endl;
exit();
}
Compiles ok but after checking i've realised it believes the values are =
part of an earlier enum declaration:
enum value{u,v,s,t,a};
value letter;
How do i tell the compiler i want charactors, not enum values? |
|
From: <or...@vp...> - 2003-09-23 19:26:20
|
Hi!
As I see a lot of things are told about this shifting stuff, so I think
I might also add something.
Bit shifting/or-ing/and-ing and so on, are VERY VERY useful things.
There might be times, when you need to use all 8 bits of a byte. For
example, when you have a big-big table (2D), and all you want to know,
whether one cell is alive or not - 1 byte to store each cell is too much
waste. Use 1 byte to store 8 cells, and use bit-masking to get the bits.
But this is only one example, there are hundreds.
And I also want to add something for the endiannes-stuff. Lets consider,
that you wan't to save a 4 byte integer in binary form into a file
(binary - save the int in 4 bytes to a file). You will probably begin
pondering about endianness, and write specific loading code for big- and
little-endian machines. However, there is a tricky solution to evade the
endiannes problem, and saving an integer in binary form and loading it
back will work on both big and little endian machines with the exact
same code. Here it is (let's consider, that int is 4 bytes, but you may
rewrite it to uint32_t to be sure):
void write_int(FILE *outfile, int i)
{
putc( i&0x000000ff,outfile); /* Write the last byte */
putc((i&0x0000ff00)>>8,outfile); /* etc. */
putc((i&0x00ff0000)>>16,outfile);
putc((i&0xff000000)>>24,outfile);
}
int read_int(FILE *infile)
{
int i=0;
i |= ( (int)getc(infile)); /* Read the last byte: 0x000000xx */
i |= (((int)getc(infile))<<8); /* Next: 0x000000xx<<8 = 0x0000xx00 */
i |= (((int)getc(infile))<<16); /* etc. */
i |= (((int)getc(infile))<<24);
return i;
}
The code above doesn't use any explicit conversion from int to char*,
which is - lets say it - ugly. It works, because bit-shifting is
"endian-free" i.e. it doesn't depend on endiannes. It works on both
types of machines. As you can see, it uses the so-blessed shifting and
bit-masking operators to ahcieve this goal.
I hope I could add something useful.
--
Greetings,
Balázs
|
|
From: Per W. <pw...@ia...> - 2003-09-23 15:26:50
|
The program picks up the first byte of the integer - as stored in memory.
If it is 1, it's the side where the "little" part of the integer is
stored. If it is 0, it's the side where the "large" part is stored.
Intel, AMD store low byte of integer first, so it is expected that at the
first byte of the address of the integer, the value 1 should be stored.
The other three bytes of the integer will all be zero.
/Per W
On Tue, 23 Sep 2003, Michael D. Smith wrote:
>
> Prints little endian. I have no idea why :)
>
> ms
>
>
> At 06:03 AM 9/23/03, you wrote:
> > > I have an AMD processor and no idea if it's big or little endian.
> >
> >main() {
> > int x = 1;
> > if (*(char *)&x == 1) {
> > printf("little-endian\n");
> > } else {
> > printf("big-endian\n");
> > }
> >}
> >
> >
> >Regards,
> > Neszt Tibor
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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: stefan k. <ste...@ya...> - 2003-09-23 15:09:08
|
Never answer from pure memory... ;-)
The correct syntax (verified in .NET) is:
typedef class GenericIterator<T> BasicIterator;
Best,
Stefan
> Just type this:
>
> typedef template class GenericIterator<T> BasicIterator;
>
> That should work.
>
> Cheers,
> Stefan
>
> Marcos Cesar Carrard wrote:
>
>> Hello!
>>
>> I have a problem with a c++ library that I'm developing.I have one
>> class to
>> define a generic container and another class to a generic iterator,
>> like this:
>>
>> template <class T> class GenericIterator{
>> .....
>> };
>>
>> template <class T> class GenericContainer{
>> ....
>> typedef GenericIterator<T> BasicIterator;
>> ....
>> };
>>
>> When this code is compiled, there was several warnings messages in the
>> typedef
>> inside of container class and in that locals where I use
>> BasicIterator. The
>> warnings are like "implicit typename is deprecated, see documentation".
>> However, I need this type definition to allow a iterator declaration
>> through the
>> container class, like:
>>
>> int main()
>> {
>> Container<int> c;
>> Container<int>::BasicIterator i;
>> ....
>> }
>>
>> How can I do to make this without error and/or warnings messages?
>>
>> Thanks,
>>
>> Marcos
>>
>>
>>
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> Dev-cpp-users mailing list
>> Dev...@li...
>> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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
>
|