'할거리'에 해당되는 글 28건

  1. 2015.06.18 BC++ Enable Debugging
  2. 2015.06.10 OpenCV 3.0 extra module C2589: '(': token not valid to the right error
  3. 2015.05.29 W1010 Method '%s' hides virtual method of base type '%s' (Delphi)
  4. 2015.05.22 CFileDialog cannot convert const char [22] to LPCTSTR
  5. 2015.05.22 Indy Send Unicode 문제
  6. 2015.05.14 ExtractStrings의 버그를 SeparateStrings 으로 해결
  7. 2015.05.11 E2034 Cannot convert 'char const[17]' to 'const wchar_t *'
  8. 2015.05.07 E2140 Declaration is not allowed here

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로 바꾸어 주어야 한다.

1 2 3 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!