[geos-commits] [SCM] GEOS branch master updated. dcf4f0b9fa4bd9ff02755889a482be9ee5a444b7

git at osgeo.org git at osgeo.org
Fri Jan 22 16:14:48 PST 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  dcf4f0b9fa4bd9ff02755889a482be9ee5a444b7 (commit)
      from  e412de675adc237886acc83780b8a0496aaf2561 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dcf4f0b9fa4bd9ff02755889a482be9ee5a444b7
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Jan 22 16:14:41 2021 -0800

    Rename CAPI examples to use .c extension

diff --git a/examples/README.md b/examples/README.md
index ddfbe48..e4622fc 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -2,14 +2,41 @@
 
 * `capi_read` uses the standard C API to read two WKT geometries, calculate the intersection and print the result
 * `capi_read_ts` uses the "re-entrant" C API (threadsafe) to read two WKT geometries, calculate the intersection and print the result
-* `cpp_read` uses the C++ API to read two WKT geometries, calculate the intersection and print the result
 * `capi_prepared` uses the standard C API to read one WKT geometry, and fill it with a point grid, applying a high performance "prepared" geometry to speed up intersection testing
+* `cpp_read` uses the C++ API to read two WKT geometries, calculate the intersection and print the result
 
 ## Build
 
+To build the examples _in situ_:
 ```
 mkdir _build
 cd _build
 cmake ..
 make
 ```
+
+To build programs in general, you will need to ensure that the appropriate header and include files are available to the compiler. Here's a raw compile command example for a CAPI program:
+
+```
+cc -I/usr/local/include \
+    capi_read.c \
+    -o capi_read \
+    -L/usr/local/lib \
+    -lgeos_c
+```
+
+* Ensure the header files can be found by the compiler
+* Ensure the library files can be found by the compiler
+* Ensure the C API library is passed to the linker
+
+To build a C++ API program, you must pass a define indicating you're OK with the fact that the API will change over time.
+
+```
+cc -I/usr/local/include \
+    -D USE_UNSTABLE_GEOS_CPP_API \
+    cpp_read.cpp \
+    -o cpp_read \
+    -L/usr/local/lib \
+    -lgeos
+```
+
diff --git a/examples/capi_prepared.cpp b/examples/capi_prepared.c
similarity index 100%
rename from examples/capi_prepared.cpp
rename to examples/capi_prepared.c
diff --git a/examples/capi_read.cpp b/examples/capi_read.c
similarity index 100%
rename from examples/capi_read.cpp
rename to examples/capi_read.c
diff --git a/examples/capi_read_ts.cpp b/examples/capi_read_ts.c
similarity index 100%
rename from examples/capi_read_ts.cpp
rename to examples/capi_read_ts.c

-----------------------------------------------------------------------

Summary of changes:
 examples/README.md                              | 29 ++++++++++++++++++++++++-
 examples/{capi_prepared.cpp => capi_prepared.c} |  0
 examples/{capi_read.cpp => capi_read.c}         |  0
 examples/{capi_read_ts.cpp => capi_read_ts.c}   |  0
 4 files changed, 28 insertions(+), 1 deletion(-)
 rename examples/{capi_prepared.cpp => capi_prepared.c} (100%)
 rename examples/{capi_read.cpp => capi_read.c} (100%)
 rename examples/{capi_read_ts.cpp => capi_read_ts.c} (100%)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list