Use of undeclared type 'GCDQueue' #77

Closed
opened 2025-12-29 15:23:45 +01:00 by adam · 4 comments
Owner

Originally created by @ThibaultVlacich on GitHub (Sep 6, 2016).

Hello,

I have a very strange bug with CoreStore. I'm using it through Cocoapods, and if I'm adding the "DEBUG" flag, I start getting that kind of errors from CoreStore :

CoreStore/Saving and Processing/BaseDataTransaction.swift:455:63: Use of undeclared type 'GCDQueue'
CoreStore/Saving and Processing/BaseDataTransaction.swift:447:18: Could not infer type for 'childTransactionQueue'
...

Here what I've added to my Podfile to have the debug flags :

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'CoreStore'
            target.build_configurations.each do |config|
                if config.name == 'Debug'
                    config.build_settings['OTHER_SWIFT_FLAGS'] = '-D SWIFT_DEBUG -DDEBUG'
                else
                    config.build_settings['OTHER_SWIFT_FLAGS'] = ''
                end
            end
        end
    end
end

I also tried -D DEBUG instead of -DDEBUG without success. Just having the -D SWIFT_DEBUG works (in the means that it compiles), but I do not have any logging from CoreStore.

So that means that I can't use the CoreStore logger (because there is an #if DEBUG before every logging action). Any idea how I can fix that and have a working logger ?

Originally created by @ThibaultVlacich on GitHub (Sep 6, 2016). Hello, I have a very strange bug with CoreStore. I'm using it through Cocoapods, and if I'm adding the "DEBUG" flag, I start getting that kind of errors from CoreStore : ``` CoreStore/Saving and Processing/BaseDataTransaction.swift:455:63: Use of undeclared type 'GCDQueue' CoreStore/Saving and Processing/BaseDataTransaction.swift:447:18: Could not infer type for 'childTransactionQueue' ... ``` Here what I've added to my Podfile to have the debug flags : ``` post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'CoreStore' target.build_configurations.each do |config| if config.name == 'Debug' config.build_settings['OTHER_SWIFT_FLAGS'] = '-D SWIFT_DEBUG -DDEBUG' else config.build_settings['OTHER_SWIFT_FLAGS'] = '' end end end end end ``` I also tried `-D DEBUG` instead of `-DDEBUG` without success. Just having the `-D SWIFT_DEBUG` works (in the means that it compiles), but I do not have any logging from CoreStore. So that means that I can't use the CoreStore logger (because there is an `#if DEBUG` before every logging action). Any idea how I can fix that and have a working logger ?
adam added the fixed label 2025-12-29 15:23:45 +01:00
adam closed this issue 2025-12-29 15:23:46 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Sep 6, 2016):

Hi, thanks for the feedback!

I think the problem is you are overwriting the OTHER_SWIFT_FLAGS instead of appending to it. CoreStore declares -D USE_FRAMEWORKS that it uses to conditionally-import GCDKit

#if USE_FRAMEWORKS
import GCDKit
#endif

Try adding

                    config.build_settings['OTHER_SWIFT_FLAGS'] = '-D SWIFT_DEBUG -D DEBUG -D USE_FRAMEWORKS'

But you're right, I should probably declare DEBUG within CoreStore itself.

@JohnEstropia commented on GitHub (Sep 6, 2016): Hi, thanks for the feedback! I think the problem is you are overwriting the `OTHER_SWIFT_FLAGS` instead of appending to it. CoreStore declares `-D USE_FRAMEWORKS` that it uses to conditionally-import GCDKit ``` #if USE_FRAMEWORKS import GCDKit #endif ``` Try adding ``` config.build_settings['OTHER_SWIFT_FLAGS'] = '-D SWIFT_DEBUG -D DEBUG -D USE_FRAMEWORKS' ``` But you're right, I should probably declare DEBUG within CoreStore itself.
Author
Owner

@ThibaultVlacich commented on GitHub (Sep 7, 2016):

Indeed, thanks ! I should have checked the podspec file to see that.

I can make you a pull request to add the DEBUG flag in Debug config if you want.

@ThibaultVlacich commented on GitHub (Sep 7, 2016): Indeed, thanks ! I should have checked the podspec file to see that. I can make you a pull request to add the DEBUG flag in Debug config if you want.
Author
Owner

@JohnEstropia commented on GitHub (Sep 7, 2016):

That is awesome! Thanks!

@JohnEstropia commented on GitHub (Sep 7, 2016): That is awesome! Thanks!
Author
Owner

@JohnEstropia commented on GitHub (Sep 7, 2016):

@ThibaultVlacich pushed your code to v2.0.5 👍

@JohnEstropia commented on GitHub (Sep 7, 2016): @ThibaultVlacich pushed your code to v2.0.5 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#77