dev-cpp-users Mailing List for Dev-C++ (Page 137)
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: Michal M. <mi...@mo...> - 2005-04-16 10:12:08
|
Bernardo Magri wrote: > i want to use the conio functions with the latest version of dev-C++, > and it doesnt work! > i read in the help that i should include the conio.o file in my project, > but my dev-c++ doesnt have this file!!! > what should i do to use these functions?? > thanks. See this: http://molhanec.net/devcpphelp/packages.html#h6s0 -- Regards, Michal |
|
From: Martin D. <nex...@qu...> - 2005-04-16 09:22:01
|
Bernardo Magri wrote: > i want to use the conio functions with the latest version of dev-C++, > and it doesnt work! > i read in the help that i should include the conio.o file in my > project, but my dev-c++ doesnt have this file!!! > what should i do to use these functions?? > thanks. All you have to do is adding the conio.c file to the list of your project source files and compile. The compilation will create the conio.o which you can use later instead. |
|
From: Bernardo M. <ber...@uo...> - 2005-04-16 04:46:53
|
i want to use the conio functions with the latest version of dev-C++, = and it doesnt work! i read in the help that i should include the conio.o file in my project, = but my dev-c++ doesnt have this file!!! what should i do to use these functions?? thanks. |
|
From: Verne H. B. <ve...@sy...> - 2005-04-15 15:28:58
|
MessageIt was the principle, man, the principle AND you got me!!!! :-)
Verne
C++
double a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
C
double a =3D 6.25, b =3D 12.50 , c =3D 13.80;
printf("%.2f", 6.25 + 12.50 +13.80);
reid=20
-----Original Message-----
From: Verne H. Bohlender [mailto:ve...@sy...]=20
Sent: Thursday, April 14, 2005 10:19 PM
To: Dev C++; LETCHUMANAN SAMINADAN
Subject: Re: [Dev-C++] How to add the total.......
This must be some type of C language but with C++ you'd simply do =
this if=20
int a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
and you'd see the answer as the total of the three numbers.
Can someone else help the gentleman.
Verne
----- Original Message -----=20
From: LETCHUMANAN SAMINADAN=20
To: Dev-Cpp=20
Sent: Thursday, April 14, 2005 9:48 PM
Subject: [Dev-C++] How to add the total.......
Dear all,
I'm having a problem in in adding the total amount, my program as =
below...
if((col=3Dfopen("total utility.doc","r"))=3D=3DNULL)
printf("Cannot open file!");
else
{ =20
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
=20
printf("%.2f\n",data.utl); =20
=20
} =20
} =20
fflush(stdin); =20
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
=20
fclose(col);
The output:- 6.25
12.50
13.80
I want the total to be displayed as, 32.55. There is a way to get =
it, can someone please help me on this program...
Thanks to all,
Letchu...
Yahoo! Mobile
- Download the latest ringtones, games, and more!
|
|
From: Per W. <pw...@ia...> - 2005-04-15 13:54:11
|
Remember one thing.
In the general case, it is impossible to convert a constant storage to a
non-constant storage.
You can cast away the const keyword, but that isn't the same as making the
const variable writeable - in some cases const variables are stored in
read-only memory - quite common for example for text strings, i.e. the
text "hello world" is often stored in the the application code (which is
write-protected). The alternative would require the compiler to copy the
text string from application code to a writeable variable on startup, i.e.
requiring the storage of the string in two different places.
Also, a lot of compilers treats const variables in a special way, i.e.
they really threat them as constants and not variables - similar to an
enum or #define.
So, if you do:
const int n = 20;
printf("%d",n);
the compiler knows that n is promised to always have the value 20. It may
then rewrite the printf() to:
printf("%d",20);
and obvisously, it doesn't matter if you manage to somehow change the
value of n - the compiler doesn't load n from any memory position but
instead uses the numeric value directly in following code.
/Per W
On Fri, 15 Apr 2005, Farzan Hajian wrote:
> Hi users,
>
> I've recently faced to some confusing results that "const_cast" makes.
> Let's assume we have the following code:
>
> const float i=55.5;
> float * j=const_cast<float*>(&i);
> cout << j << '\t' << &i << endl; // Displays addresses.
> *j=45.6;
> cout << *j <<'\t' << i << endl; // Displays contents.
>
> If you run the code you will see something like this:
> 0x22ff78 0x22ff78
> 45.6 55.5
>
> As you can see, the address of "i" is "0x22ff78" and it is the place where
> "j" points to it.
> The value of "i" is 55.5 but the value of the place where "j" points to it
> is 45.6!!
> How can a single memory block store two different values????
>
> Now there is another strange result. If you assign 45.6 to "j" immediately
> after
> "const_cast" (instead of assigning after displaying addresses) like this:
>
> const float i=55.5;
> float * j=const_cast<float*>(&i);
> *j=45.6;
> cout << j << '\t' << &i << endl; // Displays addresses.
> cout << *j <<'\t' << i << endl; // Displays contents.
>
> the result will be:
> 0x22ff78 0x22ff78
> 55.5 55.5
>
> I should mention that this distinction is made when you use DEV-C++ 5.If
> you use DEV-C++ 4,
> only the first result will be produced for both codes.
>
> I also tested the codes in MS Visual C++ 6 and it showed me the following
> result for both:
> 0012FF7C 0012FF7C
> 45.6 45.6
>
> The value of "i" is 45.6 now. I think it is more acceptable result because
> by using
> "const_cast", a constant storage (i) has been converted to a non constant
> storage (j)
> and you can change its content.
>
> Now please explain these results.
> Thanks,
|
|
From: Reid T. <Rei...@at...> - 2005-04-15 12:48:09
|
C++
double a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
=20
C
double a =3D 6.25, b =3D 12.50 , c =3D 13.80;
printf("%.2f", 6.25 + 12.50 +13.80);
=20
=20
reid=20
-----Original Message-----
From: Verne H. Bohlender [mailto:ve...@sy...]=20
Sent: Thursday, April 14, 2005 10:19 PM
To: Dev C++; LETCHUMANAN SAMINADAN
Subject: Re: [Dev-C++] How to add the total.......
This must be some type of C language but with C++ you'd simply do this
if=20
int a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
and you'd see the answer as the total of the three numbers.
=20
Can someone else help the gentleman.
Verne
----- Original Message -----=20
From: LETCHUMANAN SAMINADAN <mailto:arl...@ya...> =20
To: Dev-Cpp <mailto:dev...@li...> =20
Sent: Thursday, April 14, 2005 9:48 PM
Subject: [Dev-C++] How to add the total.......
Dear all,
=20
I'm having a problem in in adding the total amount, my program as
below...
=20
if((col=3Dfopen("total utility.doc","r"))=3D=3DNULL)
printf("Cannot open file!");
else
{ =20
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
=20
printf("%.2f\n",data.utl); =20
=20
} =20
} =20
fflush(stdin); =20
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
=20
fclose(col);
The output:- 6.25
12.50
13.80
=20
I want the total to be displayed as, 32.55. There is a way to get it,
can someone please help me on this program...
=20
Thanks to all,
Letchu...
=20
=20
<http://sg.yimg.com/i/sg/icons/16/sms2.gif> Yahoo! Mobile
<http://sg.rd.yahoo.com/mail/tagline/?http://sg.mobile.yahoo.com/>=20
- Download the latest ringtones, games, and more!
|
|
From: Reid T. <Rei...@at...> - 2005-04-15 12:43:02
|
nope..
=20
int a =3D 6.25, b =3D 12.50 , c =3D 13.80;=20
=20
will result in an integer being returned.
reid=20
-----Original Message-----
From: Verne H. Bohlender [mailto:ve...@sy...]=20
Sent: Thursday, April 14, 2005 10:19 PM
To: Dev C++; LETCHUMANAN SAMINADAN
Subject: Re: [Dev-C++] How to add the total.......
This must be some type of C language but with C++ you'd simply do this
if=20
int a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
and you'd see the answer as the total of the three numbers.
=20
Can someone else help the gentleman.
Verne
----- Original Message -----=20
From: LETCHUMANAN SAMINADAN <mailto:arl...@ya...> =20
To: Dev-Cpp <mailto:dev...@li...> =20
Sent: Thursday, April 14, 2005 9:48 PM
Subject: [Dev-C++] How to add the total.......
Dear all,
=20
I'm having a problem in in adding the total amount, my program as
below...
=20
if((col=3Dfopen("total utility.doc","r"))=3D=3DNULL)
printf("Cannot open file!");
else
{ =20
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
=20
printf("%.2f\n",data.utl); =20
=20
} =20
} =20
fflush(stdin); =20
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
=20
fclose(col);
The output:- 6.25
12.50
13.80
=20
I want the total to be displayed as, 32.55. There is a way to get it,
can someone please help me on this program...
=20
Thanks to all,
Letchu...
=20
=20
<http://sg.yimg.com/i/sg/icons/16/sms2.gif> Yahoo! Mobile
<http://sg.rd.yahoo.com/mail/tagline/?http://sg.mobile.yahoo.com/>=20
- Download the latest ringtones, games, and more!
|
|
From: Farzan H. <far...@ho...> - 2005-04-15 08:26:29
|
Hi users, I've recently faced to some confusing results that "const_cast" makes. Let's assume we have the following code: const float i=3D55.5; float * j=3Dconst_cast<float*>(&i); cout << j << '\t' << &i << endl; // Displays addresses. *j=3D45.6; cout << *j <<'\t' << i << endl; // Displays contents. If you run the code you will see something like this: 0x22ff78 0x22ff78 45.6 55.5 As you can see, the address of "i" is "0x22ff78" and it is the place wher= e =20 "j" points to it. The value of "i" is 55.5 but the value of the place where "j" points to i= t =20 is 45.6!! How can a single memory block store two different values???? Now there is another strange result. If you assign 45.6 to "j" immediatel= y =20 after "const_cast" (instead of assigning after displaying addresses) like this: const float i=3D55.5; float * j=3Dconst_cast<float*>(&i); *j=3D45.6; cout << j << '\t' << &i << endl; // Displays addresses. cout << *j <<'\t' << i << endl; // Displays contents. the result will be: 0x22ff78 0x22ff78 55.5 55.5 I should mention that this distinction is made when you use DEV-C++ 5.If = =20 you use DEV-C++ 4, only the first result will be produced for both codes. I also tested the codes in MS Visual C++ 6 and it showed me the following= =20 result for both: 0012FF7C 0012FF7C 45.6 45.6 The value of "i" is 45.6 now. I think it is more acceptable result becaus= e =20 by using "const_cast", a constant storage (i) has been converted to a non constant= =20 storage (j) and you can change its content. Now please explain these results. Thanks, --=20 Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
|
From: Daniel K. O. <dan...@ya...> - 2005-04-15 02:47:56
|
LETCHUMANAN SAMINADAN wrote: > I'm having a problem in in adding the total amount, my program as below... There are some serious errors in your code; you might want to read a book - or at least a good tutorial - on C programming. > while(!feof(col)) That's not the way to read a file. Unlike Pascal, in C (and in most of the existing languages) I/O functions can't predict the future; feof() will not tell you "in the future, when you try to read from this file, I'll find nothing to read"; instead, it tells you "last time you tried to read, I reached the end-of-file". See http://www.eskimo.com/~scs/C-faq/q12.2.html What you need is to test the result of the function you used to access the file (e.g. fscanf() will return the number of successful assignments). --- while (fscanf(col,"%f",&data.utl) == 1) { ... } --- > fscanf(col,"%f\n",&data.utl); Always avoid using a '\n' in *scanf() calls. See http://www.eskimo.com/~scs/C-faq/q12.17.html For each read operation, you might also want to accumulate the value; initialize a variable before the while with zero, and add the read value to it: --- float total = 0; while (fscanf(col,"%f",&data.utl) == 1) { total += data.utl; } --- > fflush(stdin); You shouldn't do this; See http://www.eskimo.com/~scs/C-faq/q12.26.html Daniel K. O. |
|
From: Verne H. B. <ve...@sy...> - 2005-04-15 02:18:53
|
This must be some type of C language but with C++ you'd simply do this =
if=20
int a =3D 6.25, b =3D 12.50 , c =3D 13.80;
cout << a + b + c;
and you'd see the answer as the total of the three numbers.
Can someone else help the gentleman.
Verne
----- Original Message -----=20
From: LETCHUMANAN SAMINADAN=20
To: Dev-Cpp=20
Sent: Thursday, April 14, 2005 9:48 PM
Subject: [Dev-C++] How to add the total.......
Dear all,
I'm having a problem in in adding the total amount, my program as =
below...
if((col=3Dfopen("total utility.doc","r"))=3D=3DNULL)
printf("Cannot open file!");
else
{ =20
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
=20
printf("%.2f\n",data.utl); =20
=20
} =20
} =20
fflush(stdin); =20
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
=20
fclose(col);
The output:- 6.25
12.50
13.80
I want the total to be displayed as, 32.55. There is a way to get it, =
can someone please help me on this program...
Thanks to all,
Letchu...
Yahoo! Mobile
- Download the latest ringtones, games, and more!
|
|
From: LETCHUMANAN S. <arl...@ya...> - 2005-04-15 01:48:25
|
Dear all,
I'm having a problem in in adding the total amount, my program as below...
if((col=fopen("total utility.doc","r"))==NULL)
printf("Cannot open file!");
else
{
while(!feof(col))
{
fscanf(col,"%f\n",&data.utl);
printf("%.2f\n",data.utl);
}
}
fflush(stdin);
printf("Press ENTER to continue....");
getchar();
fflush(stdin);
fclose(col);
The output:- 6.25
12.50
13.80
I want the total to be displayed as, 32.55. There is a way to get it, can someone please help me on this program...
Thanks to all,
Letchu...
Yahoo! Mobile
- Download the latest ringtones, games, and more! |
|
From: klesk S. <vk...@ho...> - 2005-04-14 23:42:14
|
<html><div style='background-color:'><P><BR> Wallaoo<BR></P><BR><BR><BR> <DIV> <P align=center><FONT color=#663366 size=6>klesk</FONT></P></DIV></div><br clear=all><hr>Recibe ofertas de empleo adaptadas a tu perfil. <a href="http://g.msn.com/8HMBESES/2752??PS=47575" target="_top">Introduce tu CV en MSN Empleo.</a> </html> |
|
From: Malcolm N. <m.n...@wa...> - 2005-04-14 20:58:42
|
Hello Dev-cpp-users, Now it's my turn to ask. Does anyone have any code for streaming a rtf file into a rich text control. I have looked around google, archives and the web, but I only come across MFC code. Does anyone have a site which might offer some code? -- Best regards, Malcolm mailto:m.n...@wa... |
|
From: rohit b. <rv...@gm...> - 2005-04-14 14:33:30
|
medhat wrote: > Hi I used dev cpp for the firts time. > I get this message: There doesn´t seem to be GNU Make file PATH o rin DEV-C++s Bin Path. Please make shure that you have GNU Make and adjust Bin settings or system PATH environment,.......... > First check that the installer that you are using also installs GCC. There is a version without GCC also. Ensure that you have installed Dev-C++ in a directory such that the path doesn't have any spaces in it. A good example for a path with spaces in it is C:\Program Files. Install in C:\Devcpp or somewhere like that. Then go to Tools > Compiler Options > Directories and check that all the values there are correct. Add or remove directories as is necessary. -- Rohit V. Bhute http://rvbhute.freelinuxhost.com/ Using Firefox, Thunderbird and Sunbird |
|
From: medhat <me...@gm...> - 2005-04-14 14:15:24
|
Hi I used dev cpp for the firts time. I get this message: There doesn=B4t seem to be GNU Make file PATH o rin = DEV-C++s Bin Path. Please make shure that you have GNU Make and adjust = Bin settings or system PATH environment,.......... So I can=B4t compile now what should I do?? Thanks a lot. |
|
From: Austin S. <Aus...@co...> - 2005-04-13 21:44:54
|
well, I thank you for your opinion, and, for your knowledge, I have a book, and am also taking a class. Now, I may be mistaken, but I thought this mailing list was a way one can ask for help if he has a problem. I had a problem, and had the idea that if I asked for help, rather than spend hours searching google or finding just the right book for the job, the nice coders here on the mailing list would be happy to help me correct a simple mistake I made and if you notice, Verne, someone has. My problem is fixed, and I can progress in my learning, and hopefully won't have to ask for help again. now, I've seen you help other people with there problems, and I'm getting the distinct since that this problem wasn't good enough to warrant your time. now, that's just my impression. please correct me if I'm wrong. ____________________________________________ The answer to this is simple. READ A BOOK ON SIMPLE C++ AND LEARN THE FUNDAMENTALS FROM THE BOOK. There are an awful lot available if you do a simple search or go to a book store. Verne |
|
From: Per W. <pw...@ia...> - 2005-04-13 20:24:23
|
One addendum. The C++ standard requires name mangling, since the language support multiple functions with the same name but different parameter signatures, such as: int add(int a,int b); doule add(double a,double b); Complex& add(Complex& a,Complex& b); C compilers knows that functions already have unique names, so they can ignore parameter count, parameter types etc. However, some compilers can add extra name mangling to mark functions compiled with non-compatible calling conventions. If you build one C file with all functions taking the parameters in processor registers and a second C file with all functions sent on the stack, a program would fail if a function in one file calls a function in the other file. If the compiler for example adds a $ at the end of the names of all functions built with register calling convention, then the linker will automatically fail to link such a program and you avoid creating a badly broken application. So in short - there _can_ exist C name mangling, but it is for a different reason and it isn't because of parameter count/types but to detect incompatible compiler optimization rules. Some of these compilers have also added non-standard keywords to for example specify: __regcall int add(int a,int b); to inform that a specific function has a specific calling convention different from the one used in the normal C libraries. /Per W On Wed, 13 Apr 2005 Mat...@Ve... wrote: > Thanks for the heads-up, Per. I was getting really confused before, hehe! > > -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Wednesday, April 13, 2005 12:57 PM > To: Mat...@Ve... > Cc: ja...@ya...; dev...@li... > Subject: RE: [Dev-C++] Couldn`t link MinGW DLL to MSVC program > > > That is correct - no name mangling for C. But you may still get some extra > characters in the names. The normal is that you get a leading '_' for all > external C symbols but to my knowledge there exists environments where a > '$' first or last might be used. The leading '_' was added to place the C > symbols in their own "namespace" to avoid name collisions with operating > system symbols, i.e. open is a OS function while _open is the function > available in the C standard library and called by the C code. > > /Per W |
|
From: <Mat...@Ve...> - 2005-04-13 19:58:56
|
Thanks for the heads-up, Per. I was getting really confused before, hehe! -----Original Message----- From: Per Westermark [mailto:pw...@ia...] Sent: Wednesday, April 13, 2005 12:57 PM To: Mat...@Ve... Cc: ja...@ya...; dev...@li... Subject: RE: [Dev-C++] Couldn`t link MinGW DLL to MSVC program That is correct - no name mangling for C. But you may still get some extra characters in the names. The normal is that you get a leading '_' for all external C symbols but to my knowledge there exists environments where a '$' first or last might be used. The leading '_' was added to place the C symbols in their own "namespace" to avoid name collisions with operating system symbols, i.e. open is a OS function while _open is the function available in the C standard library and called by the C code. /Per W ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: Per W. <pw...@ia...> - 2005-04-13 19:57:26
|
That is correct - no name mangling for C. But you may still get some extra
characters in the names. The normal is that you get a leading '_' for all
external C symbols but to my knowledge there exists environments where a
'$' first or last might be used. The leading '_' was added to place the C
symbols in their own "namespace" to avoid name collisions with operating
system symbols, i.e. open is a OS function while _open is the function
available in the C standard library and called by the C code.
/Per W
On Tue, 12 Apr 2005 Mat...@Ve... wrote:
> My understanding was that compilers don't mangle C names in libraries, on=
ly
> C++ ones.
>
> Now I'm really confused!
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of Gerson
> Lara
> Sent: Monday, April 11, 2005 11:39 PM
> To: DEV
> Subject: Re: [Dev-C++] Couldn`t link MinGW DLL to MSVC program
>
>
> I have successfuly tested creating "dummy" dll with DEV-C++ 4.0 and using
> them in VisualBasic 6.0,
> the thing is the famous namemangling, what I do is looking at a .def file
> that [i think] dllwrap
> or dlltool creates in the same directory of the DLL. Finally, in VB I don=
t
> use the same name that
> in my C code, instead, I Use the mangled names that I obtain from the .de=
f
> file. May be that helps
> just a little.
> NOTE: this is valid for C code, if I try with C++ code [classes] the name
> mangling turns too
> confusing for me...
> Hope This Helps...
>
> --- Per Westermark <pw...@ia...> escribi=F3:
> > It is possible to create DLL files exporting variables and functions -
> > using "C" naming convention and mix between gcc and M$. However, you ca=
n't
> > export/import classes or other C++ symbols (and often not structs eithe=
r),
> > since the C++ mangling - and the internal memory layout - is different
> > between the compilers.
> >
> > Google on ABI (Application Binary Interface) and you will get more
> > information about the problem.
> >
> > /Per W
> >
> > On Sun, 27 Mar 2005, Dmitry Sidorov wrote:
> >
> > > Hello dev-cpp-users.
> > >
> > > I have the following source files to build DLL with Dev-Cpp
> > >
> > >
> > > // dll.h
> > > #ifndef _DLL_H_
> > > #define _DLL_H_
> > >
> > > #if BUILDING_DLL
> > > # define DLLIMPORT __declspec (dllexport)
> > > #else /* Not BUILDING_DLL */
> > > # define DLLIMPORT __declspec (dllimport)
> > > #endif /* Not BUILDING_DLL */
> > >
> > > class DLLIMPORT MyClass
> > > {
> > > public:
> > > MyClass();
> > > virtual ~MyClass(void);
> > > };
> > > #endif /* _DLL_H_ */
> > >
> > >
> > > // dllmain.cpp
> > > #include "dll.h"
> > > #include <windows.h>
> > >
> > > MyClass::MyClass()
> > > {
> > > MessageBox( NULL, "MyClass construccted!!!", "test", 0 );
> > > }
> > > MyClass::~MyClass()
> > > {
> > > }
> > > BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle=
=2E
> */ ,
> > > DWORD reason /* Reason this function is
> being called. */ ,
> > > LPVOID reserved /* Not used. */ )
> > > {
> > > switch (reason)
> > > {
> > > case DLL_PROCESS_ATTACH:
> > > break;
> > >
> > > case DLL_PROCESS_DETACH:
> > > break;
> > >
> > > case DLL_THREAD_ATTACH:
> > > break;
> > >
> > > case DLL_THREAD_DETACH:
> > > break;
> > > }
> > >
> > > /* Returns TRUE on success, FALSE on failure */
> > > return TRUE;
> > > }
> > >
> > > This is standard DLL project of Dev-Cpp with MessageBox function in
> > > MyClass constructor
> > >
> > > I build DLL with Dev-Cpp and then build .LIB file by LIB.exe from the
> > > MSVC installation.
> > >
> > > lib.exe /machine:i386 /def:libhellodll.def
> > >
> > > Then I create the following code in MSVC
> > > // testdll.cpp : Defines the entry point for the console application.
> > > //
> > > #include "stdafx.h"
> > > #include "dll.h"
> > >
> > > int _tmain(int argc, _TCHAR* argv[])
> > > {
> > > MyClass hello;
> > > return 0;
> > > }
> > >
> > > I also add libhellodll.lib to MSVC project
> > > But when my testdll is linking I got the following errors
> > >
> > > testdll2 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> > MyClass::MyClass(void)" (__imp_??0MyClass@@QAE@XZ) referenced in functi=
on
> _main
> > > testdll2 error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: virtual
> > __thiscall MyClass::~MyClass(void)" (__imp_??1MyClass@@UAE@XZ) referenc=
ed
> in function _main
> > > testdll2 fatal error LNK1120: 2 unresolved externals
> > >
> > >
> > > Then I tried to use dlltool from MinGW
> > > dlltool.exe -d libhellodll.def --dllname hellodll.dll --output-lib
> libhellodll.lib
> > >
> > > But I`ve got the same error
> > > I also tried to use dlltool.exe with -U and -k flags, I`ve got the
> > > same errors :(
> > >
> > > Can anybody help me?
> > > Excuse me for my poor english
> > >
> > > --
> > > Dmitry
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > SF email is sponsored by - The IT Product Guide
> > > Read honest & candid reviews on hundreds of IT Products from real use=
rs.
> > > Discover which products truly live up to the hype. Start reading now.
> > > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> > > _______________________________________________
> > > 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
> > >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users=
=2E
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> > _______________________________________________
> > 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
> >
>
>
>
> ______________________________________________
> Renovamos el Correo Yahoo!: =A1250 MB GRATIS!
> Nuevos servicios, m=E1s seguridad
> http://correo.yahoo.es
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> 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
> ___________________________________________________________________
> The information contained in this message and any attachment may be
> proprietary, confidential, and privileged or subject to the work
> product doctrine and thus protected from disclosure. If the reader
> of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify me
> immediately by replying to this message and deleting it and all
> copies and backups thereof. Thank you.
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Produc
|
|
From: jose i. c. <ji...@gm...> - 2005-04-13 19:46:52
|
Jay, wrong! I do my own research, read my books and do my homework.=20 Though, I am been known to ask a question here and there.=20 Nonetheless, there is a difference between saying, "The good way to start programming is by doing research on the internet, books, newsgroup, etc. What you are trying to do, many other folks have already done. So, i would suggest for you, "such and such" book, by "such and such" author. I also suggest www.cpp.org and www.someothercpp.org and www.anotherwebsite.com has been extremely helpful to me. You may want to give those a try and when you get stuck, come back and ask us. We'll be here waiting. By the way, happy programming!" and let the guy go with a bunch of knowledge and thinking that we are nice people. But putting the guy down like that it makes no sense.=20 You know, many people hate us c/c++ programmers because we are nasty.=20 Not because we are smart, which we are, but because we are nasty to people and other programmers. We love to show our wisdom and how smart we are and how great and short our code is and how... I guess that comes with the geeky side of us, but friends, it's a bad reputation we geeky people have, which we should change: we are socially challenged. Just a thought... Back to programming... On 4/13/05, Jay Blanchard <jay...@ni...> wrote: > [snip] > Was that really needed? >=20 > Don't help, if you don't want to help. > [/snip] >=20 > You'r eprobably one of those guys who got his feelings hurt when someone > told them to RTFM or STFW, aren't you? Honestly, I'd rather teach a man > to fish any day. He will learn more. There are thousands of tutorials on > C++ programming on the web and any new programmer would gain value from > them and the ability to find them. You didn't help out either, did you? > Don't throw rocks unless you want them thrown back. >=20 > Here is some sage advice from another list... >=20 > 1. Try http://www.google.com Searching for "C++ YOUR QUERY" may fetch > your relevant information within the first 10 results. >=20 > 2. There is a searchable archive of the mailing list discussion online. > Many of the common topics are discussed > repeatedly, and you may get answer to your query from the earlier > discussions. >=20 > For example: One of the repeatedly discussed question in the list is > "Best C++ compiler". Everyone has his/her favourite editor. You can get > all the opinions by going through the list archives. >=20 > 3. If you are stuck with code and do not understand what is wrong, > instead of posting the whole shebang, post the relevant portion of the > code >=20 > 4. Provide a clear descriptive subject line. Avoid general subjects like > "Help!!", "A Question" etc. Especially avoid blank subjects. >=20 > 5. When you want to start a new topic, open a new mail composer and > enter the mailing list address instead of replying to an existing thread > and replacing the subject and body with your message. >=20 > 6. It's always a good idea to post back to the list once you've solved > your problem. People usually add [SOLVED] to the subject line of their > email when posting solutions. By posting your solution you're helping > the next person with the same question. >=20 > 7. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html >=20 > 8. Do not send your email to the list with attachments. If you don't > have a place to upload your code, try the many pastebin websites (such > as www.pastebin.com). >=20 > 9. "Because it is hard to read." > "Why?" > "Top-postng is bad." > |
|
From: Jay B. <jay...@ni...> - 2005-04-13 18:18:48
|
[snip] Was that really needed? Don't help, if you don't want to help. [/snip] You'r eprobably one of those guys who got his feelings hurt when someone told them to RTFM or STFW, aren't you? Honestly, I'd rather teach a man to fish any day. He will learn more. There are thousands of tutorials on C++ programming on the web and any new programmer would gain value from them and the ability to find them. You didn't help out either, did you? Don't throw rocks unless you want them thrown back. Here is some sage advice from another list... 1. Try http://www.google.com Searching for "C++ YOUR QUERY" may fetch your relevant information within the first 10 results. 2. There is a searchable archive of the mailing list discussion online. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions.=20 For example: One of the repeatedly discussed question in the list is "Best C++ compiler". Everyone has his/her favourite editor. You can get all the opinions by going through the list archives.=20 3. If you are stuck with code and do not understand what is wrong, instead of posting the whole shebang, post the relevant portion of the code 4. Provide a clear descriptive subject line. Avoid general subjects like "Help!!", "A Question" etc. Especially avoid blank subjects.=20 5. When you want to start a new topic, open a new mail composer and enter the mailing list address instead of replying to an existing thread and replacing the subject and body with your message. 6. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question.=20 7. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html 8. Do not send your email to the list with attachments. If you don't have a place to upload your code, try the many pastebin websites (such as www.pastebin.com).=20 9. "Because it is hard to read." "Why?" "Top-postng is bad." |
|
From: <Mat...@Ve...> - 2005-04-13 18:03:43
|
Verne is new at C++ too by his own admission; therefore I think he's
qualified to say this: he has just been reading books and teaching himself.
Verne's point is that reading a book really would help, so, from his point
of view, suggesting (however loudly) that Austin read a book is actually
giving help, not being unhelpful.
Sometimes the "tough love" approach to programming help is appropriate.
Apparently, Verne believes this is a case where "tough love" help is the
right kind.
As for whether it was needed, we are all adults here and I don't think it's
our responsibility to judge Verne. It's up to Verne to use his own best
judgment, and I don't think he would be the type of person who would use bad
judgment before he wrote something.
Correct me if I'm wrong on some of my points. I'm just trying to point out
what Verne might have been thinking when he dispensed the advice.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of jose
isaias cabrera
Sent: Wednesday, April 13, 2005 10:50 AM
To: Verne H. Bohlender
Cc: Dev C++; Austin Scholze
Subject: Re: [Dev-C++] (no subject)
Was that really needed?
Don't help, if you don't want to help.
On 4/13/05, Verne H. Bohlender <ve...@sy...> wrote:
> The answer to this is simple. READ A BOOK ON SIMPLE C++ AND LEARN THE
> FUNDAMENTALS FROM THE BOOK. There are an awful lot available if you do a
> simple search or go to a book store.
> Verne
>
>
> Hi. I'm new to programming, and don't know all the terminology, so please
go
> easy on me.
>
> I'm trying to figure out how to create a include file so I can use it's
> functions in my programs, by just including it.
>
> Here's my simple test program that didn't work in the least ^^
>
> __________________________________________________
>
> the program I tried to link to:
>
> #include<iostream>
>
> using namespace std;
>
>
> int subten(int num)
> {
> num -= 10;
> return num;
> }
> The program I tried to link to the above with:
>
> #include <iostream>
> #include "subten"
> using namespace std;
>
> main()
> {
>
> int a = 20;
> cout << a << endl;
> a=subten(a);
> cout << a;
>
> system("pause");
> }
> Ok, now please don't chew me out to bad for the mistakes that I made, and
> are common knowledge to everyone but me :p. thanks.
>
--
The Bible is not politically correct!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
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
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: jose i. c. <ji...@gm...> - 2005-04-13 17:50:19
|
Was that really needed?
Don't help, if you don't want to help.
On 4/13/05, Verne H. Bohlender <ve...@sy...> wrote:
> The answer to this is simple. READ A BOOK ON SIMPLE C++ AND LEARN THE
> FUNDAMENTALS FROM THE BOOK. There are an awful lot available if you do a
> simple search or go to a book store.
> Verne
>=20
>=20
> Hi. I'm new to programming, and don't know all the terminology, so please=
go
> easy on me.
> =20
> I'm trying to figure out how to create a include file so I can use it's
> functions in my programs, by just including it.
> =20
> Here's my simple test program that didn't work in the least ^^=20
> =20
> __________________________________________________
> =20
> the program I tried to link to:
>=20
> #include<iostream>
> =20
> using namespace std;
> =20
>=20
> int subten(int num)
> {
> num -=3D 10;
> return num;
> }
> The program I tried to link to the above with:
> =20
> #include <iostream>
> #include "subten"
> using namespace std;
> =20
> main()
> {
> =20
> int a =3D 20;
> cout << a << endl;=20
> a=3Dsubten(a);
> cout << a;
> =20
> system("pause");
> }
> Ok, now please don't chew me out to bad for the mistakes that I made, and
> are common knowledge to everyone but me :p. thanks.
> =20
--=20
The Bible is not politically correct!
|
|
From: <Mat...@Ve...> - 2005-04-13 14:49:00
|
That's not quite right. Use "" for includes unless it's a system header like iostream. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Mic Wagner Sent: Wednesday, April 13, 2005 7:40 AM To: dev...@li... Subject: [Dev-C++] [Linking error] undefined reference #include <C:\Documents and Settings\Gerard\Desktop\Math_home\Joshi\Test\Random1.h> ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: Verne H. B. <ve...@sy...> - 2005-04-13 14:40:51
|
The answer to this is simple. READ A BOOK ON SIMPLE C++ AND LEARN THE =
FUNDAMENTALS FROM THE BOOK. There are an awful lot available if you do =
a simple search or go to a book store.
Verne
Hi. I'm new to programming, and don't know all the terminology, so =
please go easy on me.
I'm trying to figure out how to create a include file so I can use =
it's functions in my programs, by just including it.
Here's my simple test program that didn't work in the least ^^=20
__________________________________________________
the program I tried to link to:
#include<iostream>
using namespace std;
int subten(int num)
{
num -=3D 10;
return num;
}
The program I tried to link to the above with:
#include <iostream>
#include "subten"
using namespace std;
main()
{
int a =3D 20;
cout << a << endl;=20
a=3Dsubten(a);
cout << a;
system("pause");
}
Ok, now please don't chew me out to bad for the mistakes that I made, =
and are common knowledge to everyone but me :p. thanks.
|