Linking Error in Visual Studio 2008

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking Error in Visual Studio 2008

Mark Mruss
Hi Everyone,

I'm sorry if this has already been answered, I looked for a similar
issue but I couldn't find it.

I am compiling luabind using bjam and trying to work with
libluabind.lib and libluabindd.lib.

I'm getting the following type of linking errors when I try to
statically link with the libs:

1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memmove_s already
defined in libcmtd.lib(memmove_s.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in
libcmtd.lib(dbgfree.obj)
1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@AAE@ABV0@@Z) already defined in
libcmtd.lib(typinfo.obj)

Now it seems to me like this is an issue with the fact that my
application is set to "Use MFC in a Static Library" (compiler option
/MT) and when I compile luabind it compiles using the /MD switch
instead. But not matter what I try I can't seem to figure out how to
turn that option on.

If I am on the right track with this does anyone know how to turn on
the /MT option?

I'm I'm not on the right track, does anyone have any clues what I
should be doing?

In case it is relevant I'm using the libs from the following paths:

luabind-0.9\bin\msvc-9.0\debug\link-static\threading-multi\libluabindd.lib
luabind-0.9\bin\msvc-9.0\release\link-static\threading-multi\libluabind.lib

Thanks,

mark.

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking Error in Visual Studio 2008

Mark Mruss
Whoops the compiler switches that i quote are actually for the runtime
library setting and not the MFC settings. But perhaps it's still the
cause of the issue?

Thanks, and sorry for the two emails.


mark.

On Sat, May 1, 2010 at 8:05 PM, Mark Mruss <[hidden email]> wrote:

> Hi Everyone,
>
> I'm sorry if this has already been answered, I looked for a similar
> issue but I couldn't find it.
>
> I am compiling luabind using bjam and trying to work with
> libluabind.lib and libluabindd.lib.
>
> I'm getting the following type of linking errors when I try to
> statically link with the libs:
>
> 1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memmove_s already
> defined in libcmtd.lib(memmove_s.obj)
> 1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in
> libcmtd.lib(dbgfree.obj)
> 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
> type_info::type_info(class type_info const &)"
> (??0type_info@@AAE@ABV0@@Z) already defined in
> libcmtd.lib(typinfo.obj)
>
> Now it seems to me like this is an issue with the fact that my
> application is set to "Use MFC in a Static Library" (compiler option
> /MT) and when I compile luabind it compiles using the /MD switch
> instead. But not matter what I try I can't seem to figure out how to
> turn that option on.
>
> If I am on the right track with this does anyone know how to turn on
> the /MT option?
>
> I'm I'm not on the right track, does anyone have any clues what I
> should be doing?
>
> In case it is relevant I'm using the libs from the following paths:
>
> luabind-0.9\bin\msvc-9.0\debug\link-static\threading-multi\libluabindd.lib
> luabind-0.9\bin\msvc-9.0\release\link-static\threading-multi\libluabind.lib
>
> Thanks,
>
> mark.
>

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Linking Error in Visual Studio 2008

Mark Mruss
Hi Everyone,

Just for google's sake I figured out that what I needed to compile was
the following option to get everything compiling:

runtime-link=static

But now I'm running into a crash when my application exits. The crash
is in lua_close() and exists even if all I do is open luabind. it
appears as though it's an issue with two different versions of the lua
engine are in use.

Does anyone have any tips on the best way to compile luabind as a
static lib that links with the lau dll?

Thanks,

mark.

On Sat, May 1, 2010 at 8:11 PM, Mark Mruss <[hidden email]> wrote:

> Whoops the compiler switches that i quote are actually for the runtime
> library setting and not the MFC settings. But perhaps it's still the
> cause of the issue?
>
> Thanks, and sorry for the two emails.
>
>
> mark.
>
> On Sat, May 1, 2010 at 8:05 PM, Mark Mruss <[hidden email]> wrote:
>> Hi Everyone,
>>
>> I'm sorry if this has already been answered, I looked for a similar
>> issue but I couldn't find it.
>>
>> I am compiling luabind using bjam and trying to work with
>> libluabind.lib and libluabindd.lib.
>>
>> I'm getting the following type of linking errors when I try to
>> statically link with the libs:
>>
>> 1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _memmove_s already
>> defined in libcmtd.lib(memmove_s.obj)
>> 1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in
>> libcmtd.lib(dbgfree.obj)
>> 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
>> type_info::type_info(class type_info const &)"
>> (??0type_info@@AAE@ABV0@@Z) already defined in
>> libcmtd.lib(typinfo.obj)
>>
>> Now it seems to me like this is an issue with the fact that my
>> application is set to "Use MFC in a Static Library" (compiler option
>> /MT) and when I compile luabind it compiles using the /MD switch
>> instead. But not matter what I try I can't seem to figure out how to
>> turn that option on.
>>
>> If I am on the right track with this does anyone know how to turn on
>> the /MT option?
>>
>> I'm I'm not on the right track, does anyone have any clues what I
>> should be doing?
>>
>> In case it is relevant I'm using the libs from the following paths:
>>
>> luabind-0.9\bin\msvc-9.0\debug\link-static\threading-multi\libluabindd.lib
>> luabind-0.9\bin\msvc-9.0\release\link-static\threading-multi\libluabind.lib
>>
>> Thanks,
>>
>> mark.
>>
>

------------------------------------------------------------------------------

_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user