Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 2013 20:41:02 -0500
From:      Joe Nosay <superbisquit@gmail.com>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: template example
Message-ID:  <CA%2BWntOtkzfNmWML9f==Vd_3t_SaqZw00xX6bnN2KnSYa7eJ13g@mail.gmail.com>
In-Reply-To: <CA%2BWntOuiDfsga-863=pDW62YCE0AszmNsROCV5RvV15o_Sgx_w@mail.gmail.com>
References:  <CA%2BWntOv-jWRUkZ6jqg3DLrt-RTAAGMtKb5FJC6A6rZ1bsk213Q@mail.gmail.com> <FF822AF7-F72D-47BE-9A36-737F928A6995@kientzle.com> <CA%2BWntOtLh_1UTHad85JTUGzZg_GN307Di788dxN7nscj%2B9qE6w@mail.gmail.com> <CA%2BWntOs8wae8eYk0nTjTRHExewgi5ymMD6a-pDuFcShvDrwb5Q@mail.gmail.com> <B37DF780-A56A-4CCC-AFAD-EF834D0DE1CD@kientzle.com> <CA%2BWntOuiDfsga-863=pDW62YCE0AszmNsROCV5RvV15o_Sgx_w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 29, 2013 at 8:31 PM, Joe Nosay <superbisquit@gmail.com> wrote:

>
>
>
> On Sun, Dec 29, 2013 at 12:22 PM, Tim Kientzle <tim@kientzle.com> wrote:
>
>> On Dec 29, 2013, at 9:11 AM, Joe Nosay <superbisquit@gmail.com> wrote:
>>
>> >
>> > On Sat, Dec 28, 2013 at 10:44 PM, Joe Nosay <superbisquit@gmail.com>
>> wrote:
>> >
>> >
>> >
>> > On Sat, Dec 28, 2013 at 3:52 AM, Tim Kientzle <tim@kientzle.com> wrote=
:
>> >
>> > On Dec 27, 2013, at 7:41 PM, Joe Nosay <superbisquit@gmail.com> wrote:
>> >
>> > > The standard "Hello World!" doesn't seem to work.
>> >
>> > Which one?   Share the program you=92re trying to compile and what err=
ors
>> you=92re 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 =3D 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 t=
o
>> 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' directl=
y
>> 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 =3D system("echo 'ls /tmp' && echo blee bble blle");
>>
>> This type of programming (mixing C++ and shell) can get very confusing.
>>
>> Tim
>>
>>
>

I've looked at C and C++ and have decided that I should learn C first.
I'm very limited on money, so a book isn't going to do it. Does anyone have
any suggestions as to a decent to good website for working tutorials.
Nothing seems to include int main as with previous examples and that seems
to work somewhat. I've come up against code e.g. toybox, traverso, etc
which I would like to port to FreeBSD but the errors are such as::

"./kconfig/lxdialog/dialog.h:32:10: error: expected "FILENAME" or <FILENAME=
>
#include CURSES_LOC
         ^
./kconfig/lxdialog/dialog.h:97:2: error: unknown type name 'chtype'
        chtype atr;     /* Color attribute */
        ^
./kconfig/lxdialog/dialog.h:187:16: error: unknown type name 'WINDOW'
int on_key_esc(WINDOW *win);
               ^
"

and such.
I'm viewing C as having much more sanity than C++.

Apologies for the noise and thanks muchly to anyone who reads this.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BWntOtkzfNmWML9f==Vd_3t_SaqZw00xX6bnN2KnSYa7eJ13g>