Skip to content

[Bug] build: "ogr_srs_api.h: No such file or directory" and "cdefs.h syntax error" errors #4258

@mshukuno

Description

@mshukuno

Describe the bug

When I compile the project, I get an error fatal error: ogr_srs_api.h: No such file or directory. This issue was previously reported #1649 and it seemed resolved at that point. So, I am wondering if my configuration is to blame. I run the line below for configuration:

./configure --with-gdal=/usr/bin/gdal-config --with-geos=/usr/local/bin/geos-config --with-blas --with-lapack

Please let me know if this issue has anything to do with my configuration settings. If so, would you be so kind as to share with me what I need to change or add in order to solve this problem?

INFO: Status: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG -U __GNUC__ -dD "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmp0ltw0i5t.h"
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: In file included from /tmp/tmpk7h2ptj1.h:1:
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: /home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include/grass/gprojects.h:57:10: fatal error: ogr_srs_api.h: No such file or directory
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG:    57 | #include <ogr_srs_api.h>
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG:       |          ^~~~~~~~~~~~~~~
ERROR: gcc -E       -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -I/home/mshukun/Documents/GitHubProjects/grass/dist.x86_64-pc-linux-gnu/include -D__GLIBC_HAVE_LONG_LONG: compilation terminated.

The cdefs.h. file also has errors as follwoing. This error was reported in ctypesgen, so I assume it is a known issue on Linux.

ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:281: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:308: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:315: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:321: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:330: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:331: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:339: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:397: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:406: Syntax error at '\n'
ERROR: /usr/include/x86_64-linux-gnu/sys/cdefs.h:433: Syntax error at '\n'

Despite having errors in the log, the compilation ends without errors. Do those not count as errors rather than warnings?

GRASS GIS 8.5.0dev cdb62825a3 compilation log
--------------------------------------------------
Started compilation: Fri Aug 30 11:54:41 AM EDT 2024
--
Errors in:
No errors detected.
--
Finished compilation: Fri Aug 30 11:57:03 AM EDT 2024

Expected behavior

  • If the cause is not my configuration, the fatal error: ogr_srs_api.h: No such file or directory need to be resolved.
  • I assume that errors will be reported at the end when there is one or more errors.
  • It would be helpful to know at the end of the compilation log or website whether certain errors can be ignored. In this way, I won't have to wonder if my settings are to blame for the errors.

System description

  • Operating System: Ubuntu 22.04 LTS
  • GRASS GIS version:
    version=8.5.0dev
    date=2024
    revision=cdb62825a3
    build_date=2024-08-30
    build_platform=x86_64-pc-linux-gnu
    build_off_t_size=8
    libgis_revision=b794d95393
    libgis_date=2024-08-23T16:29:27+00:00
    proj=9.1.1
    gdal=3.6.4
    geos=3.12.2
    sqlite=3.37.2
  • wxPython
    3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
    4.2.1 gtk3 (phoenix) wxWidgets 3.2.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions