Unrecognizable error

Have you checked that logicDetector is not nullptr when ConstructSDandField is run? That would be an obvious cause of the segfault. Otherwise, all I can recommend in addition is to compile your application in Debug mode and run it through lldb. There’s a discussion on this in this thread: Using gdb debugger in an efficient way, albeit for gdb, but the two are similar (a search for “gdb” in the forums will bring up more on debugging).

Otherwise, look through the Application Developer Guide and Examples for info on implementing detector/sd construction.