Go to advanced search

by swampdog
Sat Apr 09, 2016 12:17 am
Forum: C/C++
Topic: #error header must be compiled as C++
Replies: 5
Views: 3648

Re: #error header must be compiled as C++

I'm afraid you're git hub link doesn't work.
by swampdog
Fri Apr 01, 2016 10:06 pm
Forum: C/C++
Topic: Can't write .txt file
Replies: 5
Views: 1286

Re: Can't write .txt file

[must have been a glitch in my browser] Unix/Linux has two output streams. There's "stdout" and "stderr" (the input stream is "stdin"). Those are "C" terms. In C++ terminology they are "std::cout", "std::cerr" and "std::cin". Same thing on the command line really. It depends on the app but the gener...
by swampdog
Fri Apr 01, 2016 9:37 pm
Forum: C/C++
Topic: Can't write .txt file
Replies: 5
Views: 1286

Re: Can't write .txt file

sprinkmeier is most likely correct. Personally I prefer to perform such manipulations in memory. eg: #include <iostream> #include <sstream> #include <fstream> int main(void) {std::ostringstream x; x << "Hello C++ World" << std::endl; {std::ofstream f ("/tmp/z"); f << x.str(); if (f.bad()) std::cerr ...
by swampdog
Wed Mar 30, 2016 11:05 pm
Forum: C/C++
Topic: [solved] Trying to compile a game used on other linux
Replies: 2
Views: 767

Re: Trying to compile a game used on other linux

$ unzip vorton-src-beta2.zip 00.patch --- vorton/Makefile.linux.ORIGINAL 2016-03-30 22:45:18.075043520 +0000 +++ vorton/Makefile.linux 2016-03-30 22:49:14.582265492 +0000 @@ -5,7 +5,7 @@ STRIP= strip -CFLAGS = -Wall -Wno-switch -march=pentium -mcpu=pentium -DDEBUG \ +CFLAGS = -Wall -Wno-switch -DDEB...
by swampdog
Wed Mar 30, 2016 10:01 pm
Forum: C/C++
Topic: Makefile advice - compiling an old game from source
Replies: 4
Views: 1342

Re: Makefile advice - compiling an old game from source

I took a quick look. Actually it's written in C++. This is enough to get it to build.. $ git clone https://github.com/devpack/mayhem $ cd mayhem && rm -rf allegro442_include $ sudo apt-get install liballegro4.4 liballegro4-dev Modifiy these lines in 'Makefile', leave the rest unchanged: CPP = g++ CC...
by swampdog
Fri Mar 11, 2016 6:03 pm
Forum: Advanced users
Topic: iscsi & dhcp
Replies: 2
Views: 640

Re: iscsi & dhcp

Yes the pi is presented.. admin@pi05:~ $ sudo -i lsscsi [0:0:0:0] storage IET Controller 0001 - [0:0:0:1] disk IET VIRTUAL-DISK 0001 /dev/sda ..which corresponds to the 'tgt-admin -s' output which has *.53 as its connection ip address so to clarify the order of events is this: initrd7img <- *.53 fro...
by swampdog
Fri Mar 11, 2016 1:01 am
Forum: C/C++
Topic: Using namespace c++
Replies: 3
Views: 1379

Re: Using namespace c++

The namespace exists to stop things getting polluted. If I wrote a function called foo() and someone else writes another function called foo() they'd collide in what (iirc) is called the global namespace. #include <iostream> namespace a { void foo(){std::cout<<"a::foo\n";} }//namespace a namespace b...
by swampdog
Fri Mar 11, 2016 12:14 am
Forum: Advanced users
Topic: iscsi & dhcp
Replies: 2
Views: 640

iscsi & dhcp

Hi Folks, I'm stumped on this one. My dhcp server is (FreeBSD 8.2-RELEASE-p4).. admin@sdvmf64dns$ dhcpd --version isc-dhcpd-V3.1.2p1 The client is (Raspberry 4.1.18-v7+).. admin@pi05$ dhcpcd --version dhcpcd 6.7.1 I cross-compiled kernel7.img with "CONFIG_ISCSI_TCP=y" then generated an"initrd7.img" ...
by swampdog
Thu Dec 31, 2015 2:14 am
Forum: C/C++
Topic: is there a standard path to #include libs system-wide?
Replies: 4
Views: 713

Re: is there a standard path to #include libs system-wide?

You'd ordinarily build things from source thusly.. $ mkdir -p ~/usr/src/autoconf $ cd ~/usr/src/autoconf $ wget -c http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz $ tar xvJf autoconf-2.69.tar.xz $ mkdir obj && cd obj $ ../autoconf-2.69/configure --help $ ../autoconf-2.69/configure --prefix=/usr...
by swampdog
Thu Dec 31, 2015 1:00 am
Forum: C/C++
Topic: segmentation fault with gcc
Replies: 23
Views: 4239

Re: segmentation fault with gcc

otoh being initialized as zero is an advantage and you have a better overview, how much is used in total and usually, when I have subroutines, they use those variables too I dunno if this helps or will be more confusing.. $ nano -w c.c #include <stdio.h> #include <stdbool.h> #include <stdlib.h> boo...
by swampdog
Wed Dec 30, 2015 11:59 pm
Forum: Advanced users
Topic: Compile pwsafe
Replies: 8
Views: 1361

Re: Compile pwsafe

It will build under jessie. admin@pi05:~/T/pwsafe-3.37.1 $ pwd && cat 00.patch /home/admin/T/pwsafe-3.37.1 --- src/core/PwsPlatform.h.ORIGINAL 2015-12-30 18:59:04.482946108 +0000 +++ src/core/PwsPlatform.h 2015-12-30 19:04:38.609018301 +0000 @@ -142,6 +142,7 @@ // * Add other platforms here... * // ...
by swampdog
Sat Dec 12, 2015 3:11 am
Forum: Other programming languages
Topic: Date in Bash
Replies: 3
Views: 1730

Re: Date in Bash

Never mess with time.

Code: Select all

$ date "+%x %r %Z"
.. is likely what you wanted. Always log UTC (aka GMT time). A good format is..

YYYY-MM-DD-hh:mm:ss:[nano secs or whatever]

..because it is both language and timezone agnostic.
by swampdog
Fri Dec 04, 2015 12:44 pm
Forum: C/C++
Topic: c++ algorhitm
Replies: 8
Views: 1622

Re: c++ algorhitm

This is my first ever post so fingers-crossed! #include <iostream> #include <fstream> #include <string> #include <vector> #include <iterator> #include <algorithm> using namespace std; //beginners should not use this! int main() {ifstream ifs ("./z.dat"); string s; vector<int> v; //an array while (ge...

Go to advanced search