# Building wxruby on windows with Visual C++ Express Edition

**URL:** <https://www.ruby-forum.com/t/building-wxruby-on-windows-with-visual-c-express-edition/147092>\
**Category:** wxRuby\
**Created:** [August 28, 2008, 1:02pm UTC](https://www.ruby-forum.com/t/building-wxruby-on-windows-with-visual-c-express-edition/147092 "2008-08-28T13:02:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxmotor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cc9497/32.png) [@maxmotor](https://www.ruby-forum.com/u/maxmotor)\
**Post date:** [August 28, 2008, 1:02pm UTC](https://www.ruby-forum.com/t/building-wxruby-on-windows-with-visual-c-express-edition/147092/1 "2008-08-28T13:02:20Z")

</div>

Hello,  
Sorry for bothering You with so many questions, but I’m trying to build  
wxruby from svn and wxWindgets 2.8.8 using Visual C++ 2008 Express  
Edition.  
I builded wxWindgets following instructions  
[http://wiki.wxwidgets.org/Compiling\_WxWidgets](http://wiki.wxwidgets.org/Compiling_WxWidgets) and  
[http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets](http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets)  
It compiled without any errors.  
But on linking step of wxruby build process error occurs. May be another  
compiler should be used or I missconfigured something?  
Configurations that I’ve made: switched runtime library to  
“Multi-Threaded (/MT)” for all projects and in ‘include/wx/msw/setup.h’  
defined  
wxUSE\_UNICODE, wxUSE\_GLCANVAS and wxUSE\_GRAPHICS\_CONTEXT to 1

link swig/wx.res obj/AboutDialogInfo.obj ……  
c:/ruby  
/lib/msvcrt-ruby18.lib /dll /out:lib/wxruby2.so  
Microsoft (R) Incremental Linker Version 9.00.21022.08  
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : warning LNK4068: /MACHINE not specified; defaulting to X86  
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: \_\_thiscall  
std::basic\_string\<  
char,struct std::char\_traits,class std::allocator

> ::~basic\_string\<c  
> har,struct std::char\_traits,class std::allocator \>(void)"  
> (??1?$basi  
> c\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already  
> defined i  
> n wxmsw28u\_core.lib(graphics.obj)  
> msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: unsigned int  
> \_\_thiscall std::  
> basic\_string\<char,struct std::char\_traits,class  
> std::allocator \>::si  
> ze(void)const "  
> (?size@?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@s  
> td@@QBEIXZ) already defined in wxmsw28u\_core.lib(graphics.obj)  
> msvcprt.lib(MSVCP90.dll) : error LNK2005: “public: \_\_thiscall  
> std::basic\_string\<  
> char,struct std::char\_traits,class std::allocator  
> ::basic\_string\<ch  
> ar,struct std::char\_traits,class std::allocator \>(char const  
> \*)” (??  
> 0?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)  
> already  
> defined in wxmsw28u\_core.lib(graphics.obj)  
> msvcprt.lib(MSVCP90.dll) : error LNK2005: “public: \_\_thiscall  
> std::basic\_string\<  
> char,struct std::char\_traits,class std::allocator  
> ::basic\_string\<ch  
> ar,struct std::char\_traits,class std::allocator \>(class  
> std::basic\_s  
> tring\<char,struct std::char\_traits,class std::allocator \>  
> const &)”  
> (??0?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)  
> a  
> lready defined in wxmsw28u\_core.lib(graphics.obj)  
> msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: char const \*  
> \__thiscall std::  
> basic\_string\<char,struct std::char\_traits,class  
> std::allocator \>::c_  
> str(void)const "  
> (?c\_str@?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@  
> @std@@QBEPBDXZ) already defined in wxmsw28u\_core.lib(graphics.obj)  
> LIBCMT.lib(invarg.obj) : error LNK2005: \_\_invalid\_parameter\_noinfo  
> already defin  
> ed in MSVCRT.lib(MSVCR90.dll)  
> Creating library lib/wxruby2.lib and object lib/wxruby2.exp  
> LINK : warning LNK4098: defaultlib ‘LIBCMT’ conflicts with use of other  
> libs; us  
> e /NODEFAULTLIB:library  
> lib/wxruby2.so : fatal error LNK1169: one or more multiply defined  
> symbols found

rake aborted!  
Command failed with status (145): [link swig/wx.res  
obj/AboutDialogInfo.obj…  
]  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:899:in `sh' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:906:in `call’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:906:in `sh' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:985:in `sh’  
./rake/rakewx.rb:100  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:544:in `call' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:544:in `execute’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in  
`invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in `invoke\_prerequisit  
es’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `send’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in `invoke\_prerequisit  
es’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in  
`invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_c hain' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in  
`invoke_task' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in  
`standard_exceptio n_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top\_level’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard\_exceptio  
n\_handling’  
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31 c:/ruby/bin/rake:16:in `load’  
c:/ruby/bin/rake:16

Max

---

<div class="post-metadata">

**Author:** ![maxmotor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cc9497/32.png) [@maxmotor](https://www.ruby-forum.com/u/maxmotor)\
**Post date:** [August 28, 2008, 1:49pm UTC](https://www.ruby-forum.com/t/building-wxruby-on-windows-with-visual-c-express-edition/147092/2 "2008-08-28T13:49:16Z")

</div>

Max S. wrote:

> Sorry for bothering You with so many questions,  
> Your questions are welcome; it’s what this list is for.

> but I’m trying to build  
> wxruby from svn and wxWindgets 2.8.8 using Visual C++ 2008 Express

Great - it would be good to have more people building from SVN on  
Windows as though the platform’s used a lot, the development team are  
primarily OS X & Linux based.

However, I’m pretty sure you can’t build wxRuby (or any other ruby  
extension) with Visual Studio 2008. I’m assuming you’re using a ruby  
installed from the One-Click or similar (you can check by doing ruby  
-v). The released ruby builds are built with VS 6, and VS2008 can’t be  
used to compile extensions for this. You’ll get the kind of weird errors  
you seem to be getting.

You have two ways to get around this. You could try and get hold of a  
copy of VS6, but Microsoft don’t make it available anywhere. I think I  
may have tracked down a copy in my University Library.

What I would strongly recommend, though, is to look into using MingW -  
which is gcc for Windows, and therefore free. It will soon be used as  
the preferred compiler for Ruby, and wxRuby, on Windows. It takes  
slightly longer to compile, but produces significantly faster-running  
code.

Luis L. provides a handy start pack which includes a a Ruby built  
with mingW, and the compiler.

Mario wrote a pretty comprehensive page about setting up wxRuby for use  
with MingW, from installing MingW to compiling WxWidgets and wxRuby.  
[http://wxruby.rubyforge.org/wiki/wiki.pl?NotesOnMingW](http://wxruby.rubyforge.org/wiki/wiki.pl?NotesOnMingW)

Very happy to help further with this - might be more appropriate to  
follow up on the -dev list if you want:  
[http://rubyforge.org/mailman/listinfo/wxruby-development](http://rubyforge.org/mailman/listinfo/wxruby-development)

cheers  
alex
