Hello Andrew,

you refer to a non-existent file glpk_4_61_stdcall.def.
I get the same warning concerning make not being cdecl. I think this
should be fixed.

There are warnings for mcfrelax.c and proxy.c due to conversion of
double to int.
In proxy.c this is due to inconsistent variable types for time.
In mcfrelax.c variable low is checked to be integer. So you can safely
prepend (int) to avoid the warnings.

See appended patches.

Best regards

Heinrich Schuchardt

On 01/08/2017 06:54 PM, Andrew Makhorin wrote:
> Heinrich,
> 
>>
>> unfortunately you missed one function passed to qsort.
>>
>> Please, apply the appended patch
>> https://github.com/xypron/glpk/commit/f6afa4d6645868b8369c757debe8bc8663ec9c7c
> 
> Please see an updated version ibid.:
> http://sourceforge.net/projects/noumenon/files/tmp/
> (Note that this is *not* an official release.)
> 
> I checked it with VC9 and all seems to work. Please check it with VC10.
> Thanks.
> 
> There was a warning:
> ..\examples\glpsol.c(932) : warning C4007: 'main' : must be '__cdecl'
> However I think this should work because internally main always finishes
> via ExitProcess winapi call rather than via return statement.
> 
> 
> Andrew Makhorin
> 
> 

From 113a56825cb10f1f25ca5948c5105b996fd2c0b4 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <xypron.g...@gmx.de>
Date: Sun, 8 Jan 2017 21:32:51 +0100
Subject: [PATCH] Fix build errors

- add missing file glpk_4_61_stdcall.def
- glpsol.c: main must be __cdecl

Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
---
 examples/glpsol.c         |   8 ++
 w32/glpk_4_61_stdcall.def | 226 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 234 insertions(+)
 create mode 100644 w32/glpk_4_61_stdcall.def

diff --git a/examples/glpsol.c b/examples/glpsol.c
index 9542675..1d6d448 100644
--- a/examples/glpsol.c
+++ b/examples/glpsol.c
@@ -21,6 +21,10 @@
 *  along with GLPK. If not, see <http://www.gnu.org/licenses/>.
 ***********************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <ctype.h>
 #include <float.h>
 #include <limits.h>
@@ -928,7 +932,11 @@ static int parse_cmdline(struct csa *csa, int argc, char *argv[])
 typedef struct { double rhs, pi; } v_data;
 typedef struct { double low, cap, cost, x; } a_data;
 
+#ifndef __WOE__
 int main(int argc, char *argv[])
+#else
+int __cdecl main(int argc, char *argv[])
+#endif
 {     /* stand-alone LP/MIP solver */
       struct csa _csa, *csa = &_csa;
       int ret;
diff --git a/w32/glpk_4_61_stdcall.def b/w32/glpk_4_61_stdcall.def
new file mode 100644
index 0000000..4fa0ada
--- /dev/null
+++ b/w32/glpk_4_61_stdcall.def
@@ -0,0 +1,226 @@
+LIBRARY glpk_4_61_stdcall
+VERSION 4.61
+DESCRIPTION "GNU Linear Programming Kit"
+EXPORTS
+glp_create_prob
+glp_set_prob_name
+glp_set_obj_name
+glp_set_obj_dir
+glp_add_rows
+glp_add_cols
+glp_set_row_name
+glp_set_col_name
+glp_set_row_bnds
+glp_set_col_bnds
+glp_set_obj_coef
+glp_set_mat_row
+glp_set_mat_col
+glp_load_matrix
+glp_check_dup
+glp_sort_matrix
+glp_del_rows
+glp_del_cols
+glp_copy_prob
+glp_erase_prob
+glp_delete_prob
+glp_get_prob_name
+glp_get_obj_name
+glp_get_obj_dir
+glp_get_num_rows
+glp_get_num_cols
+glp_get_row_name
+glp_get_col_name
+glp_get_row_type
+glp_get_row_lb
+glp_get_row_ub
+glp_get_col_type
+glp_get_col_lb
+glp_get_col_ub
+glp_get_obj_coef
+glp_get_num_nz
+glp_get_mat_row
+glp_get_mat_col
+glp_create_index
+glp_find_row
+glp_find_col
+glp_delete_index
+glp_set_rii
+glp_set_sjj
+glp_get_rii
+glp_get_sjj
+glp_scale_prob
+glp_unscale_prob
+glp_set_row_stat
+glp_set_col_stat
+glp_std_basis
+glp_adv_basis
+glp_cpx_basis
+glp_simplex
+glp_exact
+glp_init_smcp
+glp_get_status
+glp_get_prim_stat
+glp_get_dual_stat
+glp_get_obj_val
+glp_get_row_stat
+glp_get_row_prim
+glp_get_row_dual
+glp_get_col_stat
+glp_get_col_prim
+glp_get_col_dual
+glp_get_unbnd_ray
+glp_get_it_cnt
+glp_set_it_cnt
+glp_interior
+glp_init_iptcp
+glp_ipt_status
+glp_ipt_obj_val
+glp_ipt_row_prim
+glp_ipt_row_dual
+glp_ipt_col_prim
+glp_ipt_col_dual
+glp_set_col_kind
+glp_get_col_kind
+glp_get_num_int
+glp_get_num_bin
+glp_intopt
+glp_init_iocp
+glp_mip_status
+glp_mip_obj_val
+glp_mip_row_val
+glp_mip_col_val
+glp_check_kkt
+glp_print_sol
+glp_read_sol
+glp_write_sol
+glp_print_ranges
+glp_print_ipt
+glp_read_ipt
+glp_write_ipt
+glp_print_mip
+glp_read_mip
+glp_write_mip
+glp_bf_exists
+glp_factorize
+glp_bf_updated
+glp_get_bfcp
+glp_set_bfcp
+glp_get_bhead
+glp_get_row_bind
+glp_get_col_bind
+glp_ftran
+glp_btran
+glp_warm_up
+glp_eval_tab_row
+glp_eval_tab_col
+glp_transform_row
+glp_transform_col
+glp_prim_rtest
+glp_dual_rtest
+glp_analyze_bound
+glp_analyze_coef
+glp_ios_reason
+glp_ios_get_prob
+glp_ios_tree_size
+glp_ios_curr_node
+glp_ios_next_node
+glp_ios_prev_node
+glp_ios_up_node
+glp_ios_node_level
+glp_ios_node_bound
+glp_ios_best_node
+glp_ios_mip_gap
+glp_ios_node_data
+glp_ios_row_attr
+glp_ios_pool_size
+glp_ios_add_row
+glp_ios_del_row
+glp_ios_clear_pool
+glp_ios_can_branch
+glp_ios_branch_upon
+glp_ios_select_node
+glp_ios_heur_sol
+glp_ios_terminate
+glp_init_mpscp
+glp_read_mps
+glp_write_mps
+glp_init_cpxcp
+glp_read_lp
+glp_write_lp
+glp_read_prob
+glp_write_prob
+glp_mpl_alloc_wksp
+glp_mpl_init_rand
+glp_mpl_read_model
+glp_mpl_read_data
+glp_mpl_generate
+glp_mpl_build_prob
+glp_mpl_postsolve
+glp_mpl_free_wksp
+glp_read_cnfsat
+glp_check_cnfsat
+glp_write_cnfsat
+glp_minisat1
+glp_intfeas1
+glp_init_env
+glp_version
+glp_free_env
+glp_puts
+glp_printf
+glp_vprintf
+glp_term_out
+glp_term_hook
+glp_open_tee
+glp_close_tee
+glp_error_
+glp_at_error
+glp_assert_
+glp_error_hook
+glp_alloc
+glp_realloc
+glp_free
+glp_mem_limit
+glp_mem_usage
+glp_time
+glp_difftime
+glp_create_graph
+glp_set_graph_name
+glp_add_vertices
+glp_set_vertex_name
+glp_add_arc
+glp_del_vertices
+glp_del_arc
+glp_erase_graph
+glp_delete_graph
+glp_create_v_index
+glp_find_vertex
+glp_delete_v_index
+glp_read_graph
+glp_write_graph
+glp_mincost_lp
+glp_mincost_okalg
+glp_mincost_relax4
+glp_maxflow_lp
+glp_maxflow_ffalg
+glp_check_asnprob
+glp_asnprob_lp
+glp_asnprob_okalg
+glp_asnprob_hall
+glp_cpp
+glp_read_mincost
+glp_write_mincost
+glp_read_maxflow
+glp_write_maxflow
+glp_read_asnprob
+glp_write_asnprob
+glp_read_ccdata
+glp_write_ccdata
+glp_netgen
+glp_netgen_prob
+glp_gridgen
+glp_rmfgen
+glp_weak_comp
+glp_strong_comp
+glp_top_sort
+glp_wclique_exact
+;; end of file ;;
-- 
2.11.0

From d077488e2f14a720eede5ab2f64cb5a999e6d636 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <xypron.g...@gmx.de>
Date: Sun, 8 Jan 2017 22:08:15 +0100
Subject: [PATCH] Avoid warnings due to implicit time conversions.

Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
---
 src/api/mcfrelax.c | 6 +++---
 src/proxy/proxy.c  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/api/mcfrelax.c b/src/api/mcfrelax.c
index c5e929f..b618792 100644
--- a/src/api/mcfrelax.c
+++ b/src/api/mcfrelax.c
@@ -157,12 +157,12 @@ int glp_mincost_relax4(glp_graph *G, int v_rhs, int a_low, int a_cap,
             /* substitute x = x' + low, where 0 <= x' <= cap - low */
             csa.u[k] = (int)(cap - low);
             /* correct demands at endpoints of k-th arc */
-            if (overflow(csa.dfct[a->tail->i], +low))
+            if (overflow(csa.dfct[a->tail->i], (int) +low))
             {  ret = GLP_ERANGE;
                goto done;
             }
-            csa.dfct[a->tail->i] += low;
-            if (overflow(csa.dfct[a->head->i], -low))
+            csa.dfct[a->tail->i] += (int) low;
+            if (overflow(csa.dfct[a->head->i], (int) -low))
             {  ret = GLP_ERANGE;
                goto done;
             }
diff --git a/src/proxy/proxy.c b/src/proxy/proxy.c
index 7d89000..c9789c2 100644
--- a/src/proxy/proxy.c
+++ b/src/proxy/proxy.c
@@ -165,7 +165,7 @@ int dir;                /* Minimization or maximization problem */
 int ncols;              /* Number of structural variables of the
                            problem */
 
-time_t GLOtstart;       /* starting time of the algorithm */
+double GLOtstart;       /* starting time of the algorithm */
 
 glp_prob *lp_ref;       /* glp problem for refining only*/
 
-- 
2.11.0

_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to