title: iOS with Swift: "_main", referenced from: implicit entry/start for main executable
body: <p>I am new to Swift and I have already run into problem.</p>
  
  <p>I can't run iOS application written in Swift due to <strong>Error</strong>:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "_main", referenced from:
   implicit entry/start for main executable
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I have my <strong>AppDelegate.swift</strong></p>
  
  <pre><code>import UIKit
  
  @UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate {
  
      var window: UIWindow?
  
  
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
          window = UIWindow(frame: UIScreen.mainScreen().bounds)
  
          var homeChainingViewController = HomeViewController(nibName: "HomeViewController", bundle: nil)
  
          var navigationController = UINavigationController(rootViewController: homeChainingViewController)
  
          window?.rootViewController = navigationController
          window?.makeKeyAndVisible()
  
          return true
      }
  
      func applicationWillResignActive(application: UIApplication) {
          // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
          // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
      }
  
      func applicationDidEnterBackground(application: UIApplication) {
          // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
          // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
      }
  
      func applicationWillEnterForeground(application: UIApplication) {
          // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
      }
  
      func applicationDidBecomeActive(application: UIApplication) {
          // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
      }
  
      func applicationWillTerminate(application: UIApplication) {
          // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
      }
  
  
  }
  </code></pre>
  
  <p>Also, I have my <strong>Build Phases</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/cA6aH.png" alt="Build Phases"></p>
  
  <p>I have tried <strong>clean building</strong>:</p>
  
  <ul>
  <li>cmd+shift+k</li>
  <li>cmd+alt+shift+k</li>
  <li>delete derived data</li>
  </ul>
  
  <p>Despite of these, I can't load my Application due to previous error.</p>
  
  <p>Where is the problem and how to solve it?!</p>