Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralICON Pin
Anthony988718-Mar-03 16:19
Anthony988718-Mar-03 16:19 
GeneralRe: ICON Pin
Dave Bryant18-Mar-03 16:26
Dave Bryant18-Mar-03 16:26 
GeneralAttention Graphics Programmers. Pin
73Zeppelin18-Mar-03 16:18
73Zeppelin18-Mar-03 16:18 
GeneralQuestions about VS as an IDE Pin
Jack Handy18-Mar-03 12:34
Jack Handy18-Mar-03 12:34 
GeneralRe: Questions about VS as an IDE Pin
73Zeppelin18-Mar-03 16:22
73Zeppelin18-Mar-03 16:22 
GeneralRe: Questions about VS as an IDE Pin
Phil Boyd18-Mar-03 16:31
Phil Boyd18-Mar-03 16:31 
GeneralRe: Questions about VS as an IDE Pin
Johnny ²18-Mar-03 21:53
Johnny ²18-Mar-03 21:53 
GeneralWhy whould this be lost?... Pin
CherezZaboro18-Mar-03 12:29
CherezZaboro18-Mar-03 12:29 
I have this in a static lib:

<br />
#ifdef _UNICODE<br />
typedef std::wstring _astr;<br />
#else<br />
typedef std::string _astr;<br />
#endif<br />
<br />
namespace SalieriFoundation<br />
{<br />
   namespace Globals<br />
   {<br />
     void Func(const _astr &message)<br />
     {<br />
      ...<br />
     }<br />
   }<br />
}<br />


Then I use it in a exe:

<br />
using namespace SalieriFoundation::Globals;<br />
<br />
Func(_T("the message"));<br />


So. I build ansi - fine. I build UNICODE and I get this:
<br />
<br />
Main.obj : error LNK2019: unresolved external symbol "void __cdecl SalieriFoundation::Globals::Func(class std::basic_string < unsigned short,struct std::char_traits < unsigned short > ,class std::allocator < unsigned short > > const &)" (?Func@Globals@SalieriFoundation@@YAXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function _main<br />


Edit: as asked by first reply changed the linker error message - added some spaces to avoid HTML-like text. Also I actualy have namespaces that you can see in the error message so I added in the above sample code - but I don't think it makes any diff.

What's wrong? Confused | :confused:
_UNICODE is defined in both projects.
I'm tying to find it for like 6 hours. Please help.
GeneralRe: Why whould this be lost?... Pin
Dave Bryant18-Mar-03 12:44
Dave Bryant18-Mar-03 12:44 
GeneralRe: Why whould this be lost?... Pin
CherezZaboro18-Mar-03 12:56
CherezZaboro18-Mar-03 12:56 
GeneralRe: Why whould this be lost?... Pin
Dave Bryant18-Mar-03 13:00
Dave Bryant18-Mar-03 13:00 
GeneralRe: Why whould this be lost?... Pin
CherezZaboro18-Mar-03 13:11
CherezZaboro18-Mar-03 13:11 
GeneralRe: Why whould this be lost?... Pin
Dave Bryant18-Mar-03 15:03
Dave Bryant18-Mar-03 15:03 
GeneralRe: Why whould this be lost?... Pin
CherezZaboro18-Mar-03 18:23
CherezZaboro18-Mar-03 18:23 
GeneralListView Colors..weird Pin
Bengi18-Mar-03 11:10
Bengi18-Mar-03 11:10 
GeneralRe: ListView Colors..weird Pin
Bengi18-Mar-03 23:18
Bengi18-Mar-03 23:18 
GeneralRe: ListView Colors..weird Pin
Alexinuk18-Mar-03 23:23
Alexinuk18-Mar-03 23:23 
GeneralCButton and DialogBar Pin
MemLeak18-Mar-03 10:48
MemLeak18-Mar-03 10:48 
GeneralRe: CButton and DialogBar Pin
Ravi Bhavnani18-Mar-03 10:54
professionalRavi Bhavnani18-Mar-03 10:54 
GeneralRe: CButton and DialogBar Pin
MemLeak19-Mar-03 7:38
MemLeak19-Mar-03 7:38 
GeneralRe: CButton and DialogBar Pin
Ravi Bhavnani19-Mar-03 8:14
professionalRavi Bhavnani19-Mar-03 8:14 
GeneralAviCap Questions Pin
User 1278218-Mar-03 10:13
User 1278218-Mar-03 10:13 
GeneralSAPI 5.1 and Win98... Pin
JoeSox18-Mar-03 9:42
JoeSox18-Mar-03 9:42 
GeneralRe: SAPI 5.1 and Win98... Pin
Tim Smith18-Mar-03 9:54
Tim Smith18-Mar-03 9:54 
GeneralRe: SAPI 5.1 and Win98... Pin
JoeSox19-Mar-03 9:43
JoeSox19-Mar-03 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.