Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1322)
+++ CMakeLists.txt	(revision 1327)
@@ -151,8 +151,11 @@
   ELSEIF(MSVC)
     # This part is unnecessary 'casue the same is set by the lemon/core.h.
-    # Still keep it as an example.
-    SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
+    # Still kept as an example.
+
+    # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
+
     # Suppressed warnings:
     # C4250: 'class1' : inherits 'class2::member' via dominance
+    # C4267: conversion from 'size_t' to 'type', possible loss of data
     # C4355: 'this' : used in base member initializer list
     # C4503: 'function' : decorated name length exceeded, name was truncated
@@ -169,4 +172,5 @@
 
 IF(MSVC)
+  SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
   SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
     "Flags used by the C++ compiler during maintainer builds."
Index: cmake/FindILOG.cmake
===================================================================
--- cmake/FindILOG.cmake	(revision 1232)
+++ cmake/FindILOG.cmake	(revision 1331)
@@ -63,4 +63,6 @@
   ${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
   ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
+  ${ILOG_CPLEX_ROOT_DIR}/lib/x86_linux/static_pic
+  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_linux/static_pic
   ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
   NO_DEFAULT_PATH
@@ -73,4 +75,6 @@
   ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
   ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
+  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_linux/static_pic
+  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_linux/static_pic
   ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
   NO_DEFAULT_PATH
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h	(revision 959)
+++ lemon/arg_parser.h	(revision 1327)
@@ -27,4 +27,5 @@
 #include <sstream>
 #include <algorithm>
+#include <lemon/core.h>
 #include <lemon/assert.h>
 
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 1270)
+++ lemon/core.h	(revision 1327)
@@ -30,4 +30,5 @@
 // Disable the following warnings when compiling with MSVC:
 // C4250: 'class1' : inherits 'class2::member' via dominance
+// C4267: conversion from 'size_t' to 'type', possible loss of data
 // C4355: 'this' : used in base member initializer list
 // C4503: 'function' : decorated name length exceeded, name was truncated
@@ -35,14 +36,8 @@
 // C4996: 'function': was declared deprecated
 #ifdef _MSC_VER
-#pragma warning( disable : 4250 4355 4503 4800 4996 )
+#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
 #endif
 
-#ifdef __GNUC__
-#define GCC_VERSION (__GNUC__ * 10000                   \
-                     + __GNUC_MINOR__ * 100             \
-                     + __GNUC_PATCHLEVEL__)
-#endif
-
-#if GCC_VERSION >= 40800
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
 // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
Index: lemon/counter.h
===================================================================
--- lemon/counter.h	(revision 833)
+++ lemon/counter.h	(revision 1327)
@@ -22,4 +22,6 @@
 #include <string>
 #include <iostream>
+
+#include <lemon/core.h>
 
 ///\ingroup timecount
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 1330)
+++ lemon/cplex.cc	(revision 1270)
@@ -116,8 +116,21 @@
                          ExprIterator e, Value ub) {
     int i = CPXgetnumrows(cplexEnv(), _prob);
-
-    int rmatbeg = 0;
-    
+    if (lb == -INF) {
+      const char s = 'L';
+      CPXnewrows(cplexEnv(), _prob, 1, &ub, &s, 0, 0);
+    } else if (ub == INF) {
+      const char s = 'G';
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+    } else if (lb == ub){
+      const char s = 'E';
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+    } else {
+      const char s = 'R';
+      double len = ub - lb;
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, &len, 0);
+    }
+
     std::vector<int> indices;
+    std::vector<int> rowlist;
     std::vector<Value> values;
 
@@ -125,26 +138,10 @@
       indices.push_back(it->first);
       values.push_back(it->second);
-    }
-
-    if (lb == -INF) {
-      const char s = 'L';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else if (ub == INF) {
-      const char s = 'G';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else if (lb == ub){
-      const char s = 'E';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else {
-      const char s = 'R';
-      double len = ub - lb;
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-      CPXchgrngval(cplexEnv(), _prob, 1, &i, &len);
-    }
-    
+      rowlist.push_back(i);
+    }
+
+    CPXchgcoeflist(cplexEnv(), _prob, values.size(),
+                   &rowlist.front(), &indices.front(), &values.front());
+
     return i;
   }
Index: lemon/elevator.h
===================================================================
--- lemon/elevator.h	(revision 628)
+++ lemon/elevator.h	(revision 1328)
@@ -168,5 +168,5 @@
     int onLevel(int l) const
     {
-      return _first[l+1]-_first[l];
+      return static_cast<int>(_first[l+1]-_first[l]);
     }
     ///Return true if level \c l is empty.
@@ -178,10 +178,10 @@
     int aboveLevel(int l) const
     {
-      return _first[_max_level+1]-_first[l+1];
+      return static_cast<int>(_first[_max_level+1]-_first[l+1]);
     }
     ///Return the number of active items on level \c l.
     int activesOnLevel(int l) const
     {
-      return _last_active[l]-_first[l]+1;
+      return static_cast<int>(_last_active[l]-_first[l]+1);
     }
     ///Return true if there is no active item on level \c l.
Index: lemon/radix_sort.h
===================================================================
--- lemon/radix_sort.h	(revision 1270)
+++ lemon/radix_sort.h	(revision 1328)
@@ -329,5 +329,5 @@
       Allocator allocator;
 
-      int length = std::distance(first, last);
+      int length = static_cast<int>(std::distance(first, last));
       Key* buffer = allocator.allocate(2 * length);
       try {
Index: lemon/random.h
===================================================================
--- lemon/random.h	(revision 631)
+++ lemon/random.h	(revision 1328)
@@ -200,5 +200,5 @@
         initState(init);
 
-        num = length > end - begin ? length : end - begin;
+        num = static_cast<int>(length > end - begin ? length : end - begin);
         while (num--) {
           curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1))
@@ -214,5 +214,5 @@
         }
 
-        num = length - 1; cnt = length - (curr - state) - 1;
+        num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1);
         while (num--) {
           curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2))
Index: lemon/static_graph.h
===================================================================
--- lemon/static_graph.h	(revision 956)
+++ lemon/static_graph.h	(revision 1328)
@@ -204,5 +204,5 @@
 
       node_num = n;
-      arc_num = std::distance(first, last);
+      arc_num = static_cast<int>(std::distance(first, last));
 
       node_first_out = new int[node_num + 1];
