Форум программистов, компьютерный форум, киберфорум
C/С++ под Linux
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 5.00/5: Рейтинг темы: голосов - 5, средняя оценка - 5.00
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96

Проблемы с установкой библиотеки galib

10.11.2018, 22:07. Показов 1123. Ответов 12
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Добрый день! Столкнулся с проблемой, когда не получается установить библиотеку galib. Скачал отсюда: http://lancet.mit.edu/ga/dist/
Распаковал архив и запустил в терминале командой make (пробовал instal и тоже получил ошибки)
Получил следующий результат
cd ga; make
g++ -g -Wall -O -fexceptions -O0 -I.. -c GA1DArrayGenome.C
In file included from GA1DArrayGenome.C:18:
../ga/GA1DArrayGenome.h:66:30: error: use of undeclared identifier 'sz'
{for(unsigned int i=0; i<sz; i++) gene(i, *(array+i)); return *this;}
^
../ga/GA1DArrayGenome.h:78:50: error: use of undeclared identifier 'a'
const T & gene(unsigned int x=0) const {return a[x];}
^
../ga/GA1DArrayGenome.h:80:8: error: use of undeclared identifier 'a'
if(a[x] != value){ a[x] = value; _evaluated = gaFalse;}
^
../ga/GA1DArrayGenome.h:80:24: error: use of undeclared identifier 'a'
if(a[x] != value){ a[x] = value; _evaluated = gaFalse;}
^
../ga/GA1DArrayGenome.h:81:12: error: use of undeclared identifier 'a'
return a[x];
^
../ga/GA1DArrayGenome.h:155:54: error: use of undeclared identifier 'CONTENTS'
virtual GAGenome *clone(GAGenome::CloneMethod flag=CONTENTS) const;
^
../ga/GA1DArrayGenome.C:136:10: error: use of undeclared identifier 'sz'
return sz;
^
../ga/GA1DArrayGenome.C:225:3: error: use of undeclared identifier 'initializer'
initializer(DEFAULT_1DARRAY_ALLELE_INITI ALIZER);
^
../ga/GA1DArrayGenome.C:226:3: error: use of undeclared identifier 'mutator'
mutator(DEFAULT_1DARRAY_ALLELE_MUTATOR);
^
../ga/GA1DArrayGenome.C:227:14: error: use of undeclared identifier
'ElementComparator'
comparator(DEFAULT_1DARRAY_ALLELE_COMPAR ATOR);
^
../ga/gaconfig.h:375:45: note: expanded from macro
'DEFAULT_1DARRAY_ALLELE_COMPARATOR'
#define DEFAULT_1DARRAY_ALLELE_COMPARATOR ElementComparator
^
../ga/GA1DArrayGenome.C:228:13: error: use of undeclared identifier
'OnePointCrossover'
crossover(DEFAULT_1DARRAY_ALLELE_CROSSOV ER);
^
../ga/gaconfig.h:376:45: note: expanded from macro
'DEFAULT_1DARRAY_ALLELE_CROSSOVER'
#define DEFAULT_1DARRAY_ALLELE_CROSSOVER OnePointCrossover
^
../ga/GA1DArrayGenome.C:241:3: error: use of undeclared identifier 'initializer'
initializer(DEFAULT_1DARRAY_ALLELE_INITI ALIZER);
^
../ga/GA1DArrayGenome.C:242:3: error: use of undeclared identifier 'mutator'
mutator(DEFAULT_1DARRAY_ALLELE_MUTATOR);
^
../ga/GA1DArrayGenome.C:243:14: error: use of undeclared identifier
'ElementComparator'
comparator(DEFAULT_1DARRAY_ALLELE_COMPAR ATOR);
^
../ga/gaconfig.h:375:45: note: expanded from macro
'DEFAULT_1DARRAY_ALLELE_COMPARATOR'
#define DEFAULT_1DARRAY_ALLELE_COMPARATOR ElementComparator
^
../ga/GA1DArrayGenome.C:244:13: error: use of undeclared identifier
'OnePointCrossover'
crossover(DEFAULT_1DARRAY_ALLELE_CROSSOV ER);
^
../ga/gaconfig.h:376:45: note: expanded from macro
'DEFAULT_1DARRAY_ALLELE_CROSSOVER'
#define DEFAULT_1DARRAY_ALLELE_CROSSOVER OnePointCrossover
^
../ga/GA1DArrayGenome.C:298:23: error: use of undeclared identifier 'nx'
unsigned int oldx = nx;
^
../ga/GA1DArrayGenome.C:300:6: error: use of undeclared identifier 'nx'
if(nx > oldx){
^
../ga/GA1DArrayGenome.C:301:32: error: use of undeclared identifier 'nx'
for(unsigned int i=oldx; i<nx; i++)
^
../ga/GA1DArrayGenome.C:302:7: error: use of undeclared identifier 'a'
a[i] = aset[i % naset].allele();
^
19 errors generated.
make[1]: *** [GA1DArrayGenome.o] Error 1
make: *** [all] Error 2

Почему он ругается на необъявленные переменные?
Как решить проблему!
Заранее спасибо за помощь!
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
10.11.2018, 22:07
Ответы с готовыми решениями:

проблема с установкой библиотеки.
Добрый день, у меня возникла проблема с установкой библиотеки EasyBMP. я скопировал все файлы данной библиотеки в директорию где находятся...

Проблемы с установкой ХР
Вобщем собрал со старого железа слабенький комп(мать GA-6VA7+,проц селерон 533, 256 оперы, видюха 64метра и винт сигейт на 80).Начал...

Проблемы с установкой
Acer Aspire s315 Снёс предустановленную Висту. Разметил GPartedом винт 80 Гб. Бубунта с флешки не идёт: нет там загрузочного сектора...

12
1263 / 977 / 384
Регистрация: 02.09.2012
Сообщений: 3,021
11.11.2018, 08:33
Какую версию вы скачали?? Пробовали другую версию??
0
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96
11.11.2018, 16:01  [ТС]
Скачал версию galib245.tar.gz другие тоже пробовал, везде ошибки
Ставлю под macOS Sierra.
Стоит Xcode и компиляторы g++, gcc
0
1263 / 977 / 384
Регистрация: 02.09.2012
Сообщений: 3,021
11.11.2018, 23:41
Попробуйте добавить флаг компиляции -fpermissive, уже очень у вас старый C++-код
0
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96
12.11.2018, 01:46  [ТС]
Цитата Сообщение от grgdvo Посмотреть сообщение
Попробуйте добавить флаг компиляции -fpermissive, уже очень у вас старый C++-код
Не понял - куда добавить это флаг? Почему код старый?
0
1263 / 977 / 384
Регистрация: 02.09.2012
Сообщений: 3,021
12.11.2018, 02:35
Цитата Сообщение от студ Посмотреть сообщение
Не понял - куда добавить это флаг?
можно добавить параметром команды make
make CXXFLAGS="-fpermissive"

Цитата Сообщение от студ Посмотреть сообщение
Почему код старый?
обратите внимание на дату модификации файлов на сайте с исходниками (последняя версия датируется 2007ым годом)
с того момента как минимум три версии стандарта С++ были приняты, ну и версии современных компиляторов уже подтянулись к этим стандартам;
поэтому современный gcc и ругается на различные прошлые допущения
флаг -fpermissive "отключает" некоторую ругань.

Добавлено через 9 минут
точнее так... -fpermissive говорит компилятору, что разные несоответствия кода считать предупреждениями, а не ошибками, а значит можно продолжать компиляцию; но предупреждения вы все равно увидите!
0
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96
12.11.2018, 02:38  [ТС]
Цитата Сообщение от grgdvo Посмотреть сообщение
make CXXFLAGS="-fpermissive"
не помогло, теже 19 ошибок выдает

А может я не тот архив взял? как понять для мака она подходит или нет? Или все равно?
0
1263 / 977 / 384
Регистрация: 02.09.2012
Сообщений: 3,021
12.11.2018, 02:42
попробуйте взять последнюю версия - galib247
покажите ее логи компиляции и вашу версию gcc, может какая мысль возникнет
0
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96
12.11.2018, 03:03  [ТС]
Цитата Сообщение от grgdvo Посмотреть сообщение
попробуйте взять последнюю версия - galib247
Попробовал, выводит следующие ошибки:
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
cd ga; /Applications/Xcode.app/Contents/Developer/usr/bin/make
g++ -fpermissive -I.. -c garandom.C
g++ -fpermissive -I.. -c gaerror.C
gaerror.C:25:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "error reading from file: ",
  ^
gaerror.C:26:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "error writing to file: ",
  ^
gaerror.C:27:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "unexpected EOF encountered during read.",
  ^
gaerror.C:28:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad probability value.  Must be between 0.0 and 1.0, inclusive.",
  ^
gaerror.C:29:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "objects are different types.",
  ^
gaerror.C:30:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "this method has not been defined.",
  ^
gaerror.C:31:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "core deleted with references remaining.",
  ^
gaerror.C:33:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "the custom replacement strategy requires a replacement function",
  ^
gaerror.C:34:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "unknown replacement strategy",
  ^
gaerror.C:35:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "number of children must be greater than 0",
  ^
gaerror.C:36:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "replacement percentage must be between 0.0 and 1.0, inclusive",
  ^
gaerror.C:37:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "number of indiv for replacement must be less than pop size",
  ^
gaerror.C:38:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "index of individual is out-of-bounds",
  ^
gaerror.C:39:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "population contains no individuals from which to clone new individuals",
  ^
gaerror.C:40:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "there must be at least one individual in each population",
  ^
gaerror.C:41:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "no sexual crossover has been defined.  no mating can occur.",
  ^
gaerror.C:42:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "no asexual crossover has been defined.  no mating can occur.",
  ^
gaerror.C:44:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "children must have same resize behaviour for any given dimension",
  ^
gaerror.C:45:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "parents and children must have the same dimensions",
  ^
gaerror.C:46:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "parents must be the same length",
  ^
gaerror.C:47:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "upper limit must be greater than lower limit.",
  ^
gaerror.C:48:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad phenotype - ID is out of bounds.",
  ^
gaerror.C:49:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad phenotype - value is less than min or greater than max.",
  ^
gaerror.C:50:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "dimensions of bounds set do not match dimensions of the genome",
  ^
gaerror.C:52:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "linear scaling multiplier must be greater than 1.0",
  ^
gaerror.C:53:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "sigma truncation multiplier must be greater than 0.0",
  ^
gaerror.C:54:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "negative objective function score!\n\
  ^
gaerror.C:56:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "negative objective function score!\n\
  ^
gaerror.C:58:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "the cutoff for triangular sharing must be greater than 0.0",
  ^
gaerror.C:60:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot index an allele in a bounded, non-discretized set of alleles",
  ^
gaerror.C:61:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "length of binary string exceeds maximum for this computer/OS type.",
  ^
gaerror.C:62:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "specified value cannot be exactly represented with these bits.",
  ^
gaerror.C:63:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad 'where' indicator",
  ^
gaerror.C:64:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bogus type, data may be corrupt",
  ^
gaerror.C:65:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad links in tree.  operation aborted.",
  ^
gaerror.C:66:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot swap a node with its ancestor",
  ^
gaerror.C:67:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert this object into itself",
  ^
gaerror.C:68:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "node relative to which insertion is made must be non-NULL.",
  ^
gaerror.C:69:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "root node must have no siblings.  insertion aborted.",
  ^
gaerror.C:70:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert before a root node (only below).",
  ^
gaerror.C:71:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert after a root node (only below)."  
  ^
41 warnings generated.
g++ -fpermissive -I.. -c GAParameter.C
g++ -fpermissive -I.. -c GAStatistics.C
g++ -fpermissive -I.. -c GABaseGA.C
g++ -fpermissive -I.. -c GASStateGA.C
g++ -fpermissive -I.. -c GASimpleGA.C
g++ -fpermissive -I.. -c GAIncGA.C
g++ -fpermissive -I.. -c GADemeGA.C
g++ -fpermissive -I.. -c GADCrowdingGA.C
g++ -fpermissive -I.. -c GASelector.C
g++ -fpermissive -I.. -c GAScaling.C
g++ -fpermissive -I.. -c GAPopulation.C
g++ -fpermissive -I.. -c GAGenome.C
g++ -fpermissive -I.. -c GABinStr.C
g++ -fpermissive -I.. -c gabincvt.C
g++ -fpermissive -I.. -c GAAllele.C
g++ -fpermissive -I.. -c GA1DBinStrGenome.C
g++ -fpermissive -I.. -c GA2DBinStrGenome.C
g++ -fpermissive -I.. -c GA3DBinStrGenome.C
g++ -fpermissive -I.. -c GABin2DecGenome.C
g++ -fpermissive -I.. -c GA1DArrayGenome.C
../ga/GA1DArrayGenome.C:225:3: error: use of undeclared identifier 'initializer'
  initializer(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_INITIALIZER);
  ^
../ga/GA1DArrayGenome.C:226:3: error: use of undeclared identifier 'mutator'
  mutator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_MUTATOR);
  ^
../ga/GA1DArrayGenome.C:241:3: error: use of undeclared identifier 'initializer'
  initializer(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_INITIALIZER);
  ^
../ga/GA1DArrayGenome.C:242:3: error: use of undeclared identifier 'mutator'
  mutator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_MUTATOR);
  ^
4 errors generated.
make[1]: *** [GA1DArrayGenome.o] Error 1
make: *** [lib] Error 2
Цитата Сообщение от grgdvo Посмотреть сообщение
покажите ее логи компиляции и вашу версию gcc
MacBook-Air:bin st$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
0
1263 / 977 / 384
Регистрация: 02.09.2012
Сообщений: 3,021
12.11.2018, 03:26
так, приехали, clang под капотом получается... ну с clang может быть другая история
это совершенно отличный компилятор от GNU gcc и g++, хотя стремятся к совместимости по флагам компиляции.
боюсь здесь надо именно по clang вопросы задавать и читать, что для него такое -fpermissive и какие еще флаги совместимости есть
а покажите без -fpermissive на что ругается??
0
0 / 0 / 1
Регистрация: 05.09.2014
Сообщений: 96
12.11.2018, 06:37  [ТС]
Цитата Сообщение от grgdvo Посмотреть сообщение
а покажите без -fpermissive на что ругается??
результат идентичный
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
cd ga; /Applications/Xcode.app/Contents/Developer/usr/bin/make
g++ -g -Wall -I.. -c garandom.C
g++ -g -Wall -I.. -c gaerror.C
gaerror.C:25:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "error reading from file: ",
  ^
gaerror.C:26:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "error writing to file: ",
  ^
gaerror.C:27:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "unexpected EOF encountered during read.",
  ^
gaerror.C:28:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad probability value.  Must be between 0.0 and 1.0, inclusive.",
  ^
gaerror.C:29:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "objects are different types.",
  ^
gaerror.C:30:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "this method has not been defined.",
  ^
gaerror.C:31:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "core deleted with references remaining.",
  ^
gaerror.C:33:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "the custom replacement strategy requires a replacement function",
  ^
gaerror.C:34:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "unknown replacement strategy",
  ^
gaerror.C:35:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "number of children must be greater than 0",
  ^
gaerror.C:36:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "replacement percentage must be between 0.0 and 1.0, inclusive",
  ^
gaerror.C:37:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "number of indiv for replacement must be less than pop size",
  ^
gaerror.C:38:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "index of individual is out-of-bounds",
  ^
gaerror.C:39:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "population contains no individuals from which to clone new individuals",
  ^
gaerror.C:40:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "there must be at least one individual in each population",
  ^
gaerror.C:41:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "no sexual crossover has been defined.  no mating can occur.",
  ^
gaerror.C:42:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "no asexual crossover has been defined.  no mating can occur.",
  ^
gaerror.C:44:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "children must have same resize behaviour for any given dimension",
  ^
gaerror.C:45:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "parents and children must have the same dimensions",
  ^
gaerror.C:46:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "parents must be the same length",
  ^
gaerror.C:47:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "upper limit must be greater than lower limit.",
  ^
gaerror.C:48:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad phenotype - ID is out of bounds.",
  ^
gaerror.C:49:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad phenotype - value is less than min or greater than max.",
  ^
gaerror.C:50:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "dimensions of bounds set do not match dimensions of the genome",
  ^
gaerror.C:52:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "linear scaling multiplier must be greater than 1.0",
  ^
gaerror.C:53:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "sigma truncation multiplier must be greater than 0.0",
  ^
gaerror.C:54:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "negative objective function score!\n\
  ^
gaerror.C:56:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "negative objective function score!\n\
  ^
gaerror.C:58:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "the cutoff for triangular sharing must be greater than 0.0",
  ^
gaerror.C:60:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot index an allele in a bounded, non-discretized set of alleles",
  ^
gaerror.C:61:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "length of binary string exceeds maximum for this computer/OS type.",
  ^
gaerror.C:62:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "specified value cannot be exactly represented with these bits.",
  ^
gaerror.C:63:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad 'where' indicator",
  ^
gaerror.C:64:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bogus type, data may be corrupt",
  ^
gaerror.C:65:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "bad links in tree.  operation aborted.",
  ^
gaerror.C:66:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot swap a node with its ancestor",
  ^
gaerror.C:67:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert this object into itself",
  ^
gaerror.C:68:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "node relative to which insertion is made must be non-NULL.",
  ^
gaerror.C:69:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "root node must have no siblings.  insertion aborted.",
  ^
gaerror.C:70:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert before a root node (only below).",
  ^
gaerror.C:71:3: warning: conversion from string literal to 'char *' is
      deprecated [-Wc++11-compat-deprecated-writable-strings]
  "cannot insert after a root node (only below)."  
  ^
41 warnings generated.
g++ -g -Wall -I.. -c GAParameter.C
g++ -g -Wall -I.. -c GAStatistics.C
g++ -g -Wall -I.. -c GABaseGA.C
g++ -g -Wall -I.. -c GASStateGA.C
g++ -g -Wall -I.. -c GASimpleGA.C
g++ -g -Wall -I.. -c GAIncGA.C
g++ -g -Wall -I.. -c GADemeGA.C
g++ -g -Wall -I.. -c GADCrowdingGA.C
g++ -g -Wall -I.. -c GASelector.C
g++ -g -Wall -I.. -c GAScaling.C
g++ -g -Wall -I.. -c GAPopulation.C
g++ -g -Wall -I.. -c GAGenome.C
g++ -g -Wall -I.. -c GABinStr.C
g++ -g -Wall -I.. -c gabincvt.C
g++ -g -Wall -I.. -c GAAllele.C
g++ -g -Wall -I.. -c GA1DBinStrGenome.C
g++ -g -Wall -I.. -c GA2DBinStrGenome.C
g++ -g -Wall -I.. -c GA3DBinStrGenome.C
g++ -g -Wall -I.. -c GABin2DecGenome.C
g++ -g -Wall -I.. -c GA1DArrayGenome.C
../ga/GA1DArrayGenome.C:225:3: error: use of undeclared identifier 'initializer'
  initializer(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_INITIALIZER);
  ^
../ga/GA1DArrayGenome.C:226:3: error: use of undeclared identifier 'mutator'
  mutator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_MUTATOR);
  ^
../ga/GA1DArrayGenome.C:241:3: error: use of undeclared identifier 'initializer'
  initializer(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_INITIALIZER);
  ^
../ga/GA1DArrayGenome.C:242:3: error: use of undeclared identifier 'mutator'
  mutator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_MUTATOR);
  ^
4 errors generated.
make[1]: *** [GA1DArrayGenome.o] Error 1
make: *** [lib] Error 2
0
19497 / 10102 / 2461
Регистрация: 30.01.2014
Сообщений: 17,808
16.11.2018, 13:05
студ, откройте этот файл и исправьте так (это для 226 строки):
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
template <class T> 
GA1DArrayAlleleGenome<T>::
GA1DArrayAlleleGenome(unsigned int length, const GAAlleleSet<T> & s,
              GAGenome::Evaluator f, void * u) :
GA1DArrayGenome<T>(length, f, u){
  naset = 1;
  aset = new GAAlleleSet<T>[1];
  aset[0] = s;
 
  this->initializer(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_INITIALIZER);
  this->mutator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_MUTATOR);
  this->comparator(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_COMPARATOR);
  this->crossover(GA1DArrayAlleleGenome<T>::DEFAULT_1DARRAY_ALLELE_CROSSOVER);
}
Добавлено через 1 минуту
В остальных местах по аналогии.
0
 Аватар для weterok
36 / 28 / 9
Регистрация: 11.11.2018
Сообщений: 163
16.11.2018, 21:52
под какую OS хоть компилируете? linux тоже разных модификаций бывает. Одних только Debian чуть ли не 11 версий. если поискать пакет специально под вашу версию linux?
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
16.11.2018, 21:52
Помогаю со студенческими работами здесь

VBulletin Проблемы с установкой VB 4.1
На самом первом этапе установки вылезает ошибка: Action Required Unexpected Text: &lt;br /&gt; &lt;b&gt;Strict Standards&lt;/b&gt;: ...

Проблемы с установкой
не могу установить Windows разных зборок(ZverCD и тп). Старая версия СП 1 ставиться, лицензия СП 3 тоже поставилась. А вот при установке...

Проблемы с установкой
Вообщем купил новые комплектующие Ryzen 1600 , Rx 570, блок питания FSP ATX 500PNR и память самсунг. Все новое! Все собрал, но карта не...

Проблемы с установкой ОС
Во первых купил я ссд и поставил на старенький ПК. Перенести систему с первого раза не получилось из за слишком забитого диска. Пришлось...

Проблемы с установкой
Всем привет. Вчера собрал новый компьютер(все комплектующие совместимы - проверял), и возникла проблема с установкой ОС. Windows 8 не...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
13
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Вывод текста со шрифтом TTF с помощью SDL3_ttf
8Observer8 01.02.2026
Содержание блога В этой пошаговой инструкции создадим с нуля веб-приложение, которое выводит текст в окне браузера. Запустим на Android на локальном сервере. Загрузим Release на бесплатный. . .
SDL3 для Web (WebAssembly): Сборка C/C++ проекта из консоли
8Observer8 30.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
SDL3 для Web (WebAssembly): Установка Emscripten SDK (emsdk) и CMake для сборки C и C++ приложений в Wasm
8Observer8 30.01.2026
Содержание блога Для того чтобы скачать Emscripten SDK (emsdk) необходимо сначало скачать и уставить Git: Install for Windows. Следуйте стандартной процедуре установки Git через установщик. . . .
SDL3 для Android: Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 29.01.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами. Версия v3 была полностью переписана на Си, в. . .
Инструменты COM: Сохранение данный из VARIANT в файл и загрузка из файла в VARIANT
bedvit 28.01.2026
Сохранение базовых типов COM и массивов (одномерных или двухмерных) любой вложенности (деревья) в файл, с возможностью выбора алгоритмов сжатия и шифрования. Часть библиотеки BedvitCOM Использованы. . .
SDL3 для Android: Загрузка PNG с альфа-каналом с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 28.01.2026
Содержание блога SDL3 имеет собственные средства для загрузки и отображения PNG-файлов с альфа-каналом и базовой работы с ними. В этой инструкции используется функция SDL_LoadPNG(), которая. . .
SDL3 для Android: Загрузка PNG с альфа-каналом с помощью SDL3_image
8Observer8 27.01.2026
Содержание блога SDL3_image - это библиотека для загрузки и работы с изображениями. Эта пошаговая инструкция покажет, как загрузить и вывести на экран смартфона картинку с альфа-каналом, то есть с. . .
Влияние грибов на сукцессию
anaschu 26.01.2026
Бифуркационные изменения массы гриба происходят тогда, когда мы уменьшаем массу компоста в 10 раз, а скорость прироста биомассы уменьшаем в три раза. Скорость прироста биомассы может уменьшаться за. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru