Re: link problem on inline function basic_istream::seekg
Re: link problem on inline function basic_istream::seekg
- Subject: Re: link problem on inline function basic_istream::seekg
- From: Victor Liu <email@hidden>
- Date: Mon, 12 Apr 2004 16:28:19 +0800
Hi Philip,
Thanks for your help.
yes, my code can compile with PB and run at 10.2 very well at before,
but I upgrade my system to 10.3 and use new tool xcode to build this
project for now and it cause some problem.
I do not how to solve this problem on new tool Xcode 1.1 upgrade, I got
some information in this list so I set target to OS 10.2 and SDK to
10.2.7 in Xcode, but it still can not pass Link stage.
one thing seems funny, in order to make sure the include path is direct
to '/Developter/SDKs/MacOSX10.2.7/usr/include' not system one, I change
the system path from '/usr/include/gcc' to '.../gcc-', to make sure
xcode can not use system path, the funny thing happen, xcode can not
find correct c++ header file ! why ? I already set the SDK settings to
MacOSX 10.2.7 SDK in project settings, it shall use
'/Developer/SDKs/....' not system one ! that is so strange.
Thanks.
Best Regards.
Victor.
On 2004/4/12, at $U$H 3:38, Philip Aker wrote:
On Sunday, Apr 11, 2004, at 22:28 US/Pacific, Victor Liu wrote:1
in my program that include <fstream> and use std::iftream in below
piece of code
It need compatible with 10.2 so I use 10.2.7 sdk and target set with
OS version 10.2.
it got a error at link stage :
ld: Undefined symbols:
std::basic_istream<char, std::char_traints<char>
>::seekg(std::fpos<__mbstate_t>)
I trace the <fstream> and find the seekg is be implement as below and
define at istream.tcc :
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
seekg(pos_type __pos) .....
I think that is a inline function, why this inline function not merge
in to my program's module and need a external function reference ?
please let me know if you have any idea regarding this problem.
ps. this problem did not happen at when I build it by use 10.3 sdk
and target
Hi Victor,
Trying in ProjectBuilder on OS 10.2.8.
#include <3 headers>
Guessing class LogFile {};
no AutoMutex
making one other change in ReadNext():
std::ifstream is( m_strFilename.c_str(), std::ios_base::in );
Seems to work.
HTH,
Philip Aker
http://www.aker.ca
########################################################
#include <iostream>
#include <sstream>
#include <fstream>
class LogFile {
public:
LogFile() {
m_lPersistKey = 0;
m_strFilename.assign( "logging.txt" );
m_nLineUnit = 0;
m_nMaxGetting = 1000;
}
void ReadNext( long key, std::string& result );
long m_lPersistKey;
long m_nLineUnit;
long m_nMaxGetting;
std::string m_strFilename;
};
void LogFile::ReadNext( long key, std::string& result ) {
std::ostringstream os;
/* regular the value of key */
if( key < m_lPersistKey ) {
key = m_lPersistKey;
}
//AutoMutex lock( m_mutex );
std::ifstream is( m_strFilename.c_str(), std::ios_base::in );
...
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.