[FlopCpp] MSVS8, error LNK2005 ... already defined

J P Fasano jpfasano at us.ibm.com
Mon Feb 19 21:28:05 EST 2007


> I am trying to compile FLOPC++ on MSVS 8. I use TortoiseSVN to
> update ...\FLOPC++\, then open ...\FLOPC++\stable\1.
\FlopCpp\examples\cuttingStock\cuttingStock.sln.

I don't think the file FLOPC++\stable\1.0\MSVisualStudio\v8\FlopCpp
\examples\cuttingStock\cuttingStock.sln exists in the svn repository.
See
https://projects.coin-or.org/MSVisualStudio/browser/trunk/v8/FlopCpp/examples/cuttingStock
 which shows that there is only a cuttingStock.vcproj file.
Perhaps you meant to say that you opened cuttingStock.vcproj?

You should open FLOPC++\stable\1.0\MSVisualStudio\v8\FlopCpp\FlopCpp.sln.
If you do this, then hopefully you will be able to build cuttingStock.
I just tried it and found that there was an error when opening FlopCpp.sln
stating that UnitTest.vcproj could not be found.
Other than this, things went smoothly and I was able to build cuttingStock.

> Second, after I add those libraries, the compiler give 5 errors,
which are of the form, "error LNK2005: "public: __thiscall
> std:: ... already defined in libcoin.lib(CoinWarmStartBasis.o)",
> with the file listed as libcpmtd.lib
LNK1104: cannot open file 'libcp.lib'"
multithreading libraries.

I suspect that this means that the projects (libraries) were not all built
with the same runtime libraries.
Perhaps some were built single threaded and others multithreaded.
Right click a project, open properiteis, under Configuration Properties -
C/C++ - Code Generation, check Runtime Library.
Make sure all projects are built with the some type of runtime library.
I think that if you open FlopCpp.sln then things should be set up to build
Multithreaded for Release and Multithreaded-Debug for Debug.

JP

flopcpp-bounces at list.coin-or.org wrote on 02/19/2007 04:41:57 AM:
colleagues,
> I am trying to compile FLOPC++ on MSVS 8. I use TortoiseSVN to
> update ...\FLOPC++\, then open ...\FLOPC++\stable\1.
\FlopCpp\examples\cuttingStock\cuttingStock.sln.
> This does not compile.
> First, it seems I must add the libraries (in ..\coin-win32-
> msvc7-13Feb06\lib\*.lib) explicitly to the projects in Project,
> Properties, Linker, Input, Additional Dependencies. Is that true?
>
> Second, after I add those libraries, the compiler give 5 errors,
which are of the form, "error LNK2005: "public: __thiscall
> std:: ... already defined in libcoin.lib(CoinWarmStartBasis.o)",
> with the file listed as libcpmtd.lib
LNK1104: cannot open file 'libcp.lib'"
multithreading libraries.
> I am keen to make this work, but must subordinate my pride to my
> schedule. Has anyone some suggestions?
>
> Warm regards,
> Fritz
> John F. Raffensperger, Ph.D.
Univ. of Canterbury, Christchurch, New Zealand
http://www.mang.canterbury.ac.nz/people/jfraffen/
> Explore Operations Research: http://www.ScienceOfBetter.org/.
> _______________________________________________
FlopCpp at list.coin-or.org



More information about the FlopCpp mailing list