polarbearzoo / maidsafe-dht

Automatically exported from code.google.com/p/maidsafe-dht
0 stars 0 forks source link

Win32 Test Projects Build #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up a fresh Windows environment with MSVC 8.0 (2005)
2. Follow instructions to create maidsafe-dht.sln
3. Build maidsafe-dht.sln

What is the expected output? What do you see instead?
Expect to have a clean build. 

The base project libraries seem to build:
 cryptopp_static
 udt_static
 maidsaft-dht_static
 benchmark_static
 kaddemo_static

but the 7 TEST projects all fail with linker errors like:

class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > __cdecl std::operator+<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,char const *)"
(??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char
_traits@D@std@@V?$allocator@D@2@@0@ABV10@PBD@Z)
already defined in gtestd.lib(gtest.obj)

All of the linker errors are the same type (LNK2005) and all complain that
a symbol already exists in gtest.lib. 

I was able to run extract_includes.bat and build the Experimental project
which successfully uploaded my results to your Dashboard (M55LKGXGC4). 

Let me know what else you need. My C++ project debugging is rusty.

Chris.

Original issue reported on code.google.com by xtopher....@gmail.com on 30 Apr 2010 at 9:59

GoogleCodeExporter commented 9 years ago
Hi Chris - thanks for your report.

Did you perhaps link against Gtest libs built with /MT flag rather than /MD ?

The Gtest download has 2 solution files: \gtest-1.5.0\msvc\gtest.sln and
\gtest-1.5.0\msvc\gtest-md.sln

The former creates the gtest libs with /MT flag set and the latter with /MD. 
maidsafe-dht defaults to /MD (as does protocol buffers) and MSVC requires all 
linked
libs to have been compiled with the same version of the C runtime lib - set 
using the
/MD or /MT flags.

So to link maidsafe-dht and gtest, you need to build the gtest-md solution.  If 
you
don't use gtest elsewhere, you'd probably be best to delete your current gtest 
libs
before linking maidsafe-dht, or else download a fresh instance of gtest, build 
the
gtest-md solution and pass this path when running cmake for maidsafe-dht using 
"cmake
.. -DGTEST_ROOT_DIR=<Path to gtest root>"

Please don't hesitate to reply if this doesn't resolve your problem.

All the best,

Fraser.

Original comment by fraser.hutchison@gmail.com on 3 May 2010 at 3:35

GoogleCodeExporter commented 9 years ago
We should close this in 24 hours if there are no more reported errors of this 
kind. 
Perhaps with a note on the devbuild to watch out for such events.

Original comment by irvine.d...@gmail.com on 5 May 2010 at 5:13