Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRE: Who had focus. Any high level suggestion would be helpful. Pin
Member 40421-Dec-99 12:33
Member 40421-Dec-99 12:33 
QuestionHow to send data with method POST in cgi ??? Pin
Kobe20-Dec-99 2:23
Kobe20-Dec-99 2:23 
AnswerRE: How to send data with method POST in cgi ??? Pin
Ghazi20-Dec-99 3:59
Ghazi20-Dec-99 3:59 
AnswerRE: How to send data with method POST in cgi ??? Pin
Ghazi20-Dec-99 4:07
Ghazi20-Dec-99 4:07 
GeneralRE: RE: How to send data with method POST in cgi ??? Pin
Kobe20-Dec-99 5:23
Kobe20-Dec-99 5:23 
AnswerRE: How to send data with method POST in cgi ??? Pin
RAJIV25-Dec-99 14:53
RAJIV25-Dec-99 14:53 
QuestionHow to know that file .gif is animated or not ??? Pin
Kobe20-Dec-99 1:46
Kobe20-Dec-99 1:46 
AnswerRE: How to know that file .gif is animated or not ??? Pin
Cristi Posea20-Dec-99 4:46
Cristi Posea20-Dec-99 4:46 
AnswerRE: How to know that file .gif is animated or not ??? Pin
Anonymous20-Dec-99 13:19
suss Anonymous20-Dec-99 13:19 
Generaltapi Pin
Member 453419-Dec-99 22:44
Member 453419-Dec-99 22:44 
GeneralRE: tapi Pin
Anonymous22-Dec-99 10:38
suss Anonymous22-Dec-99 10:38 
Generalread jpg Pin
roni19-Dec-99 0:35
roni19-Dec-99 0:35 
GeneralRE: read jpg Pin
Dmitriy20-Dec-99 14:57
Dmitriy20-Dec-99 14:57 
GeneralRS485 communication Pin
Petr Stejskal18-Dec-99 7:40
Petr Stejskal18-Dec-99 7:40 
GeneralRE: RS485 communication Pin
Henk Devos21-Dec-99 9:26
Henk Devos21-Dec-99 9:26 
GeneralRE: RS485 communication Pin
Anonymous21-Dec-99 11:58
suss Anonymous21-Dec-99 11:58 
GeneralRE: RS485 communication Pin
Anonymous24-Dec-99 11:37
suss Anonymous24-Dec-99 11:37 
GeneralRE: RS485 communication Pin
Anonymous29-Dec-99 8:18
suss Anonymous29-Dec-99 8:18 
GeneralSHAppBarMessage Wrapper Pin
John Mancini17-Dec-99 17:24
John Mancini17-Dec-99 17:24 
GeneralRE: SHAppBarMessage Wrapper Pin
Shaun Wilde20-Dec-99 1:41
Shaun Wilde20-Dec-99 1:41 
GeneralRE: SHAppBarMessage Wrapper Pin
Andrei Zenkovitch20-Dec-99 4:32
Andrei Zenkovitch20-Dec-99 4:32 
Generalmontior browser activity Pin
SAWilde16-Dec-99 1:21
SAWilde16-Dec-99 1:21 
GeneralRE: montior browser activity Pin
Erik Thompson16-Dec-99 12:09
sitebuilderErik Thompson16-Dec-99 12:09 
QuestionHow do I use stl in a static lib? Pin
Brad Figg15-Dec-99 6:50
sussBrad Figg15-Dec-99 6:50 
AnswerRE: How do I use stl in a static lib? Pin
Jesse Ezell15-Dec-99 10:01
Jesse Ezell15-Dec-99 10:01 
For one, you aren't directly including the <string> header file as far as I can tell...that might have something to do with it. Of course, it might just be easier to use CString instead of string (it is what MFC uses anyway and it basically offers the same functionality).



==================
The original message was:

I'm trying to create a static lib with a simple class
that has a single method that returns a std::string. I
can build the static library just fine but when I link
my application against the static library I get an error
about multiple defines of std::basic_string.

Has anyone done this successfully?

Thanks,
Brad
-------------------------------------------------------

My header file:#if !defined( __CTest_h__ )
#define __CTest_h__


class CTest {
public:
CTest();
~CTest();

std::string Try( void );
};

#endif

------------------------------------------------------
The corresponding .cpp file:



#include "StdAfx.h"
#include "CTest.h"

CTest::CTest(
void
) {
}

CTest::~CTest(
void
) {
}

std::string CTest::Try(
void
) {
std::string strResult = "testing";

return strResult;
}

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

<string> is #included in StdAfx.h




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.