Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Fails: "Use of undeclared identifier 'nullptr'" #56

Open
userFortyTwo opened this issue May 13, 2024 · 8 comments
Open

Build Fails: "Use of undeclared identifier 'nullptr'" #56

userFortyTwo opened this issue May 13, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@userFortyTwo
Copy link

userFortyTwo commented May 13, 2024

Building an app with the geopackage-ios pod added to it fails on my M2 Mac (running macOS 14.4.1).

Version Information:

  • GeoPackage iOS Version: 8.0.6
  • GeoPackage iOS Source: CocoaPods
  • CocoaPods Version: 1.15.2
  • Xcode Version: 15.3 (15E204a)
  • Device or Emulator: iPhone 15 Pro simulator
  • iOS Version: iOS 17.4 (21E213)
  • Other Relevant Libraries: none

Expected Results:

The build should succeed, and the app should launch in the simulator.

Observed Results:

The build fails.

Output:

sf-proj-ios

Steps to Reproduce:

  1. Create a new Xcode project for an iOS app.
  2. Run pod init.
  3. Add pod geopackage-ios, '~> 8.0.6' to the Podfile.
  4. Run pod install.
  5. Open the newly created Xcode workspace and hit Run.

Relevant Code:

none

Test Files:

none

Additional Information:

The C++ Language Dialect is set to the default GNU++20 option in the build settings and thus should support the nullptr literal.

Manually defining the nullptr keyword inside the optargpm.h file (#define nullptr 0x0) resolves the problem, but leads to further compilation issues. In this case, an error message is received, saying the memory file included at Pods/PROJ/filemanager.hpp:31 could not be found. Commenting out this include-directive, the compiler will complain about the string file missing, which is included in the next line.

These issues might result from the fact that the C++ headers may be interpreted as C code. (Editing the headers to emit #error C code on #ifndef __cplusplus appears to confirm this assumption.)

Is this a bug? Is anyone else experiencing these problems, or does anyone know how to solve them?

@userFortyTwo userFortyTwo added the bug Something isn't working label May 13, 2024
@callmeahab
Copy link

I have encountered the same issue, are there any updates concerning this issue?

@callmeahab
Copy link

I resolved this issue by adding swift bridging header and also had to set User Script Sandboxing to NO in the project settings.

@LoicaMarotteBleu122
Copy link

@callmeahab I have the same problem, can you share the content of the bridging header you added please ?

@callmeahab
Copy link

Sure, just create a file somewhere in your project

#ifndef <AppName>_Bridging_Header_h
#define <AppName>_Bridging_Header_h

#import "geopackage-ios-Bridging-Header.h"

#endif /* <AppName>_Bridging_Header_h */

somewhere in your project (replace with your application name).

Go to your project settings and set
Targets -> YourProject -> Build Settings -> Objective-C Bridging Header and set the value wherever you saved the file.

Also set User Script Sandboxing to NO on that same page.

@LoicaMarotteBleu122
Copy link

@callmeahab Thank you for you answer, I don't have this error anymore after adding a bridging header, but now I have this :

Pods/PROJ/src/apps/proj.cpp:13:10 'crs.hpp' file not found with include; use "quotes" instead

Did you have the same problem ?

@callmeahab
Copy link

Not after configuring the bridging header

@nanang-rafsanjani-datamine

@callmeahab Thank you for you answer, I don't have this error anymore after adding a bridging header, but now I have this :

Pods/PROJ/src/apps/proj.cpp:13:10 'crs.hpp' file not found with include; use "quotes" instead

Did you have the same problem ?

I have the same issue. Have you found a solution?

@nanang-rafsanjani-datamine

please help, I also have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants