'분류 전체보기'에 해당되는 글 33건

  1. 2015.06.24 OpenCV warning C4819 current code page (949)
  2. 2015.06.18 BC++ Enable Debugging
  3. 2015.06.10 OpenCV 3.0 extra module C2589: '(': token not valid to the right error
  4. 2015.05.29 W1010 Method '%s' hides virtual method of base type '%s' (Delphi)
  5. 2015.05.22 CFileDialog cannot convert const char [22] to LPCTSTR
  6. 2015.05.22 Indy Send Unicode 문제
  7. 2015.05.14 ExtractStrings의 버그를 SeparateStrings 으로 해결
  8. 2015.05.11 E2034 Cannot convert 'char const[17]' to 'const wchar_t *'
  9. 2015.05.07 E2140 Declaration is not allowed here
  10. 2015.03.19 [스포모] #04 - 모스크바 공항 환승



opencv2/core/mat.hpp(1965): 

warning C4819: 

The file contains a character that cannot be represented in the current code page (949).

Save the file in Unicode format to prevent data loss



Solution: 

File Save As...

Unicode UTF-8 with signature Codepage 65001


BC++ Enable Debugging

할거리/BC 2015. 6. 18. 16:43

Ref : http://support.smartbear.com/viewarticle/54602/


This topic explains how to prepare 64-bit applications created with Embarcadero C++Builder XE3 - XE5 for AQtime.

To learn how to prepare 32-bit applications created with C++Builder, see Compiler Settings for Embarcadero C++Builder XE3 - XE5 (32-bit). To learn how to prepare applications created with other C++Builder versions, see Compiler Settings for Native Applications.

Note:64-bit applications created with Embarcadero RAD Studio XE3 - XE5 are not currently supported by the Allocation profiler.

To prepare a 64-bit Embarcadero C++Builder application for AQtime, first of all, you need to make sure that it includes debug information. Follow these steps:

  1. Open your project in C++Builder XE3, XE4 or XE5.

  2. Choose Project | Options from the main menu to open the Project Options dialog.

  3. In the tree on the left of the dialog, select the C++ Compiler | Debugging category. To include symbolic debug information, set the Debug information option to True.

    Project Options: C++ Compiler | Debugging
    Click the image to enlarge it.
  4. To set the Delphi compiler options, select the Delphi Compiler | Compiling category from the tree view on the left of the dialog:

    • To include symbolic debug information, set the Debug information option to True. In addition, to refer this information to source line numbers, set the Local symbols option to True.

      Project Options: Delphi Compiler |Compiling
      Click the image to enlarge it.
    • (Optional) To generate stack frames when using the Delphi compiler, set the Stack frames option to True.

      Project Options: Delphi Compiler | Compiling
      Click the image to enlarge it.
  5. Switch to the C++ Linker category and set the Full debug information option to True.

    Project Options: C++ Linker
    Click the image to enlarge it.
  6. To generate a map file that contains information on the application’s global symbols, source files and source line numbers, switch to the C++ Linker | Output category and set theMap file type option to Map file with segmentsMap file with publics or Detailed segment map.

    Project Options: Directories and Conditionals
    Click the image to enlarge it.
  7. Switch to the C++ (Shared Options) category and check the Library path option. Make sure that the path contains the $(BDS)\lib\$(PLATFORM)\debug folder:

    Project Options: Directories and Conditionals
    Click the image to enlarge it.
  8. Once you have set the compiler and linker options correctly, rebuild your application and it will be ready for profiling. If you are profiling an ActiveX control or a COM server, you need to register its “debug” version in the system (See Profiling COM Applications).

When your application is ready for release, remember to recompile it without debug information to reduce the application size.

Note:AQtime is incompatible with some third-party tools that modify the binary code of your application (for example, those that add a custom exception handling mechanism). An example of such a tool is EurekaLog. We recommend that you profile your application before processing it with such tools.

Nevertheless, AQtime is compatible with AQtrace and supports profiling of applications that use AQtrace for error reporting.

See also
Compiler Settings for Native Applications


http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

OpenCV v3.0 컴파일 진행중에...

OpenCV\opencv_contrib\modules\text\src\erfilter.cpp  파일에서,

p = std::numeric_limits<double>::min();


C2589: '(': token not valid to the right '::'

이런 에러가 나오고 멈춘다.


http://answers.opencv.org/question/62107/erfiltercpp-nfa-method/

min() 이 부분이 

minwindef.h
#define min(a,b)            (((a) < (b)) ? (a) : (b))

위와 같이 연결되니까, 당연히 (a,b)가 없다고 에러가 나올수 밖에.


Solution :

(1) OpenCV\opencv_contrib\modules\text\src\precomp.hpp 파일안에,

// added by Michael : 2015-06-10

#if defined WIN32 || defined WINCE

    #if !defined _WIN32_WINNT

        #ifdef HAVE_MSMF

            #define _WIN32_WINNT 0x0600 // Windows Vista

        #else

            #define _WIN32_WINNT 0x0500 // Windows 2000

        #endif

    #endif


    #include <windows.h>

    #undef small

    #undef min

    #undef max

    #undef abs

#endif

제일 아래쪽에 위 코드 추가한다.
즉, window.h 추가하고나서, #undef min 을 해버리면 된다.



(2) 번째 방법은, 
#NOMINMAX
#include <windows.h>

windows.h 추가하기 전에 #NOMINMAX 해버리면, min, max 정의하지 않으므로 OK


-끝.

[dcc32 Warning] SjAppGetVersion.pas(13): W1010 Method 'Create' hides virtual method of base type 'TComponent'


  TComponent = class(TPersistent, IInterface, IInterfaceComponentReference)

  public

    constructor Create(AOwner: TComponent); virtual;


  TSjAppVersion = class(TComponent)

  public

    constructor Create( AOwner : TComponent );

There are three alternatives to take when solving this warning. 

(1) constructor Create( AOwner : TComponent ); override;

You could specify override to make the derived class' procedure also virtual, 

if the ancestor's respective method is declared as virtual or dynamic, and thus allowing inherited calls to still reference the original procedure. 

(2) constructor Create2( AOwner : TComponent );

You could change the name of the procedure as it is declared in the derived class.

  Both of these methods are exhibited in the source code snippets above. 


(3) constructor Create( AOwner : TComponent ); reintroduce;

  You could add the reintroduce directive to the procedure declaration 

to cause the warning to be silenced for that particular method.

The reintroduce keyword instructs the Delphi compiler to hide the respective method 

and suppress the warning, 

because it is unlikely to override a method of the same name from a base class that is not virtual or dynamic. 

CFileDialog *d;

d = new CFileDialog(

                TRUE, NULL,  NULL, 

                OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,

"All Files (*.*)|*.*||" );


Error 7 error C2664: 'CFileDialog::CFileDialog(const CFileDialog &)' : cannot convert argument 5 from 'const char [22]' to 'LPCTSTR' c:\delpapp\app\howto\gerberplot\gerberplotdlg.cpp 454 1 GerberPlot


해결 :


TCHAR szFilter[] = _T("All Files (*.*)|*.*||");

d = new CFileDialog(

                TRUE, NULL,  NULL, 

                OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST,

szFilter);

Embarcadero 2009 또는 XE 부터 Unicode 가 도입되면서

기존의  component 들 모두 Unicode 문제에 봉착.


Indy 에서 send / receive 할 때, 한글이 포함되면 ?

당연히 깨진다.


해결방법은 ?


보낼 때 : 

UnnicodeString strSend;

IdUDPClient1->Send(strSend, IndyTextEncoding_UTF8());


받을 때 :

void __fastcall TfrmUDP::IdUDPServer1UDPRead(TIdUDPListenerThread *AThread, TBytes AData, TIdSocketHandle *ABinding)

이 함수에다,

Unicodestring BData = BytesToString(AData, IndyTextEncoding_UTF8());


이렇게 처리해주면 된다.

참조 : 

http://www.borlandtalk.com/extractstrings-question-vt90577.html


TStrings 사용하려면 -> #include <Classes.hpp>



int __fastcall SeparateStrings(const AnsiString &AString, char ADelimiter, TStrings *AStrings)

  int Result = 0; 


  if( (AString.Length() > 0) && (AStrings) ) { 

    AStrings->BeginUpdate(); 

    try 

    { 

      char *ptr = const_cast<AnsiString&>(AString).c_str(); 

      char *end = (ptr + AString.Length()); 


      while( (*ptr <= ' ') && (ptr < end) ) 

      ++ptr; 


      char *start = ptr; 

      bool InQuote = false; 


      while( ptr < end ) 

      { 

        if( (*ptr == ADelimiter) && (!InQuote) ) 

        { 

          AStrings->Add(AnsiString(start, ptr-start)); 

          ++Result; 

          start = ++ptr; 

        } 

        else if( *ptr == '"' ) 

        { 

          InQuote = !InQuote; 

          ++ptr; 

        } 

        else 

          ++ptr; 

      } 


      if( start < end ) 

      { 

        AStrings->Add(AnsiString(start, end-start)); 

        ++Result; 

      } 

    } 

    __finally { 

      AStrings->EndUpdate(); 

    } 

  } 


  return Result; 



long DoMsgPrintf(TColor theColor, const TCHAR * fmt, ...);


DoMsgPrintf(clBlack, "Output : %X (%d)", Data, Data );

이렇게 call 하면 에러가 난다.


DoMsgPrintf(clBlack,_T("Output : %X (%d)"), Data, Data );

_T( ) 를 넣어주어야 한다.

winnt.h 추가



또는

DoMsgPrintf(clBlack,(TCHAR *)("Output : %X (%d)"), Data, Data );


OpenCV GOCR 추가하는 중에,

barcode.c

1229 라인 : char *code=0; int cpos=0;

E2140 Declaration is not allowed here

이런 에러가 발생


원인 : 확장자가 c 이므로 생기는 문제

해결 : Project -> Options -> C++ Compiler 들어가서,

Force C++ compile 를 true로 바꾸어 주어야 한다.

최소 2시간 정도 시간이 남는데, 검색대 통과로 그 여유의 1/4 정도가 사라진다.


1. 게이트와 시간 확인 필수

인솔자 얘기로는 게이트가 수시로 바뀐다고 했다.

시간 지연도 자주 일어나고.

실제 귀국시에 게이트 변경 및 시간 지연이 있었다.

수시로 현황을 확인해야 한다.


2. 환승 검색대 통과

환승할 때 소지품 검사를 다시 받는다.

2군데서 검사하는데, 길게 늘어선 줄은 쉽게 줄어들지 않는다.

통과할때 소리가 나면 다시 검사.

결국 벨트까지 풀어야 하는데, 구두에 쇠붙이라도 있다면 구두까지 벗어야 한다.

여기서 최소 2-30분 소요


3. 보딩 패스에 도장 찍는 것

무슨 이유인지는 모르겠지만, 검색대 대기하는 곳 옆에, 보딩 패스에 도장을 찍어주는 사람이 있다.

여기에서도 줄이 길면 5~10분 걸린다.

그런데, 무슨 도장인지, 왜 찍어야 하는지 아무도 모른다. 물론, 도장 확인/검사하는 곳도 없다.

웃기는 상황이지만, 도장 찍는 직업이 만들어져 있기 때문에 찍을 수 밖에 없는 상황으로 보인다.


여행사의 인솔자들도 의견이 갈린다.

"XX여행 분들 도장 반드시 찍어셔야 합니다"

우리 여행사 인솔자에게 물어보니, 그거 왜 찍냐고 되려 반문한다.


귀국할때는 도장찍는 직원이 늘어선 줄 사이로 돌아다니면서 도장을 찍어주었다.

필요없는 도장 받기는 받았지만, 아마도 이게 그 사람의 천직이려니 생각할 수 밖에.


4. 공항 면세점

사진은 면세점이 아니라, 대기 및 가게들.

모든게 다 비싸다. 면세점의 작은 음료수 캔 1개에 3천원 정도.

유로를 받는 곳도 있고 러시아화(루블)만 받는 곳도 있다.

유로를 낼 때는 당연히 환율 손해를 좀 감안해야 한다.


5. wifi

그냥은 안된다.

저 위에 보이는 음료수 가게에서 wifi 지원한다고 되어 있다.

로밍을 했으면 카톡 정도 가능한 수준의 속도가 나온다.


'볼거리 > 2015-SPM' 카테고리의 다른 글

[스포모] #03 - 인천공항 - 주차  (0) 2015.03.10
[스포모] #02 - 스포모에 대해  (0) 2015.03.07
[스포모] #01 - 기록을 시작하며  (2) 2015.03.06
1 2 3 4 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!