BLOG ARTICLE 프로그래밍/C++ | 46 ARTICLE FOUND

  1. 2009.05.25 WSAStartup 링크 라이브러리
  2. 2009.05.25 /nodefaultlib:"libcd.lib" 했을 경우 링크오류시
  3. 2009.05.13 ACE 컴파일 방법(UNIX CC)
  4. 2009.04.22 fstream open
  5. 2009.03.31 VC.net 2005 time_t ... 64 & 32


int WSAStartup(
  __in   WORD wVersionRequested,
  __out  LPWSADATA lpWSAData
);
 
Ws2_32.lib 링크 옵션에 추가
AND

Linking...
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(locale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
libcpd.lib(_tolower.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
libcpd.lib(_toupper.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
libcpd.lib(wlocale.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol ___lc_codepage
libcpd.lib(_tolower.obj) : error LNK2001: unresolved external symbol ___lc_codepage
libcpd.lib(_toupper.obj) : error LNK2001: unresolved external symbol ___lc_codepage
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol ___lc_codepage
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(_tolower.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(_toupper.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(_tolower.obj) : error LNK2001: unresolved external symbol __pctype
libcpd.lib(_toupper.obj) : error LNK2001: unresolved external symbol __pctype
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __pctype
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol ___lc_collate_cp


=> 이런 링크오류시 링크 옵션 수정

instead of /nodefaultlib:"libcd.lib" , try this :

go into "project" , "setting" , "link" ,

for "catgory" choose "customize" and check the box "force file output"

This will allow for multiply defined symbols


 

 


 

AND


ACE컴파일하는 방법입니다.
 
ACE 컴파일하기 unix기반
 
1. ACE_ROOT를 세팅한다.
ex)
.profile을 열어서 다음을 넣어준다.
ACE_ROOT = /data/phyoon/MagicPKI30/ACE-5.3/ACE_wrappers
 
2. platfrom_macros.GNU를 만든다.
가장 가까운 platfrom과 심벌릭 링크를 하여 platfrom_macros.GNU를 만든다.
makeinclude로 이동한다.
 
cd /data/phyoon/MagicPKI30/ACE-5.3/ACE_wrappers/include/makeinclude
 
예를 들어 sun 5.x 가 O/S고 sunc++을 쓴다면
ln -s  platform_sunos5_sunc++.GNU platform_macros.GNU
를 한다.
 
3. config.h를 만든다.
가장 가까운 O/S와 심볼릭 링크하여 config.h를 만든다.
 
cd data/phyoon/MagicPKI30/ACE-5.3/ACE_wrappers/ace
ln -s config-sunos5.8.h config.h
 
4. 컴파일을 한다.
ace 디렉토리로 이동한다.
cd /data/phyoon/MagicPKI30/ACE-5.3/ACE_wrappers/ace
 
gmake명령을 내린다.
 
컴파일이 완료되면 ace library를 사용할 수 있다.
AND

fstream open

프로그래밍/C++ 2009. 4. 22. 11:02
void open ( const char * filename,
            ios_base::openmode mode = ios_base::in | ios_base::out );

Open file

Opens a file whose name is s, associating its content with the stream object to perform input/output operations on it. The operations allowed and some operating details depend on parameter mode.

The function effectively calls rdbuf()->open(filename,mode).

If the object already has a file associated (open), the function fails.

On failure, the failbit flag is set (which can be checked with member fail), and depending on the value set with exceptions an exception may be thrown.

Parameters

filename
C-string containing the name of the file to be opened.
mode
Flags describing the requested i/o mode for the file. This is an object of type ios_base::openmode, which consists on a combination of one or more of the following flags defined as member constants:
flag value opening mode
app (append) Set the stream's position indicator to the end of the stream before each output operation.
ate (at end) Set the stream's position indicator to the end of the stream on opening.
binary (binary) Consider stream as binary rather than text.
in (input) Allow input operations on the stream.
out (output) Allow output operations on the stream.
trunc (truncate) Any current content is discarded, assuming a length of zero on opening.


Return Value

none

Example

// fstream::open
#include <fstream>
using namespace std;

int main () {

  fstream filestr;

  filestr.open ("test.txt", fstream::in | fstream::out | fstream::app);

  // >> i/o operations here <<

  filestr.close();

  return 0;
}


This example opens a file to append content.

AND


In Visual C++ 2005, time is a wrapper for _time64 and time_t is, by default, equivalent to __time64_t. If you need to force the compiler to interpret time_t as the old 32-bit time_t, you can define _USE_32BIT_TIME_T. This is not recommended because your application may fail after January 18, 2038; the use of this macro is not allowed on 64-bit platforms.

AND