How to use Or-Tools in C++ project

163 views
Skip to first unread message

janason

unread,
Apr 18, 2013, 11:15:20 PM4/18/13
to or-tools...@googlegroups.com
I want to use Or-Tools in C++ project at windows platform, but how to build it and reference in my project. The project is very simple.

Laurent Perron

unread,
Apr 19, 2013, 5:34:28 AM4/19/13
to or-tools-discuss
Hello. 

I assume you have created the or-tools repository, run make third_party and make all as indicated in the getting started.


Then create a visual studio project. 
  - specify architecture to be /MD
  - add 2 include files directory: <or-tools>\src and <or-tools>\dependencies\install\include
  - in the linking part, add all libraries in <or-tools>\lib and <or-tools>\dependencies\lib (and below).

Hopefully, the order is not important (I am not sure of that).

I hope this helps.

Thanks

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



On Fri, Apr 19, 2013 at 5:15 AM, janason <sh.l.j...@gmail.com> wrote:
I want to use Or-Tools in C++ project at windows platform, but how to build it and reference in my project. The project is very simple.

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Laurent Perron

unread,
Apr 19, 2013, 5:44:49 AM4/19/13
to or-tools-discuss
Let me be more precise:
in <or-tools>/lib, you need to link with:
routing.lib constraint_solver.lib linear_solver.lib shortestpaths.lib graph.lib algorithms.lib util.lib base.lib

in the dependencies, link with:
glpk.lib (if installed), libgflags.lib libprotobuf.lib zlib.lib coin\libCbcSolver.lib coin\libCbc.lib coin\libCgl.lib coin\libOsiCbc.lib coin\libOsiClp.lib coin\libOsi.lib coin\libClp.lib coin\libCoinUtils.lib

That should be enough.

Thanks

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



Reply all
Reply to author
Forward
0 new messages