I am new to code blocks so please bear with me... I am trying to get this:
http://ab-initio.mit.edu/wiki/index.php/NLopt_Tutorial to work. The only problem is I cant get the .lib file to compile correctly. NLOPT says that you need to compile the .lib using the MINIGW compiler, which I did. You then have to link this code to to you main c program.
I thought I did this through the Build Options-> linker settings-> link libraries (Policy Append *Tried prepend as well*)
However as soon as I try try to build it it crashes with the first line of the .lib file on a syntax error. Every time I comment a line out the next line has a syntax error
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\mingw32\bin\ld.exe:C:\Users\cmcgonagill\Desktop\nlopt\libnlopt-0.lib|1|syntax error|
||=== Build finished: 1 errors, 0 warnings ===|
Here is the lib file:
; C:\MinGW\bin\dlltool.exe -d libnlopt-0.def -D libnlopt-0.dll -z libnlopt-0.lib
EXPORTS
nlo_add_equality_constraint @ 1
nlo_add_equality_constraint_ @ 2
nlo_add_equality_constraint__ @ 3
nlo_add_equality_mconstraint @ 4
nlo_add_equality_mconstraint_ @ 5
nlo_add_equality_mconstraint__ @ 6
nlo_add_inequality_constraint @ 7
nlo_add_inequality_constraint_ @ 8
nlo_add_inequality_constraint__ @ 9
nlo_add_inequality_mconstraint @ 10
nlo_add_inequality_mconstraint_ @ 11
nlo_add_inequality_mconstraint__ @ 12
nlo_copy @ 13
nlo_copy_ @ 14
nlo_copy__ @ 15
nlo_create @ 16
nlo_create_ @ 17
nlo_create__ @ 18
nlo_destroy @ 19
nlo_destroy_ @ 20
nlo_destroy__ @ 21
nlo_force_stop @ 22
nlo_force_stop_ @ 23
nlo_force_stop__ @ 24
nlo_get_algorithm @ 25
nlo_get_algorithm_ @ 26
nlo_get_algorithm__ @ 27
nlo_get_dimension @ 28
nlo_get_dimension_ @ 29
nlo_get_dimension__ @ 30
nlo_get_force_stop @ 31
nlo_get_force_stop_ @ 32
nlo_get_force_stop__ @ 33
nlo_get_ftol_abs @ 34
nlo_get_ftol_abs_ @ 35
nlo_get_ftol_abs__ @ 36
nlo_get_ftol_rel @ 37
nlo_get_ftol_rel_ @ 38
nlo_get_ftol_rel__ @ 39
nlo_get_initial_step @ 40
nlo_get_initial_step_ @ 41
nlo_get_initial_step__ @ 42
nlo_get_lower_bounds @ 43
nlo_get_lower_bounds_ @ 44
nlo_get_lower_bounds__ @ 45
nlo_get_maxeval @ 46
nlo_get_maxeval_ @ 47
nlo_get_maxeval__ @ 48
nlo_get_maxtime @ 49
nlo_get_maxtime_ @ 50
nlo_get_maxtime__ @ 51
nlo_get_population @ 52
nlo_get_population_ @ 53
nlo_get_population__ @ 54
nlo_get_stopval @ 55
nlo_get_stopval_ @ 56
nlo_get_stopval__ @ 57
nlo_get_upper_bounds @ 58
nlo_get_upper_bounds_ @ 59
nlo_get_upper_bounds__ @ 60
nlo_get_xtol_abs @ 61
nlo_get_xtol_abs_ @ 62
nlo_get_xtol_abs__ @ 63
nlo_get_xtol_rel @ 64
nlo_get_xtol_rel_ @ 65
nlo_get_xtol_rel__ @ 66
nlo_optimize @ 67
nlo_optimize_ @ 68
nlo_optimize__ @ 69
nlo_remove_equality_constraints @ 70
nlo_remove_equality_constraints_ @ 71
nlo_remove_equality_constraints__ @ 72
nlo_remove_inequality_constraints @ 73
nlo_remove_inequality_constraints_ @ 74
nlo_remove_inequality_constraints__ @ 75
nlo_set_default_initial_step @ 76
nlo_set_default_initial_step_ @ 77
nlo_set_default_initial_step__ @ 78
nlo_set_force_stop @ 79
nlo_set_force_stop_ @ 80
nlo_set_force_stop__ @ 81
nlo_set_ftol_abs @ 82
nlo_set_ftol_abs_ @ 83
nlo_set_ftol_abs__ @ 84
nlo_set_ftol_rel @ 85
nlo_set_ftol_rel_ @ 86
nlo_set_ftol_rel__ @ 87
nlo_set_initial_step @ 88
nlo_set_initial_step1 @ 89
nlo_set_initial_step1_ @ 90
nlo_set_initial_step1__ @ 91
nlo_set_initial_step_ @ 92
nlo_set_initial_step__ @ 93
nlo_set_local_optimizer @ 94
nlo_set_local_optimizer_ @ 95
nlo_set_local_optimizer__ @ 96
nlo_set_lower_bounds @ 97
nlo_set_lower_bounds1 @ 98
nlo_set_lower_bounds1_ @ 99
nlo_set_lower_bounds1__ @ 100
nlo_set_lower_bounds_ @ 101
nlo_set_lower_bounds__ @ 102
nlo_set_max_objective @ 103
nlo_set_max_objective_ @ 104
nlo_set_max_objective__ @ 105
nlo_set_maxeval @ 106
nlo_set_maxeval_ @ 107
nlo_set_maxeval__ @ 108
nlo_set_maxtime @ 109
nlo_set_maxtime_ @ 110
nlo_set_maxtime__ @ 111
nlo_set_min_objective @ 112
nlo_set_min_objective_ @ 113
nlo_set_min_objective__ @ 114
nlo_set_population @ 115
nlo_set_population_ @ 116
nlo_set_population__ @ 117
nlo_set_stopval @ 118
nlo_set_stopval_ @ 119
nlo_set_stopval__ @ 120
nlo_set_upper_bounds @ 121
nlo_set_upper_bounds1 @ 122
nlo_set_upper_bounds1_ @ 123
nlo_set_upper_bounds1__ @ 124
nlo_set_upper_bounds_ @ 125
nlo_set_upper_bounds__ @ 126
nlo_set_xtol_abs @ 127
nlo_set_xtol_abs1 @ 128
nlo_set_xtol_abs1_ @ 129
nlo_set_xtol_abs1__ @ 130
nlo_set_xtol_abs_ @ 131
nlo_set_xtol_abs__ @ 132
nlo_set_xtol_rel @ 133
nlo_set_xtol_rel_ @ 134
nlo_set_xtol_rel__ @ 135
nlopt_add_equality_constraint@20 @ 136
nlopt_add_equality_mconstraint@20 @ 137
nlopt_add_inequality_constraint@20 @ 138
nlopt_add_inequality_mconstraint@20 @ 139
nlopt_algorithm_name@4 @ 140
nlopt_compute_rescaling @ 141
nlopt_copy@4 @ 142
nlopt_count_constraints @ 143
nlopt_create@8 @ 144
nlopt_destroy@4 @ 145
nlopt_eval_constraint @ 146
nlopt_force_stop@4 @ 147
nlopt_get_algorithm@4 @ 148
nlopt_get_dimension@4 @ 149
nlopt_get_force_stop@4 @ 150
nlopt_get_ftol_abs@4 @ 151
nlopt_get_ftol_rel@4 @ 152
nlopt_get_initial_step@12 @ 153
nlopt_get_local_search_algorithm@12 @ 154
nlopt_get_lower_bounds@8 @ 155
nlopt_get_maxeval@4 @ 156
nlopt_get_maxtime@4 @ 157
nlopt_get_population@4 @ 158
nlopt_get_stochastic_population@0 @ 159
nlopt_get_stopval@4 @ 160
nlopt_get_upper_bounds@8 @ 161
nlopt_get_xtol_abs@8 @ 162
nlopt_get_xtol_rel@4 @ 163
nlopt_init_genrand @ 164
nlopt_isinf @ 165
nlopt_iurand @ 166
nlopt_max_constraint_dim @ 167
nlopt_minimize@80 @ 168
nlopt_minimize_constrained@96 @ 169
nlopt_minimize_econstrained@128 @ 170
nlopt_new_rescaled @ 171
nlopt_nrand @ 172
nlopt_optimize@12 @ 173
nlopt_optimize_limited @ 174
nlopt_qsort_r @ 175
nlopt_remove_equality_constraints@4 @ 176
nlopt_remove_inequality_constraints@4 @ 177
nlopt_rescale @ 178
nlopt_seconds @ 179
nlopt_set_default_initial_step@8 @ 180
nlopt_set_force_stop@8 @ 181
nlopt_set_ftol_abs@12 @ 182
nlopt_set_ftol_rel@12 @ 183
nlopt_set_initial_step1@12 @ 184
nlopt_set_initial_step@8 @ 185
nlopt_set_local_optimizer@8 @ 186
nlopt_set_local_search_algorithm@12 @ 187
nlopt_set_lower_bounds1@12 @ 188
nlopt_set_lower_bounds@8 @ 189
nlopt_set_max_objective@12 @ 190
nlopt_set_maxeval@8 @ 191
nlopt_set_maxtime@12 @ 192
nlopt_set_min_objective@12 @ 193
nlopt_set_munge@12 @ 194
nlopt_set_population@8 @ 195
nlopt_set_stochastic_population@4 @ 196
nlopt_set_stopval@12 @ 197
nlopt_set_upper_bounds1@12 @ 198
nlopt_set_upper_bounds@8 @ 199
nlopt_set_xtol_abs1@12 @ 200
nlopt_set_xtol_abs@8 @ 201
nlopt_set_xtol_rel@12 @ 202
nlopt_slsqp @ 203
nlopt_sobol_create @ 204
nlopt_sobol_destroy @ 205
nlopt_sobol_next @ 206
nlopt_sobol_next01 @ 207
nlopt_sobol_skip @ 208
nlopt_srand@4 @ 209
nlopt_srand_time@0 @ 210
nlopt_srand_time_default @ 211
nlopt_stop_dx @ 212
nlopt_stop_evals @ 213
nlopt_stop_evalstime @ 214
nlopt_stop_f @ 215
nlopt_stop_forced @ 216
nlopt_stop_ftol @ 217
nlopt_stop_time @ 218
nlopt_stop_x @ 219
nlopt_stop_xs @ 220
nlopt_time_seed @ 221
nlopt_unscale @ 222
nlopt_urand @ 223
nlopt_version@12 @ 224
nloptc @ 225
nloptc_ @ 226
nloptm @ 227
nloptm_ @ 228
nloptv @ 229
nloptv_ @ 230
Do I need to compile the code a different way or what am I doing wrong that would net a syntax error?