The reason for this behavior is most likely caused by both Microsoft Visual
Studio and MinGW being installed. The current SCons setup for V8 depends on
the SCons autodetecting the toolchain, where MSVC is preferred over MinGW.
You could try patching SConstruct and src/SConscript files adding tools =
['mingw'] to Environment() calls (Environment(tools = ['mingw'])).
On a Windows installation with only MinGW installed V8 SCons build does not
cause problems.

Regards,
Søren

On Wed, Apr 22, 2009 at 03:53, Qu0ll <[email protected]> wrote:

> That's a good suggestion but when I run "scons toolchain=gcc" it still
> tries to use the cl command which is the Microsoft linker.  Clearly it
> shouldn't be using cl for gcc.
>
>
> On Wed, Apr 22, 2009 at 10:21 AM, Alex Iskander <[email protected]>wrote:
>
>> You may be able to force it to compile using GCC. There was a proposed
>> patch to allow MinGW support, and with a quick look, I noticed some checks
>> for  MinGW in the v8 source.
>> I'm not sure how to use it (not knowing scons so well), but perhaps
>> something like:
>> scons toolchain:gcc
>>
>> This is based on the following lines in the SConstruct file:
>>   SIMPLE_OPTIONS = {
>>  'toolchain': {
>>  'values': ['gcc', 'msvc'],
>>  'default': TOOLCHAIN_GUESS,
>>  'help': 'the toolchain to use'
>>  },
>>
>>
>> Alex
>>
>>  On Apr 21, 2009, at 7:01 PM, Qu0ll wrote:
>>
>>  Right.  Looks like I'll just have to use MSVC for this project :-(
>>
>> Thanks for all your help.
>>
>> P.S. I still don't know why the static lib is 70.9MB whereas the DLL is
>> only 1.3MB
>>
>> On Wed, Apr 22, 2009 at 9:57 AM, Alex Iskander <[email protected]>wrote:
>>
>>> I'm not sure on the details of a MinGW setup.
>>> However, if it does not using Microsoft's compiler (which it looks like
>>> it doesn't, given the g++ call), then you might have problems linking with
>>> v8, as it is compiled with Microsoft's compiler. I'm not an expert, but it
>>> seems that, since they'll use different C++ standard libraries, conflicts
>>> could, or would, occur.
>>>
>>> Alex
>>>
>>>  On Apr 21, 2009, at 6:50 PM, Qu0ll wrote:
>>>
>>>  I am making some progress.
>>>
>>> I built V8 as a DLL and it seems to be OK.  I then built the Hello World
>>> program using MSVC and linked with the v8.lib instead of v8.dll directly and
>>> it links and runs properly.
>>>
>>> However, MSVC is not my development environment - I use Eclipse and
>>> MinGW.  Unfortunately using this combination and trying to build the Hello
>>> World gives me these link errors:
>>>
>>>
>>> g++ -LD:\SVN\V8\trunk -Xlinker -call_shared -ov8-hello-world.exe
>>> Source\helloWorld.o D:\SVN\V8\trunk\v8.lib D:\SVN\V8\trunk\v8.dll
>>>
>>> Source\helloWorld.o: In function `_ZNK2v86HandleINS_7ContextEEdeEv':
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v811HandleScopeC1Ev'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v87Context3NewEPNS_22ExtensionConfigurationENS_6HandleINS_14ObjectTemplateEEENS3_INS_5ValueEEE'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86String3NewEPKci'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86Script7CompileENS_6HandleINS_6StringEEEPNS_12ScriptOriginEPNS_10ScriptDataE'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86Script3RunEv'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86String10AsciiValueC1ENS_6HandleINS_5ValueEEE'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86String10AsciiValueD1Ev'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v811HandleScopeD1Ev'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v86String10AsciiValueD1Ev'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v811HandleScopeD1Ev'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v87Context4ExitEv'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v87Context5EnterEv'
>>>
>>> D:/SVN/V8/trunk/include/v8.h:2432: undefined reference to
>>> `__imp___ZN2v82V813DisposeGlobalEPPv'
>>>
>>>
>>> which make absolutely no sense to me whatsoever.
>>>
>>>
>>> Does anyone know if Eclipse/MinGW can be used to build projects that
>>> access V8?  If so, how?
>>>
>>>
>>> Thanks,
>>>
>>> -Qu0ll
>>>
>>>
>>>
>>>
>>>   Alex Iskander, TPSi
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>   Alex Iskander, TPSi
>>
>>
>>
>>
>> >>
>>

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to