CCompilerDriver`
CCompilerDriver`
CreateObjectFile
CreateObjectFile[source,name]
compiles a string of C code and creates an object file, name.ext.
CreateObjectFile[{file},name]
compiles a C source file and creates an object file, name.ext.
更多信息和选项
- To use CreateObjectFile, you first need to load the CCompilerDriver package using Needs["CCompilerDriver`"].
- If source is a string, CreateObjectFile treats it as C code. If source is a list of one or more strings, it treats it as a list of files that contain C code.
- If CreateObjectFile cannot find a suitable C compiler, it issues a message and returns $Failed.
- The extension given to the object file depends on the platform on which it is created.
- The following options can be given:
-
"CleanIntermediate" Automatic whether temporary files should be deleted "CompileOptions" "" options to pass through to the compiler "Compiler" Automatic the compiler to use "CompilerInstallation" Automatic location of the compiler software "CompilerName" Automatic which compile command to use "CreateBinary" True whether the object file should be created "Debug" False compiles with debug information, does not clean the intermediate output, and prints the compile commands and output "Defines" {} C preprocessor defines to use for the build "IncludeDirectories" {} directories to add to the include path "Language" Automatic what language the source code is in (can be used to assume source is C or C++ rather than relying on automatic detection) "PostCompileCommands" "" shell commands to run after compilation "PreCompileCommands" "" shell commands to run before compilation "ShellCommandFunction" None function to call with the shell commands used for compilation "ShellOutputFunction" None function to call with the shell output of running the compilation commands "SystemCompileOptions" {} options to pass through to the compiler before "CompileOptions" "SystemIncludeDirectories" Automatic directories to locate Wolfram Language header files "TargetDirectory" Automatic the directory in which the executable file should be created "TargetSystemID" $SystemID the system for which output should be generated "TransferProtocolLibrary" Automatic which link library (WSTP or MathLink) to use "WorkingDirectory" Automatic the directory in which temporary files should be generated
范例
Wolfram Research (2010),CreateObjectFile,Wolfram 语言函数,https://reference.wolfram.com/language/CCompilerDriver/ref/CreateObjectFile.html.
文本
Wolfram Research (2010),CreateObjectFile,Wolfram 语言函数,https://reference.wolfram.com/language/CCompilerDriver/ref/CreateObjectFile.html.
CMS
Wolfram 语言. 2010. "CreateObjectFile." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/CCompilerDriver/ref/CreateObjectFile.html.
APA
Wolfram 语言. (2010). CreateObjectFile. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/CCompilerDriver/ref/CreateObjectFile.html 年