Skip to content

VERSION file causes an error when building software that includes <version> and searches libpcap source directory for headers with a case-insensitive file system #1331

Open
@KrawMire

Description

@KrawMire

I suppose this error only happens on MacOS. When I use libpcap in my project and link it and try to compile it using CMake, it fails with error:

lib/third_party/libpcap/version:1:1: error: expected unqualified-id

As I understood, MacOS compiler is trying to use this file as simple code file because the problem is caused by this:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/iostream:38:.

Also, I can say that this could be fixed by renaming VERSION file to VERSION.txt and changing line 552 in CMakeLists.txt from this:

file(STRINGS ${pcap_SOURCE_DIR}/VERSION

to this

file(STRINGS ${pcap_SOURCE_DIR}/VERSION.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions