當前位置: 首頁>>代碼示例>>Python>>正文


Python ccompiler.LinkError方法代碼示例

本文整理匯總了Python中distutils.ccompiler.LinkError方法的典型用法代碼示例。如果您正苦於以下問題:Python ccompiler.LinkError方法的具體用法?Python ccompiler.LinkError怎麽用?Python ccompiler.LinkError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.ccompiler的用法示例。


在下文中一共展示了ccompiler.LinkError方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: try_link

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import LinkError [as 別名]
def try_link(self, body, headers=None, include_dirs=None, libraries=None,
                 library_dirs=None, lang="c"):
        """Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            self._link(body, headers, include_dirs,
                       libraries, library_dirs, lang)
            ok = 1
        except (CompileError, LinkError):
            ok = 0

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:20,代碼來源:config.py

示例2: try_run

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import LinkError [as 別名]
def try_run(self, body, headers=None, include_dirs=None, libraries=None,
                library_dirs=None, lang="c"):
        """Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            src, obj, exe = self._link(body, headers, include_dirs,
                                       libraries, library_dirs, lang)
            self.spawn([exe])
            ok = 1
        except (CompileError, LinkError, DistutilsExecError):
            ok = 0

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok


    # -- High-level methods --------------------------------------------
    # (these are the ones that are actually likely to be useful
    # when implementing a real-world config command!) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:26,代碼來源:config.py

示例3: try_link

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import LinkError [as 別名]
def try_link(self, body, headers=None, include_dirs=None, libraries=None,
                 library_dirs=None, lang="c"):
        """Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            self._link(body, headers, include_dirs,
                       libraries, library_dirs, lang)
            ok = True
        except (CompileError, LinkError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:20,代碼來源:config.py

示例4: try_run

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import LinkError [as 別名]
def try_run(self, body, headers=None, include_dirs=None, libraries=None,
                library_dirs=None, lang="c"):
        """Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            src, obj, exe = self._link(body, headers, include_dirs,
                                       libraries, library_dirs, lang)
            self.spawn([exe])
            ok = True
        except (CompileError, LinkError, DistutilsExecError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok


    # -- High-level methods --------------------------------------------
    # (these are the ones that are actually likely to be useful
    # when implementing a real-world config command!) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:26,代碼來源:config.py

示例5: try_link

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import LinkError [as 別名]
def try_link (self, body,
                  headers=None, include_dirs=None,
                  libraries=None, library_dirs=None,
                  lang="c"):
        """Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            self._link(body, headers, include_dirs,
                       libraries, library_dirs, lang)
            ok = 1
        except (CompileError, LinkError):
            ok = 0

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok 
開發者ID:ofermend,項目名稱:medicare-demo,代碼行數:22,代碼來源:config.py


注:本文中的distutils.ccompiler.LinkError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。