github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.72k stars 1.55k forks source link

Error: Could not auto-detect a suitable build method #17983

Open huanglei3 opened 1 week ago

huanglei3 commented 1 week ago

Error: Could not auto-detect a suitable build method

hello ,when i exec command:codeql database create testdb1 -l cpp -s F:\project,i meet this error:

Initializing database at F:\project\testdb1. Running build command: [F:\codeql-win64\codeql\cpp\tools\autobuild.cmd] Running command in F:\project\flameshot: [F:\codeql-win64\codeql\cpp\tools\autobuild.cmd] [2024-11-14 15:17:33] [build-stdout] CodeQL C++ autobuilder [2024-11-14 15:17:33] [build-stdout] Working directory: F:\project\flameshot [2024-11-14 15:17:33] [build-stdout] Attempting to locate build script [2024-11-14 15:17:33] [build-stderr] Error: Could not auto-detect a suitable build method [2024-11-14 15:17:34] [ERROR] Spawned process exited abnormally (code 1; tried to run: [F:\codeql-win64\codeql\tools\win64\tracer.exe, F:\codeql-win64\codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, F:\codeql-win64\codeql\cpp\tools\autobuild.cmd]) A fatal error occurred: Exit status 1 from command: [F:\codeql-win64\codeql\tools\win64\runner.exe, cmd.exe, /C, type, NUL, &&, F:\codeql-win64\codeql\cpp\tools\autobuild.cmd]

please help me,thank you

aibaars commented 1 week ago

The following documentation should give you an idea of how CodeQL tries to automatically build your project https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#building-cc

If using autobuild fails then you need to manually supply a build command. See the following documentation for instructions: https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#about-specifying-build-steps-manually