GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
main-gui.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2012-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <cstdlib>
31 
32 #include <iostream>
33 #include <string>
34 
35 #include "liboctave-build-info.h"
36 
38 
39 #include "liboctgui-build-info.h"
40 
41 #include "oct-env.h"
42 
43 #include "octave.h"
44 #include "octave-build-info.h"
45 #include "qt-application.h"
46 #include "sysdep.h"
47 
48 static void
50 {
51  bool ok = true;
52 
53  // Each library and executable has its own definition of the hg
54  // id. They should always match but may be different because of a
55  // botched installation or incorrect LD_LIBRARY_PATH or some other
56  // unusual problem.
57 
58  std::string octave_id = octave_hg_id ();
59  std::string liboctave_id = liboctave_hg_id ();
60  std::string liboctinterp_id = liboctinterp_hg_id ();
61  std::string liboctgui_id = liboctgui_hg_id ();
62 
63  if (octave_id != liboctave_id)
64  {
65  std::cerr << "octave hg id ("
66  << octave_id
67  << ") does not match liboctave hg id ("
68  << liboctave_id
69  << ')' << std::endl;
70  ok = false;
71  }
72 
73  if (octave_id != liboctinterp_id)
74  {
75  std::cerr << "octave hg id ("
76  << octave_id
77  << ") does not match liboctinterp hg id ("
78  << liboctinterp_id
79  << ')' << std::endl;
80  ok = false;
81  }
82 
83  if (octave_id != liboctgui_id)
84  {
85  std::cerr << "octave hg id ("
86  << octave_id
87  << ") does not match liboctgui hg id ("
88  << liboctgui_id
89  << ')' << std::endl;
90  ok = false;
91  }
92 
93  if (! ok)
94  exit (1);
95 }
96 
97 int
98 main (int argc, char **argv)
99 {
101 
103 
104  octave::qt_application app (argc, argv);
105 
106  return app.execute ();
107 }
This class inherits from the pure-virtual base class octave::application and provides an implementati...
static void set_program_name(const std::string &s)
Definition: oct-env.cc:182
OCTAVE_API std::string liboctave_hg_id(void)
std::string liboctgui_hg_id(void)
OCTAVE_API std::string liboctinterp_hg_id(void)
int main(int argc, char **argv)
Definition: main-gui.cc:98
static void check_hg_versions(void)
Definition: main-gui.cc:49
std::string octave_hg_id(void)