[sword-devel] Borland C++

Greg Marine gregmarine at iccnet.org
Wed Jan 19 16:27:57 MST 2005


Well, I have been able to reference the statically compiled SwordLib in 
a new project, but I have gotten stuck. The source code is from 
examples/cmdline/lookup.cpp and the following is a set of 
warnings/errors I get when it tries to link:

Linking...
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall 
std::ios_base::width(int)" (?width at ios_base@std@@QAEHH at Z) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall 
std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" 
(?setstate@?$basic_ios at DU?$char_traits at D@std@@@std@@QAEXH_N at Z) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static bool __cdecl 
std::char_traits<char>::eq_int_type(int const &,int const &)" 
(?eq_int_type@?$char_traits at D@std@@SA_NABH0 at Z) already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static int __cdecl 
std::char_traits<char>::eof(void)" (?eof@?$char_traits at D@std@@SAHXZ) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class 
std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall 
std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " 
(?rdbuf@?$basic_ios at DU?$char_traits at D@std@@@std@@QBEPAV?$basic_streambuf at DU?$char_traits at D@std@@@2 at XZ) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall 
std::ios_base::width(void)const " (?width at ios_base@std@@QBEHXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall 
std::basic_streambuf<char,struct std::char_traits<char> 
 >::_Unlock(void)" 
(?_Unlock@?$basic_streambuf at DU?$char_traits at D@std@@@std@@QAEXXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall 
std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" 
(?_Lock@?$basic_streambuf at DU?$char_traits at D@std@@@std@@QAEXXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static int __cdecl 
std::char_traits<char>::to_int_type(char const &)" 
(?to_int_type@?$char_traits at D@std@@SAHABD at Z) already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall 
std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" 
(?sputc@?$basic_streambuf at DU?$char_traits at D@std@@@std@@QAEHD at Z) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: char __thiscall 
std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " 
(?fill@?$basic_ios at DU?$char_traits at D@std@@@std@@QBEDXZ) already defined 
in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall 
std::ios_base::flags(void)const " (?flags at ios_base@std@@QBEHXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class 
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall 
std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" 
(?flush@?$basic_ostream at DU?$char_traits at D@std@@@std@@QAEAAV12 at XZ) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class 
std::basic_ostream<char,struct std::char_traits<char> > * __thiscall 
std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " 
(?tie@?$basic_ios at DU?$char_traits at D@std@@@std@@QBEPAV?$basic_ostream at DU?$char_traits at D@std@@@2 at XZ) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: bool __thiscall 
std::ios_base::good(void)const " (?good at ios_base@std@@QBE_NXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall 
std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" 
(?_Osfx@?$basic_ostream at DU?$char_traits at D@std@@@std@@QAEXXZ) already 
defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class 
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall 
std::basic_ostream<char,struct std::char_traits<char> 
 >::operator<<(class std::basic_ostream<char,struct 
std::char_traits<char> > & (__cdecl*)(class 
std::basic_ostream<char,struct std::char_traits<char> > &))" 
(??6?$basic_ostream at DU?$char_traits at D@std@@@std@@QAEAAV01 at P6AAAV01@AAV01@@Z at Z) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "class 
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl 
std::endl(class std::basic_ostream<char,struct std::char_traits<char> > 
&)" (?endl at std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AAV21@@Z) 
already defined in lookup.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "class 
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl 
std::operator<<<struct std::char_traits<char> >(class 
std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" 
(??$?6U?$char_traits at D@std@@@std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@0 at AAV10@PBD at Z) 
already defined in lookup.obj
lookup.obj : error LNK2001: unresolved external symbol "class 
std::basic_ostream<char,struct std::char_traits<char> > std::cout" 
(?cout at std@@3V?$basic_ostream at DU?$char_traits at D@std@@@1 at A)
Debug/TestSword.exe : fatal error LNK1120: 1 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Greg\My 
Documents\Visual Studio Projects\TestSword\Debug\BuildLog.htm"
TestSword - 21 error(s), 0 warning(s)


---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped

I apologize for the lack of formatting. If anyone can help, I greatly 
appreciate it!

God Bless <><
Greg

Greg Marine wrote:

> Chris,
>
> I appreciate your information. I think I'm going to need to go with MS 
> Visual Studio on Windows. You are correct about the Mozilla build 
> system. For Linux, I was thinking the same about GCC.
>
> Anyone,
>
> I want to apologize for my infancy with my questions, but I do have 
> another newbie question I'm afraid. I have succesfully compiled the 
> Sword library on both Windows and Linux but have no clue how to 
> include it into my wrapper projects. I searched MSDN and the internet 
> and have come up with nothing for Windows (MS VS). I'm beginning to 
> think my knowledge of C++ is so primitive I should probably start with 
> another project first. But if someone could give me some pointers on 
> what I need to do to get the compiled static library to get linked 
> against my own wrapper project on at least Windows, I would greatly 
> appreciate it! I'll get to the Linux version when I've gotten started 
> on Windows. Again, I am sorry for my infancy. I just truly want to 
> help out by providing an XPCOM wrapper for the Sword API. My knowledge 
> of the Mozilla technologies and other's like Java and VB aren't so 
> primitive and I'm not new to software development. Just new to C++.
>
> Thank you again for all you do for His Kingdom. This project inspires 
> me to continue persueing God's Calling for me to create Christian 
> software to help strengthen the Body of Christ.
>
> May God Bless you all <><
> Greg
>
> Chris Little wrote:
>
>> As Michael noted, the norm in Linux is to develop for GCC. Most of us 
>> probably just use text editors like emacs or vi for coding. I think 
>> the BibleTime guys may use KDevelop.
>>
>> On Windows, it's a whole other story. On that platform we use Borland 
>> C++ 5.0 for BibleCS development, though I think everything also works 
>> in 6.0. The library can also be compiled in MS Visual Studio 6.0 & 
>> .NET 2003 (7.1) and with Cygwin.
>>
>> If you plan to use the same tool for both Mozilla and Sword 
>> development, it will probably have to be MS Visual Studio.NET 2003. 
>> Mozilla has their own rather complex build system. No one has yet 
>> succeeded in building Moz in Borland.
>>
>> --Chris
>>
>> Greg Marine wrote:
>>
>>> Good day everyone,
>>>
>>> I read on the CrossWire website that Borland C++ was used to develop 
>>> parts of Sword. Like BibleCS or something. I'm curious as to which 
>>> version of Borland C++ is used and where it could be used to compile 
>>> on Linux too. I'm VERY new to C++ and not sure what IDE is best for 
>>> working with projects like Sword and the XPCOM wrapper I'd like to 
>>> create. I'm also interested in being able to compile and work with 
>>> Mozilla's software using the same tools as Sword. So, anyone who has 
>>> worked on Sword and has also successfully worked with Mozilla I am 
>>> curious about your thoughts. At the very least, I could use a 
>>> pointer to the best way to work with the Sword code base on Windows 
>>> and Linux. I really appreciate help any of you can offer.
>>>
>>> Thank you and God Bless <><
>>> Greg
>>>
>>> _______________________________________________
>>> sword-devel mailing list
>>> sword-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/sword-devel
>>
>>
>>
>> _______________________________________________
>> sword-devel mailing list
>> sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>
>
>
> _______________________________________________
> sword-devel mailing list
> sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel




More information about the sword-devel mailing list