Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Main File

Now, let's look at the main.cc file. This file contains the main() function, which will be launched when HelloWorld starts. Here is what it looks like:

main.cc

// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
#include <arcane/launcher/ArcaneLauncher.h>
using namespace Arcane;
int
main(int argc,char* argv[])
{
auto& app_build_info = ArcaneLauncher::applicationBuildInfo();
app_build_info.setCodeName("HelloWorld");
app_build_info.setCodeVersion(VersionInfo(1,0,0));
}
static int run()
Entry point of the executable in Arcane.
static void init(const CommandLineArguments &args)
Positions information from command-line arguments and initializes the launcher.
static ApplicationBuildInfo & applicationBuildInfo()
Application execution parameter information.
Information about a version.
Definition VersionInfo.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --

The main() function is used to launch Arcane and our application. Therefore, this function will practically never be modified (except to update the code version). In more advanced cases, we must modify main() to, for example, change the memory allocator that will be used in Arcane for our application. We can also use this function to run calculations without modules, by using the Arcane classes.