Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Works for me:</p> <pre><code>$ cat main.h #pragma once class Foo; struct FoobarPackage { FoobarPackage(Foo *fooObj) { soso = fooObj; } Foo *soso; }; $ cat Foo.cpp #pragma once #include "main.h" class Foo { public: void doSomething(bool ololo) { if (ololo) ; //do something else } }; $ cat bar.cpp #pragma once #include "main.h" #include "Foo.cpp" class Bar { bool killAllHumans(FoobarPackage planet) { planet.soso-&gt;doSomething(true); return true; } }; $ g++ -c bar.cpp bar.cpp:1:9: warning: #pragma once in main file $ $ g++ -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) $ </code></pre> <p><strong>EDIT</strong>: As <em>everyone</em> has pointed out, this program is still very buggy. Not least of which is that it <code>#include</code>s a CPP file for no obvious reason.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload