Change example/imageviewer from C to C++

This commit is contained in:
Nigel Tao committed 2021-02-27 22:40:32 +11:00
1 parent 6050cbd319
commit ccee207661
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ for f in $sources; do
if [ $f = imageviewer ]; then if [ $f = imageviewer ]; then
# example/imageviewer is unusual in that needs additional libraries. # example/imageviewer is unusual in that needs additional libraries.
echo "Building gen/bin/example-$f" echo "Building gen/bin/example-$f"
$CC -O3 example/$f/*.c -lxcb -lxcb-image -o gen/bin/example-$f $CXX -O3 example/$f/*.cc -lxcb -lxcb-image -o gen/bin/example-$f
elif [ $f = "toy-genlib" ]; then elif [ $f = "toy-genlib" ]; then
# example/toy-genlib is unusual in that it uses separately compiled # example/toy-genlib is unusual in that it uses separately compiled
# libraries (built by "wuffs genlib", e.g. by running build-all.sh) instead # libraries (built by "wuffs genlib", e.g. by running build-all.sh) instead
@@ -18,10 +18,10 @@
imageviewer is a simple GUI program for viewing images. On Linux, GUI means imageviewer is a simple GUI program for viewing images. On Linux, GUI means
X11. To run: X11. To run:
$CC imageviewer.c -lxcb -lxcb-image && \ $CXX imageviewer.cc -lxcb -lxcb-image && \
./a.out ../../test/data/bricks-*.gif; rm -f a.out ./a.out ../../test/data/bricks-*.gif; rm -f a.out
for a C compiler $CC, such as clang or gcc. for a C++ compiler $CXX, such as clang++ or g++.
The Space and BackSpace keys cycle through the files, if more than one was The Space and BackSpace keys cycle through the files, if more than one was
given as command line arguments. If none were given, the program reads from given as command line arguments. If none were given, the program reads from