Re: [newbie] Help with learning to program

2002-11-16 Per discussione David C. Fox
wrnash wrote:


Hello,

 

 

I?m trying to learn to program in c++.  I bought a book and I install 
the software on a windows machine and was able to run my first program.  
Now I would like to run this on a linux mandrake 9.0 machine.  I do not 
know how to do this.  This is the program I use from the book.

 

#includeiostream

 

int main()

{

std::cout?Hello, new world!\n?;

}

Sorry if this is the wrong newsgroup.


Probably, but since you're here...




 

I type the following and I get a error

Gcc hello.cpp


In general, it would be helpful if you report the specific error, as 
well as the version of gcc you are using (gcc --version should tell you).

When I try this on Mandrake 8.1, gcc 2.96, I get errors from the linker, 
ld, about undefined references to cout and ostream::operator. 
However, if I type

g++ hello.cpp

it compiles and runs fine.  It likes like gcc (2.96 at least) doesn't 
assume from the filename extension that you are compiling C++ rather 
than C (or at least doesn't automatically link with the proper 
libraries).  I'm rather surprised at that, but anyway try using g++ and 
see if that works.



Is there a program I can use like visual c++ 6.0 under linux.



I'm not so familiar with C++ integrated development environments for 
Linux, so I'll have to let someone else answer that.



Thanks Bill Nash

 






Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



[newbie] DHCP client problems

2002-11-08 Per discussione David C. Fox
I've been using Mandrake 8.1 quite happily for some months with a fixed 
local (192.168.123.x) IP address on a home network.  I'm connected to 
the internet via a dedicated firewall/router attached to my ATT 
Broadband cable modem.

Unfortunately, ATT just switched from DNS servers with fixed IP 
addresses to ones with dynamic IP addresses, so I have to switch my 
linux box to use DHCP, so that it gets the right addresses for the name 
servers, and I'm having major problems.

I used the Connection panel under Network  Internet in the Mandrake 
Control Center to switch to using DHCP.  However, once I do that, lots 
of programs start complaining that they can't find the IP address 
corresponding to my host name, aclinux:

1.  when I boot the computer, it no longer boots to the graphical login 
screen, but instead gives me the text login.  When I log in and check 
the syslog, I see messages like:

Nov 9 01:40:44 aclinux gdm[1909]: gdm_auth_secure_display: Error getting 
hentry for aclinux
... gdm[1897]: Failed to start the display server several times in a 
short time period; disabling display :0

2.  If I log in in text mode and then type startx, X and Gnome start, 
but Gnome prints another warning about not being able to find the host 
IP, and how it won't work properly without it.

3.  proftpd gives a message:

proftpd: aclinux - Fatal: unable to determine IP address of `aclinux`

and dies, so now I have internet access, but no ftp access

My Windows 98 machine on the same network has no problem resolving 
aclinux to the DHCP-assigned address.  I can find the DHCP-assigned IP 
address for my linux box manually by looking in the 
/var/lib/dhcp/dhclient.leases file.

I suppose I could write a script to modify /etc/hosts on startup, 
(though I don't know where to put that script to ensure that it runs 
before the login or proftpd startup) but it seems like there must be a 
standard way to do this.

Thanks in advance for any help,
David


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com