template example
Joe Nosay
superbisquit at gmail.com
Mon Dec 30 01:31:56 UTC 2013
On Sun, Dec 29, 2013 at 12:22 PM, Tim Kientzle <tim at kientzle.com> wrote:
> On Dec 29, 2013, at 9:11 AM, Joe Nosay <superbisquit at gmail.com> wrote:
>
> >
> > On Sat, Dec 28, 2013 at 10:44 PM, Joe Nosay <superbisquit at gmail.com>
> wrote:
> >
> >
> >
> > On Sat, Dec 28, 2013 at 3:52 AM, Tim Kientzle <tim at kientzle.com> wrote:
> >
> > On Dec 27, 2013, at 7:41 PM, Joe Nosay <superbisquit at gmail.com> wrote:
> >
> > > The standard "Hello World!" doesn't seem to work.
> >
> > Which one? Share the program you’re trying to compile and what errors
> you’re seeing.
> >
> > Tim
> >
> >
> >
> >
> > Thanks @Alfred_Perlstein it worked with that example using clang
> -fsyntax-only h.cpp
> >
> > a.out is the file.
>
> Never post binaries to a mailing list. It's rather rude.
>
My apologies.
>
>
> > Trying a different approach with :::
> > #include <iostream>
> >
> > #include <stdlib.h>
> >
> > int
> > main(int Argc, char **Argv)
> > {
> > int rv;
> >
> > rv = system("echo 'ls /tmp' " && " echo blee bble blle ");
> > std::cout << "return status from system call is: " << rv <<
> std::endl;
> > return (rv);
> > }
> >
> >
> >
> > The output comes before the blee and the blee is not printed. What I
> need is for the output to be listed - or the act
> > ion to be executed - along with the echo. This time, clang -E
> -fsyntax-only h.cpp was used with no a.out being created. What was the
> difference between Perlstein's script and mine?
>
> Why are you using -E option here? The -E option actually tells clang to
> not compile the program, which is why you got no a.out file.
>
> You should also probably not get into the habit of using 'clang' directly
> but instead use the standard 'cc' or 'c++' commands. These are just
> aliases for the default system compiler. You can find out what compiler
> that is by asking it:
>
> $ cc --version
> FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
>
>
> As for your program above, the && is outside of the quotations, so it's
> not doing what you expect.
>
> Try this line instead:
>
> rv = system("echo 'ls /tmp' && echo blee bble blle");
>
> This type of programming (mixing C++ and shell) can get very confusing.
>
> Tim
>
>
More information about the freebsd-hackers
mailing list