Date: Mon, 18 Oct 2004 21:46:40 -0500 From: Vulpes Velox <v.velox@vvelox.net> To: Giorgos Keramidas <keramida@freebsd.org> Cc: chat@freebsd.org Subject: Re: learning c++ Message-ID: <20041018214640.6d110a53@vixen42.24-119-122-191.cpe.cableone.net> In-Reply-To: <20041018235001.GA99564@gothmog.gr> References: <20041018184016.3dbed7b8@vixen42.24-119-122-191.cpe.cableone.net> <20041018235001.GA99564@gothmog.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 19 Oct 2004 02:50:01 +0300
Giorgos Keramidas <keramida@freebsd.org> wrote:
> On 2004-10-18 18:40, Vulpes Velox <v.velox@vvelox.net> wrote:
> > Any one know of any good guides to learning C++, specifically in
> > regards to the newer gcc?
> >
> > Currently been messing with it a bit, but I am figuring that I am
> > doing something wrong... been messing with learning strings and
> > the like and I am getting a a.out that has a obscene size... 142kB
> > in size...
>
> Is your executable dynamically or statically linked? The following
> small C++ program builds into an a.out file of about 6 Kb, which is
> rather small -- certainly not hundreds of kilobytes.
>
> 1 #include <iomanip>
> 2 #include <iostream>
> 3
> 4 using namespace std;
> 5
> 6 int
> 7 main(void)
> 8 {
> 9 cout << "Hello C++ world" << endl;
> 10 return (0);
> 11 }
> giorgos@gothmog[02:45]/home/giorgos$ c++ -W -Wall hello.cc
> giorgos@gothmog[02:46]/home/giorgos$ ls -l a.out
> -rwxrwxr-x 1 giorgos giorgos 6952 Oct 19 02:46 a.out
> giorgos@gothmog[02:46]/home/giorgos$ ./a.out
> Hello C++ world
> giorgos@gothmog[02:46]/home/giorgos$ ldd a.out
> a.out:
> libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x28075000)
> libm.so.3 => /lib/libm.so.3 (0x28147000)
> libc.so.6 => /lib/libc.so.6 (0x28161000)
Managed to get it down to 248448, which appears to be the smallest
size I can manage to generate with c++... any ideas?
btw if it makes a difference, I am running 4stable
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041018214640.6d110a53>
