You should at least use a library for the C++ runtime support. I am not sure
whether -lgcc will supply these functions for you. You should be able to
compile this program, but most probably you will get some linker errors for
the missing functions.
The Lost Wizard wrote:
> I'm trying to build a program which uses the core C++ language but does
> not use libstdc++ (i.e. I don't need iostream and friends.) The way I'm
> reading the documentation, I should be able to compile the following
> program using "g++ -nodefaultlibs -lgcc":
>
> ======
> void main()
> {
> int *value;
>
> value = new int;
>
> *value = 2;
>
> delete value;
> }
>
> ======
>
> It intentionally does nothing, but it should compile, should it not? I am
> using gcc 2.8.1 on Linux 2.1.129. Any insights would be appreciated. (I'm
> assuming that if I were to use anything like "exit()", I would need to add
> -lc to the command line)
>
> Thanks in advance.
>
> William Astle
>
> ------------------------------
> Floppity, floppity, flip
> The mouse on the mobius strip;
> The strip revolved,
> The mouse dissolved
> In a chronodimensional skip.
> ------------------------------