dev-cpp-users Mailing List for Dev-C++ (Page 213)
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: Per W. <pw...@ia...> - 2004-05-29 07:28:56
|
Of course you get. You are ignoring the first parameter, which specifies
number of parameters. If you don't give the program any arguments,
pszArgs[0] will be the name of your application, and pszArgs[1] will be
NULL. =C1 NULL pointer to strcmp isn't so nice!
By the way. How about cutting down a bit on your source code? I think the
source listing has been in this mailing list enough times now.
/Per W
On Sat, 29 May 2004, Noorez Kassam wrote:
> This program needs args passed to it with the cmd prompt. If it doesn't f=
ind
> any then it should display a message saying that you need the args but al=
l I
> get is an error message upon opening the program.
>
> #include <iostream>
> #include <cstdlib>
> #include <string>
> #include <conio.h>
> using namespace std;
>
> int main(int args, char* pszArgs[])//there needs to be args for this to w=
ork
> {
>
> if(strcmp(pszArgs[1],"-nt")=3D=3D 0)
> {
> system("cls");//start with a clear screen
> //explain what the heck all this does
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {//while
>
> choice =3D 0;
> cout << "\nEnter the number of your choice: ";
> cin >> choice;
> cin.sync();
> switch(choice)
> {//switch
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("mspaint");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> {
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin.getline(site,123);
> strcat(intern,site);
> system(intern);
> break;
> }
>
> default://the choice wasn't a valid one if we are at default
> cout << "Not a valid choice\n";
> }//switch
>
> }//end while
> }//done defining nt operating system
>
> else if(strcmp(pszArgs[1],"-me")=3D=3D0)
> {
> system("cls");
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {
> cout << endl << "Enter choice: ";
> cin >> choice;
> cin.sync();
> switch(choice)
> {
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("pbrush");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> {
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin.getline(site,123);
> strcat(intern,site);
> system(intern);
> break;
> }
>
> default:
> cout << "Not a valid choice\n";
> }//end switch
>
> }//end while
>
> }//end defining me operating system
>
> else
> {
> cout << "Args needed\n";
> system("pause");
> return 0;
> }
>
> return 0;//exit program
> }
>
> _________________________________________________________________
> MSN Premium includes powerful parental controls and get 2 months FREE*
> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D=
1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&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
>
|
|
From: Noorez K. <coo...@ho...> - 2004-05-29 07:10:57
|
This program needs args passed to it with the cmd prompt. If it doesn't find
any then it should display a message saying that you need the args but all I
get is an error message upon opening the program.
#include <iostream>
#include <cstdlib>
#include <string>
#include <conio.h>
using namespace std;
int main(int args, char* pszArgs[])//there needs to be args for this to work
{
if(strcmp(pszArgs[1],"-nt")== 0)
{
system("cls");//start with a clear screen
//explain what the heck all this does
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{//while
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
cin.sync();
switch(choice)
{//switch
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("mspaint");
break;
case 3:
system("calc");
break;
case 4:
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123);
strcat(intern,site);
system(intern);
break;
}
default://the choice wasn't a valid one if we are at default
cout << "Not a valid choice\n";
}//switch
}//end while
}//done defining nt operating system
else if(strcmp(pszArgs[1],"-me")==0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
cout << endl << "Enter choice: ";
cin >> choice;
cin.sync();
switch(choice)
{
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("pbrush");
break;
case 3:
system("calc");
break;
case 4:
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123);
strcat(intern,site);
system(intern);
break;
}
default:
cout << "Not a valid choice\n";
}//end switch
}//end while
}//end defining me operating system
else
{
cout << "Args needed\n";
system("pause");
return 0;
}
return 0;//exit program
}
_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: Noorez K. <coo...@ho...> - 2004-05-29 07:10:54
|
This program needs args passed to it with the cmd prompt. If it doesn't find
any then it should display a message saying that you need the args but all I
get is an error message upon opening the program.
#include <iostream>
#include <cstdlib>
#include <string>
#include <conio.h>
using namespace std;
int main(int args, char* pszArgs[])//there needs to be args for this to work
{
if(strcmp(pszArgs[1],"-nt")== 0)
{
system("cls");//start with a clear screen
//explain what the heck all this does
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{//while
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
cin.sync();
switch(choice)
{//switch
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("mspaint");
break;
case 3:
system("calc");
break;
case 4:
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123);
strcat(intern,site);
system(intern);
break;
}
default://the choice wasn't a valid one if we are at default
cout << "Not a valid choice\n";
}//switch
}//end while
}//done defining nt operating system
else if(strcmp(pszArgs[1],"-me")==0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
cout << endl << "Enter choice: ";
cin >> choice;
cin.sync();
switch(choice)
{
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("pbrush");
break;
case 3:
system("calc");
break;
case 4:
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123);
strcat(intern,site);
system(intern);
break;
}
default:
cout << "Not a valid choice\n";
}//end switch
}//end while
}//end defining me operating system
else
{
cout << "Args needed\n";
system("pause");
return 0;
}
return 0;//exit program
}
_________________________________________________________________
Add photos to your e-mail with MSN Premium. Get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: Per W. <pw...@ia...> - 2004-05-29 06:36:53
|
Don't declare variables within the switch statement without using braces,
to create a separate namespace for the variable!
switch (n) {
case 0:
{
int local_variable;
break;
}
default:
// because of braces, the local_variable isn't visible anymore.
}
/Per W
On Fri, 28 May 2004, Noorez Kassam wrote:
> I am having a problem with the case statement with both the switch
> statements in the program.
> They are both exactly the same really.... I marked the lines with errors
>
> The compile errors are
> [Warning] Infunction 'int main(int, char**)
> Line 57/110 Jump to case label
> Line 50/103 crosses initialization of 'char intern[16]';
>
> #include <iostream>
> #include <cstdlib>
> #include <string>
> using namespace std;
>
> int main(int args, char* pszArgs[])//there needs to be args for this to work
> {
> if(strcmp(pszArgs[1],"-nt")== 0)
> {
> system("cls");//start with a clear screen
> //explain what the heck all this does
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {//while
>
> choice = 0;
> cout << "\nEnter the number of your choice: ";
> cin >> choice;
> switch(choice)
> {//switch
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("mspaint");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> char site[123];
> char intern[] ="start iexplore "; /*50*/
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default://the choice wasn't a valid one if we are at default /*line
> 57*/
> cout << "Not a valid choice\n";
> }//switch
>
> }//end while
> }//done defining nt operating system
>
> if(strcmp(pszArgs[1],"-me")==0)
> {
> system("cls");
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {
> cout << endl << "Enter choice: ";
> cin >> choice;
> switch(choice)
> {
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("pbrush");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> char site[123];
> char intern[] ="start iexplore "; /*103*/
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default: /*line 110*/
> cout << "Not a valid choice\n";
> }//end switch
>
> }//end while
>
> }//end defining me operating system
>
> if(strcmp(pszArgs[1],NULL)==0 )//opps! nothing found!
> {
> cout << "This program requries the use of Args\n"
> << "Use the name of your operating system\n"
> << "eg... -me for Millenium Edition\n\n";
>
> cout << "Open a command prompt window and type pszArgs[0] -<short name
> of system>";
> cout << "Just don't use the << ";
>
> system("pause");
> return 1;
> }
>
> return 0;//exit program
> }
>
> _________________________________________________________________
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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
>
|
|
From: Noorez K. <coo...@ho...> - 2004-05-29 05:34:20
|
I am having a problem with the case statement with both the switch
statements in the program.
They are both exactly the same really.... I marked the lines with errors
The compile errors are
[Warning] Infunction 'int main(int, char**)
Line 57/110 Jump to case label
Line 50/103 crosses initialization of 'char intern[16]';
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int args, char* pszArgs[])//there needs to be args for this to work
{
if(strcmp(pszArgs[1],"-nt")== 0)
{
system("cls");//start with a clear screen
//explain what the heck all this does
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{//while
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
switch(choice)
{//switch
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("mspaint");
break;
case 3:
system("calc");
break;
case 4:
char site[123];
char intern[] ="start iexplore "; /*50*/
cout << "Enter site: ";
cin >> site;
strcat(intern,site);
system(intern);
break;
default://the choice wasn't a valid one if we are at default /*line
57*/
cout << "Not a valid choice\n";
}//switch
}//end while
}//done defining nt operating system
if(strcmp(pszArgs[1],"-me")==0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
cout << endl << "Enter choice: ";
cin >> choice;
switch(choice)
{
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("pbrush");
break;
case 3:
system("calc");
break;
case 4:
char site[123];
char intern[] ="start iexplore "; /*103*/
cout << "Enter site: ";
cin >> site;
strcat(intern,site);
system(intern);
break;
default: /*line 110*/
cout << "Not a valid choice\n";
}//end switch
}//end while
}//end defining me operating system
if(strcmp(pszArgs[1],NULL)==0 )//opps! nothing found!
{
cout << "This program requries the use of Args\n"
<< "Use the name of your operating system\n"
<< "eg... -me for Millenium Edition\n\n";
cout << "Open a command prompt window and type pszArgs[0] -<short name
of system>";
cout << "Just don't use the << ";
system("pause");
return 1;
}
return 0;//exit program
}
_________________________________________________________________
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: <da...@si...> - 2004-05-29 02:07:50
|
Hello, Is there another method of passing data from Dialog Boxes to callback functions without using global variables? Regards, Eduardo Aviles |
|
From: Brian D. <bri...@ms...> - 2004-05-29 01:08:14
|
You have to link the GDI library in. If it's a standalone/non- project file, then go to Compiler Options and add -lgdi32 to the link command line. If it's a project, go to Project Options->Parameters and add -lgdi32 to the Linker. Thanks for the clarification. Everything works fine...so far! Brian In general, if you have a function or functions that aren't getting linked in, you can search for the function names in the lib directory. The file will be named something like libgdi32.a. You include that into the linker by adding -l and then stripping of the lib and the '.a'. BTW, if you have Windows XP, then your search function is "broken". Read this: http://www.pcmag.com/article2/0,4149,1202777,00.asp HTH. Watson Davis |
|
From: Daniel K. O. <dan...@ya...> - 2004-05-28 22:33:34
|
Per Westermark wrote: >`pkg-config gtk+-2.0 --libs` is nice if you have a shell that may expand >the command. > >For normal windows use, you have to hard-code the parameters on the >command line. If pkg-config itself is runnable, it is possible to run it >and use the printed output as parameters. > > Fortunately, GNU Make expands the command exactly like a shell. :) Daniel K. O. |
|
From: Per W. <pw...@ia...> - 2004-05-28 22:05:03
|
`pkg-config gtk+-2.0 --libs` is nice if you have a shell that may expand the command. For normal windows use, you have to hard-code the parameters on the command line. If pkg-config itself is runnable, it is possible to run it and use the printed output as parameters. /Per W On Fri, 28 May 2004, Daniel K. O. wrote: > Alf C Stockton wrote: > > >Is anyone on either of these lists using gtk+ to develop applications to run > >on Microsoft Windows? In C ? > > > > > > I'm one of the maintainers of a port of Lopster (a Napster/IRC client). > http://winlop.sourceforge.net > > > >If yes are you using Dev-C++? > > > > > Yes. And I also have installed all the MinGW toys (MinGW, MSYS, MSYS > Developer Tool Kit, MinGW utils, binutils, gdb, etc). > > > > PS1: By the way, you guys were discussing a while ago about the flags to > use in GTK+ apps... why don't just use `pkg-config gtk+-2.0 --cflags` in > the compiler flags and `pkg-config gtk+-2.0 --libs` in the linker flags, > as it says in the docs? (and obviously the -mms-bitfields and > -mno-cygwin options) Of course, considering you have pkg-config. > > PS2: by the way, Tor, is it really needed to use -mno-cygwin (as you > always tell everybody) when compiling with MinGW? Isn't it the default > for MinGW? > > > Daniel K. O. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 > |
|
From: Daniel K. O. <dan...@ya...> - 2004-05-28 21:40:33
|
Alf C Stockton wrote: >Is anyone on either of these lists using gtk+ to develop applications to run >on Microsoft Windows? In C ? > > I'm one of the maintainers of a port of Lopster (a Napster/IRC client). http://winlop.sourceforge.net >If yes are you using Dev-C++? > > Yes. And I also have installed all the MinGW toys (MinGW, MSYS, MSYS Developer Tool Kit, MinGW utils, binutils, gdb, etc). PS1: By the way, you guys were discussing a while ago about the flags to use in GTK+ apps... why don't just use `pkg-config gtk+-2.0 --cflags` in the compiler flags and `pkg-config gtk+-2.0 --libs` in the linker flags, as it says in the docs? (and obviously the -mms-bitfields and -mno-cygwin options) Of course, considering you have pkg-config. PS2: by the way, Tor, is it really needed to use -mno-cygwin (as you always tell everybody) when compiling with MinGW? Isn't it the default for MinGW? Daniel K. O. |
|
From: Tor L. <tm...@ik...> - 2004-05-28 20:29:58
|
Alf C Stockton writes: > Is anyone on either of these lists using gtk+ to develop applications to run > on Microsoft Windows? In C ? Sure. > If yes are you using Dev-C++? No. > If no what are you using? XEmacs, mingw, autotools, Cygwin. --tml |
|
From: <de...@ci...> - 2004-05-28 20:26:51
|
Let's go through your examples one by one.
int nArray[5]={1,2,3,4,5};
This declares an array of 5 ints, and initialises them to the values 1-5.
In terms of storage, the array and all the contents are on the stack.
nArray has type int[5] , i.e. an array of five ints.
cout << nArray << endl;
This passes nArray to the stream functions. The type int[5] easily
converts to int*.
Now the act of moving nArray to cout causes C++ to look for an overloaded
function operator<<(ostream, int*). Now there is no such overloading, so
the pointer is converted to a long, leading the the value of the pointer
being printed.
char sArray[6]={'h','e','l','l','o',\0};
Now the type of sArray is char[6] , i.e. an array of 6 chars.
As before the whole array is on the stack.
cout << sArray << endl;
Now in this case sArray easily converts from char[6] to char*.
There *is* an overloaded function operator<<(ostream, char*) as that's
what's used to print a string ; hence the string is printed.
So that's why the two arrays are handled differently.
char* pszString = "hello";
In this case the string "hello" is put into the static data segment during
compilation, and the initialiser sets the value of the pointer to point to
that stored string.
So there isn't an attempt to assign a long string into a short pointer at
all. In fact you can do this with assignments as well as initialisors
because the expression "hello" returns a char*. So all you're ever doing
is assigning one pointer to another.
char String[] = "hello";
char *pszString2 = String;
Because you've defined an array of characters, it is initialised to the
contents of the string, not a pointer to it. The size of the array is
set to the size of the string assigned, i.e. 6 including the null.
So String is an array of characters exactly as sArray was, and so resolves
to a char* and hence cout << String yields the contents.
And pszString2 is initialised to point to the same address and you get the
same result.
if you were to add the following lines:
cout << static_cast<void*>(sArray) << endl;
cout << static_cast<void*>(pszString) << endl;
cout << static_cast<void*>(String) << endl;
cout << static_cast<void*>(pszString2) << endl;
Then the pointer contents will be printed.
You will see that pszString is a very different value than the other
three, whereas String and pszString2 should be identical.
In article <BAY...@ho...>,
coo...@ho... (Noorez Kassam) wrote:
> I have asked questions about pointers and arrays but all the answers
> are not that great. Maybe I was unclear so I will explain my questions
> better...
> first...
>
> int main()
> {
> int nArray[5]={1,2,3,4,5};
> cout << nArray << endl;/*this gives the address of the array*/
> char sArray[6]={'h','e','l','l','o',\0};
> cout << sArray << endl;/*this give the string hello, but i used the
> name of the array without subscripts? Don't i get the address of it
> like in the int array?*/
>
> char* pszString = "hello";/*strangest of all*/
> /*this looks as if you were trying to put "hello" where the address
> of a char would go.*/
>
> char String[] = "hello";
> char *pszString2 = String;/*looks less confusing because the address
> of the array would get assigned to 'pszString2' because of using the
> name of the array without a subscript, but still is confusing because
> cout the name of the char array without subscripts gives you the
> string*/
>
> _________________________________________________________________
> MSN Premium includes powerful parental controls and get 2 months FREE*
>
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU
> =http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle
> 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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
>
|
|
From: Alf C S. <al...@st...> - 2004-05-28 18:10:33
|
Some questions I should have asked before starting my current project. Is anyone on either of these lists using gtk+ to develop applications to run on Microsoft Windows? In C ? If yes are you using Dev-C++? If no what are you using? --- Regards, Alf Stockton www.stockton.co.za The world is coming to an end ... SAVE YOUR BUFFERS!!! |
|
From: Rafael C. <cha...@un...> - 2004-05-28 14:53:54
|
Hi,
I think the answers to your question were great.
Maybe it's not clear to you that we can have
int, float, double, char and other data types
arrays, **but when it comes to char arrays,
things are different**.
The point to consider is: there are things you
can do only with char arrays and pointers and
I/O functions (e.g. cout) can demonstrate that.
Suggestion: read more about C strings (not C++ "string" type).
Google: c array pointers (returns a lot of sites)
Hope this helps you.
Rafael
Noorez Kassam wrote:
> I have asked questions about pointers and arrays but all the answers are
> not that great. Maybe I was unclear so I will explain my questions
> better...
> first...
>
> int main()
> {
> int nArray[5]={1,2,3,4,5};
> cout << nArray << endl;/*this gives the address of the array*/
> char sArray[6]={'h','e','l','l','o',\0};
> cout << sArray << endl;/*this give the string hello, but i used the
> name of the array without subscripts? Don't i get the address of it
> like in the int array?*/
>
> char* pszString = "hello";/*strangest of all*/
> /*this looks as if you were trying to put "hello" where the address of
> a char would go.*/
>
> char String[] = "hello";
> char *pszString2 = String;/*looks less confusing because the address
> of the array would get assigned to 'pszString2' because of using the
> name of the array without a subscript, but still is confusing because
> cout the name of the char array without subscripts gives you the string*/
>
> _________________________________________________________________
> MSN Premium includes powerful parental controls and get 2 months FREE*
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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
>
|
|
From: Jorge A. <jor...@ep...> - 2004-05-28 14:51:23
|
Oppsss!, I miss the point.. I feel stupid :-(
Jorge Alzate escribi=F3:
> A clue: is the same '1' than 1?, are you sure?
>
> Noorez Kassam escribi=F3:
>
>> something is wrong with the both the switch statements.
>>
>> #include <iostream>
>> #include <cstdlib>
>> #include <string>
>> using namespace std;
>>
>> int main(int args, char* pszArgs[])//there needs to be args for this=20
>> to work
>> {
>> if(strcmp(pszArgs[1],"-nt")=3D=3D 0)
>> {
>> system("cls");//start with a clear screen
>> //explain what the heck all this does
>> cout << "Welcome to the easy program opener!\n";
>> cout << "Hear is a list of programs that can be easy opened\n\n";
>> cout << "To quit enter 0 or nothing for a program choice\n";
>>
>> cout << "1. Microsoft Office\n";
>> cout << "2. Microsoft Paint\n";
>> cout << "3. Calculator\n";
>> cout << "4. Internet Explorer\n";
>>
>> int choice;
>> while(1)
>> {//while
>>
>> choice =3D 0;
>> cout << "\nEnter the number of your choice: ";
>> cin >> choice;
>> switch(choice)
>> {//switch
>> case 0:
>>
>> cout << "Exiting easy opener...\n";
>> //Sleep(1000);
>> return 0;
>> break;
>>
>> case 1:
>> system("start winword");
>> break;
>>
>> case 2:
>> system("mspaint");
>> break;
>>
>> case 3:
>> system("calc");
>> break;
>>
>> case 4:
>> char site[123];
>> char intern[] =3D"start iexplore ";
>> cout << "Enter site: ";
>> cin >> site;
>> strcat(intern,site);
>> system(intern);
>> break;
>>
>> default://the choice wasn't a valid one if we are at default
>> cout << "Not a valid choice\n";
>> }//switch
>>
>> }//end while
>> }//done defining nt operating system
>>
>> if(strcmp(pszArgs[1],"-me")=3D=3D0)
>> {
>> system("cls");
>> cout << "Welcome to the easy program opener!\n";
>> cout << "Hear is a list of programs that can be easy opened\n\n";
>> cout << "To quit enter 0 or nothing for a program choice\n";
>>
>> cout << "1. Microsoft Office\n";
>> cout << "2. Microsoft Paint\n";
>> cout << "3. Calculator\n";
>> cout << "4. Internet Explorer\n";
>>
>> int choice;
>> while(1)
>> {
>> cout << endl << "Enter choice: ";
>> cin >> choice;
>> switch(choice)
>> {
>> case 0:
>> cout << "Exiting easy opener...\n";
>> //Sleep(1000);
>> return 0;
>> break;
>>
>> case 1:
>> system("start winword");
>> break;
>>
>> case 2:
>> system("pbrush");
>> break;
>>
>> case 3:
>> system("calc");
>> break;
>>
>> case 4:
>>
>> char site[123];
>> char intern[] =3D"start iexplore ";
>> cout << "Enter site: ";
>> cin >> site;
>> strcat(intern,site);
>> system(intern);
>> break;
>>
>> default:
>> cout << "Not a valid choice\n";
>> }//end switch
>>
>> }//end while
>>
>> }//end defining me operating system
>>
>> if(strcmp(pszArgs[1],NULL)=3D=3D0 )//opps! nothing found!
>> {
>> cout << "This program requries the use of Args\n"
>> << "Use the name of your operating system\n"
>> << "eg... -me for Millenium Edition\n\n";
>>
>> cout << "Open a command prompt window and type pszArgs[0] -<short=20
>> name of system>";
>> cout << "Just don't use the << ";
>>
>> system("pause");
>> return 1;
>> }
>>
>> return 0;//exit program
>> }
>>
>> _________________________________________________________________
>> MSN Premium with Virus Guard and Firewall* from McAfee=AE Security : 2=
=20
>> months FREE* =20
>> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=
=3D1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines=20
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: Oracle 10g
>> Get certified on the hottest thing ever to hit the market... Oracle=20
>> 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
>> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&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
>>
>
>
|
|
From: Jorge A. <jor...@ep...> - 2004-05-28 14:43:25
|
A clue: is the same '1' than 1?, are you sure?
Noorez Kassam escribi=F3:
> something is wrong with the both the switch statements.
>
> #include <iostream>
> #include <cstdlib>
> #include <string>
> using namespace std;
>
> int main(int args, char* pszArgs[])//there needs to be args for this=20
> to work
> {
> if(strcmp(pszArgs[1],"-nt")=3D=3D 0)
> {
> system("cls");//start with a clear screen
> //explain what the heck all this does
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {//while
>
> choice =3D 0;
> cout << "\nEnter the number of your choice: ";
> cin >> choice;
> switch(choice)
> {//switch
> case 0:
>
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("mspaint");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default://the choice wasn't a valid one if we are at default
> cout << "Not a valid choice\n";
> }//switch
>
> }//end while
> }//done defining nt operating system
>
> if(strcmp(pszArgs[1],"-me")=3D=3D0)
> {
> system("cls");
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {
> cout << endl << "Enter choice: ";
> cin >> choice;
> switch(choice)
> {
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("pbrush");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
>
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default:
> cout << "Not a valid choice\n";
> }//end switch
>
> }//end while
>
> }//end defining me operating system
>
> if(strcmp(pszArgs[1],NULL)=3D=3D0 )//opps! nothing found!
> {
> cout << "This program requries the use of Args\n"
> << "Use the name of your operating system\n"
> << "eg... -me for Millenium Edition\n\n";
>
> cout << "Open a command prompt window and type pszArgs[0] -<short=20
> name of system>";
> cout << "Just don't use the << ";
>
> system("pause");
> return 1;
> }
>
> return 0;//exit program
> }
>
> _________________________________________________________________
> MSN Premium with Virus Guard and Firewall* from McAfee=AE Security : 2=20
> months FREE* =20
> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D=
1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines=20
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle=20
> 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&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
>
|
|
From: Nicolas R. <ni...@bo...> - 2004-05-28 14:41:59
|
Let me clarify something:
> What's going on behind the scenes there is that the string "hello"
> gets created "on the fly" by the compiler as a constant array of chars
> that contains {'h', 'e', 'l', 'l', 'o', \0}. Then you create a
> pointer-to-char called pszString. What does the assignment do? It just
> copies the address.
Which works because, just in the same way that the name of an array is
always a pointer, a constant string embedded in the code (a
"hard-coded" string) *is* an array, so "it" is a pointer. It just has
no name (until you copy its address to pszString, and from that moment
on you'll refer to it by that denomination, right?)
N.
|
|
From: Nicolas R. <ni...@bo...> - 2004-05-28 14:37:40
|
Hello Noorez,
> I have asked questions about pointers and arrays but all the answers=20=
> are not that great. Maybe I was unclear so I will explain my questions=20=
> better...
Thank you for the compliments. For great answers, I'd suggest (for the=20=
second time) that you google for some tutorials and reference. For even=20=
better answers, you can try reading the K&R ("The C Programming=20
Language) and/or Stroustroup's book ("The C++ Programming Language").
> int nArray[5]=3D{1,2,3,4,5};
> cout << nArray << endl;/*this gives the address of the array*/
Correct, because the name of an array of T is always a T* (a pointer to=20=
T). All arrays are pointers (implicitly).
> char sArray[6]=3D{'h','e','l','l','o',\0};
> cout << sArray << endl;/*this give the string hello, but i used the=20=
> name of the array without subscripts? Don't i get the address of it=20=
> like in the int array?*/
No, you get the string instead of the address because, as I told you=20
before, arrays of char get treated in a special way (due to the fact=20
that, in plain old C, they were the only way to represent strings of=20
characters). If you really want the address, you could cast the pointer=20=
to some other type first. If you don't know what 'to cast' means,=20
please look it up in TFM.
Again, as Per already said,
> cout always assumes that a pointer to a char is not just a pointer to=20=
> a single character but actually a pointer to the first character of a=20=
> zero-terminated string
Next question:
> char* pszString =3D "hello";/*strangest of all*/
> /*this looks as if you were trying to put "hello" where the address=20=
> of a char would go.*/
The easy way to think about this is the one I already said: C/C++=20
provide special syntax to assign constant strings into arrays of char.=20=
(It would be rather unpractical if they didn't.)
What's going on behind the scenes there is that the string "hello" gets=20=
created "on the fly" by the compiler as a constant array of chars that=20=
contains {'h', 'e', 'l', 'l', 'o', \0}. Then you create a=20
pointer-to-char called pszString. What does the assignment do? It just=20=
copies the address. So pszString now points to the same place where the=20=
compiler stored the array containing the constant string.
Good luck with your C/C++ learning. You will encounter many, many such=20=
quirks along the way. Please try to use the excellent and free FAQs and=20=
tutorials around. They are your friends.
Regards,
Nicol=E1s
|
|
From: <dan...@ya...> - 2004-05-28 14:19:41
|
--- Noorez Kassam <coo...@ho...>
escreveu: > I have asked questions about pointers and
arrays but
> int nArray[5]={1,2,3,4,5};
> cout << nArray << endl;/*this gives the address
> of the array*/
Yes, this is the default for pointers; if you use just
the name of the array, you get the address of the
begining of the array; so nArray acts just like a
pointer.
> char sArray[6]={'h','e','l','l','o',\0};
> cout << sArray << endl;/*this give the string
> hello, but i used the name
> of the array without subscripts? Don't i get the
> address of it like in the
> int array?*/
No. The << operator for ostream's is overloaded to
handle pointers to char (char*) in a special way. If
you cast your sArray (when you're printing it) to
another type, like void*, you'll get the address. i
suggest you to start first with C, not with C++. Or
get yourself a good book (D&D, TC++PL and so on).
> char* pszString = "hello";/*strangest of all*/
Isn't strange at all. You are declaring a C string
constant, and pointing pszString to it.
Daniel K. O.
______________________________________________________________________
Participe da pesquisa global sobre o Yahoo! Mail:
http://br.surveys.yahoo.com/global_mail_survey_br
|
|
From: Noorez K. <coo...@ho...> - 2004-05-28 13:45:01
|
I have asked questions about pointers and arrays but all the answers are not
that great. Maybe I was unclear so I will explain my questions better...
first...
int main()
{
int nArray[5]={1,2,3,4,5};
cout << nArray << endl;/*this gives the address of the array*/
char sArray[6]={'h','e','l','l','o',\0};
cout << sArray << endl;/*this give the string hello, but i used the name
of the array without subscripts? Don't i get the address of it like in the
int array?*/
char* pszString = "hello";/*strangest of all*/
/*this looks as if you were trying to put "hello" where the address of a
char would go.*/
char String[] = "hello";
char *pszString2 = String;/*looks less confusing because the address of
the array would get assigned to 'pszString2' because of using the name of
the array without a subscript, but still is confusing because cout the name
of the char array without subscripts gives you the string*/
_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: Alf C S. <al...@st...> - 2004-05-28 10:02:04
|
On Tue, 25 May 2004, Tor Lillqvist wrote:
> Alf C Stockton writes:
> > I am now getting Gtk-ERROR** Incompatible Build when I attempt to
> > run my Linux developed application on Windows.
>
> > Suggestions and or help please.
>
> Doesn't the message say what to do? This message comes from this
> g_error() call:
>
> g_error ("Incompatible build!\n"
> "The code using GTK+ thinks GtkWindow is of different\n"
> "size than it actually is in this build of GTK+.\n"
> "On Windows, this probably means that you have compiled\n"
> "your code with gcc without the -fnative-struct\n"
> "(or -mms-bitfields) switch, or that you are using\n"
> "an unsupported compiler.");
>
> I.e. you need to compile your source code with the -mms-bitfields gcc
> switch.
>
Thank you for this suggestion but when I attempt it by adding the -mms-bitfields
to the linker options I still get "Incompatible build!" & when I add it to the
compiler switches I get output filename specified twice from cc1.exe.
I get the same effect if I use -fnative-struct so now I am really confused.
---
Regards,
Alf Stockton www.stockton.co.za
When I said "we", officer, I was referring to myself, the four young
ladies, and, of course, the goat.
|
|
From: <gen...@ya...> - 2004-05-28 09:23:04
|
k, here's the dubs: if you use dev-c++ to create a project and specify the target as win32 gui, the 3 libraries get auto-linked in. the ide does everything. if you were using gcc from a command line, you'd have to specify -mwindows as a link option, or manually (i don't know if it would work) link in libkernel32.a, libuser32.a, libgdi32.a. if you were using msvc++ (the ide, if you're using the toolkit, you'll have to specify the libs manually), you'ld see that those 3 libs are always autolinked in. wa...@wa... wrote:On 28 May 2004 at 8:51, Oladipo Odumosu wrote: > the kernel32 and user32 libraries aren't for GDI. > they're for basic Windows services. kernel32 handles > OS interfacing, and user32 handles the UI. there are > some function calls that one might think belong to the > GDI set, but actually are UI functions. example is > DrawText(), which iirc uses a device context, which is > GDI-related. for Win32 programs generally, just link > with all 3, that is libkernel32.a, libuser32.a, and > libgdi32.a, so you don't miss anything. Are they automatically linked in? To the best of my knowledge, I've never had to link those libraries into anything I've compiled... including DrawText and any of the example programs from Petzold's book or Hart's Win32 System programming book or any of the graphics books I've played around with. Watson ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |
|
From: <wa...@wa...> - 2004-05-28 09:01:14
|
On 28 May 2004 at 8:51, Oladipo Odumosu wrote: > the kernel32 and user32 libraries aren't for GDI. > they're for basic Windows services. kernel32 handles > OS interfacing, and user32 handles the UI. there are > some function calls that one might think belong to the > GDI set, but actually are UI functions. example is > DrawText(), which iirc uses a device context, which is > GDI-related. for Win32 programs generally, just link > with all 3, that is libkernel32.a, libuser32.a, and > libgdi32.a, so you don't miss anything. Are they automatically linked in? To the best of my knowledge, I've never had to link those libraries into anything I've compiled... including DrawText and any of the example programs from Petzold's book or Hart's Win32 System programming book or any of the graphics books I've played around with. Watson |
|
From: Per W. <pw...@ia...> - 2004-05-28 09:00:04
|
When they are inlined, they are not linked. The compiler throws in suitable assembler instructions directly. When the inline function isn't inlined - because it is too large etc - normally all source files that saw the inline declaration will get a "common" code block with the function code. The function then works as any other function with the extra feature that the linker doesn't complain if multiple object files specifies the function. The linker just selects one instance of the function and throws away the other instances. /Per W On Fri, 28 May 2004, Siva Chandra wrote: > > Hello all, > > That was insightfull but also lead to another > question. > How do inline functions get linked? > > Siva Chandra > > --- Damien A <g_...@ho...> wrote: > > --------------------------------- > > > "ld (and therefore gcc) is sensitive about the order > in which libraries and object > files are specied on the command line. If libfoo.so > depends on libbar.so, you > must specify libfoo.so first (as counterintuitive as > this may be). The reason is > that ld keeps track only of unresolved symbols as it > links. If libfoo.so and > libbar.so depend on each other, one of the libraries > will have to be specified > twice (for example, -lfoo -lbar -lfoo)." -Programming > Linux Games , pg 33 > > > > > > __________________________________ > Do you Yahoo!? > Friends. Fun. Try the all-new Yahoo! Messenger. > http://messenger.yahoo.com/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 > |
|
From: Siva C. <siv...@ya...> - 2004-05-28 08:37:21
|
Hello all, That was insightfull but also lead to another question. How do inline functions get linked? Siva Chandra --- Damien A <g_...@ho...> wrote: --------------------------------- "ld (and therefore gcc) is sensitive about the order in which libraries and object files are specied on the command line. If libfoo.so depends on libbar.so, you must specify libfoo.so first (as counterintuitive as this may be). The reason is that ld keeps track only of unresolved symbols as it links. If libfoo.so and libbar.so depend on each other, one of the libraries will have to be specified twice (for example, -lfoo -lbar -lfoo)." -Programming Linux Games , pg 33 __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |