Friday, January 18, 2013

Path of header file for OpenGL at Mac OS (C++ Builder XE3)

[Reference]

OpenGL Multicolor Tetrahedron (C++)


Adding the OpenGL and GLUT Frameworks

When a C++ console application is created, the OpenGL and GLUT frameworks are by default not included. To include them, open the Remote Profiles panel and click the Add a new path item button from the right-hand side. In theAdd Remote Path Item or Edit Remote Path Item dialog:
  • For OpenGL, set the path on remote machine /System/Library/Frameworks, the file mask OpenGL, and the path type Framework.
  • For GLUT, set the path on remote machine /System/Library/Frameworks, the file mask GLUT, and the path type Framework.

Update: The path on remote machine for newer version of XCode may change to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks



Update local file cache

See also:
http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html

and

http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_drawing/opengl_drawing.html#//apple_ref/doc/uid/TP40001987-CH404-SW8

C++ Builder XE3 Predefined Macros




(http://docwiki.embarcadero.com/RADStudio/XE3/en/Predefined_Macros)

The C++ compiler predefines certain global identifiers, known as manifest constants. Most global identifiers begin and end with two underscores (__).

Note: For readability, underscores are often separated by a single blank space. In your source code, you should never insert whitespace between underscores.

For macros whose value takes the form of 0x0nnn, the version number (nnn) is determined by the version number of the associated C++ compiler executable. Beginning with the XE release, you can verify the version number using the --version option to BCC32.EXE.

MacroValueDescription
__APPLE__
Defined only in compilers that support cross compiling with a target of MAC OSX. See BCCOSX.EXE, the C++ Cross Compiler for OS X.
__BCOPT__
1
Defined only in compilers that support optimization, therefore always defined.
__BCPLUSPLUS__
Values are listed in C++ Compiler Versions in this topic.
Defined if you've selected C++ compilation; will increase in later releases.
__BOOL__
1
Indicates that the bool keyword is accepted.
__BORLANDC__
Values are listed in C++ Compiler Versions in this topic.
Version number.
__CDECL__
1
Defined if Calling Convention is set to cdecl; otherwise undefined.
_CHAR_UNSIGNED
1
Undefined by default. Using the -K switch to make the default character unsigned causes this macro to be defined. Ultimately, the -K option controls how a char is extended when converted to an int. By default, the compiler sign-extends, but if you enable _CHAR_UNSIGNED_, then the compiler zero-extends characters when converting to int.
_clang_ 
Defined if BCC64 is in use.
__CODEGEARC__
Values are listed in C++ Compiler Versions and in this topic.
Version number.
__CODEGEARC_VERSION__
  • Major version number is bits 31..24
  • Minor version number is bits 23..16
  • Internal version number is bits 15..0
This internal macro expands to an integer that encodes the compiler's major version, minor version, and an internal number. See Example of __CODEGEARC_VERSION__ Macro.
__CODEGUARD__
Defined whenever one of the CodeGuard compiler options is used; otherwise it is undefined.
__CONSOLE__
1
When defined, the macro indicates that the program is a console application.
_CPPUNWIND
1
Enable stack unwinding. This is true by default; use -xd-!ALink(OSCGExceptions1) to disable.
__cplusplus
1
Defined if in C++ mode; otherwise, undefined.
__DATE__
String literal
Date when processing began on the current file.
__DLL__
1
Defined whenever the -WD compiler option is used; otherwise it is undefined.
__FILE__
String literal
Name of the current file being processed.
__FLAT__
1
Defined when compiling in 32-bit flat memory model.
__FUNC__ or__FUNCTION__
String literal
Name of the current function being processed. More details.
__LINE__
Decimal constant
Number of the current source file line being processed.
__MACH__
Defined only in compilers that support cross compiling with a target of MAC OSX.
_M_IX86
0x12c
Always defined. The default value is 300. You can change the value to 400 or 500 by using the /4 or /5 compiler options.
__MT__
1
Defined only if the -tWM option is used. It specifies that the multithread library is to be linked.
__PASCAL__
1
Defined if Calling Convention is set to Pascal; otherwise undefined.
_PUSHPOP_SUPPORTED
1
Always defined; allows Microsoft standard headers to use push and pop to verify whether a feature is supported.
_STDCALL_SUPPORTED
1
Always defined; defines the Microsoft stdcall calling convention.
__STDC__
1
Defined if you compile with the -A compiler option; otherwise, it is undefined.
__TCPLUSPLUS__
Values are listed in C++ Compiler Versions in this topic.
Version number.
__TEMPLATES__
1
Defined as 1 for C++ files (meaning that templates are supported); otherwise, it is undefined.
__TIME__
String literal
Time when processing began on the current file.
__TLS__
1
Thread Local Storage. Always true.
__TURBOC__
Values are listed in C++ Compiler Versions and in this topic.
Will increase in later releases.
_UNICODE and UNICODE
Defined for C++ programs that use the VCL.
_WCHAR_T
Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_WCHAR_T_DEFINED
Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_Windows
1
Defined when compiling on the Windows platform.
__WIN32__
1
Defined for console and GUI applications on the 32-bit Windows platform.
_WIN64
1
Defined for console and GUI applications on the 64-bit Windows platform.
Note: The predefined macros __DATE____FILE__ __FUNC____LINE____STDC__, and __TIME__ cannot be redefined or undefined.

C++ Compiler Versions in Predefined Macros

The macros defined for the C++ compiler (such as __CODEGEARC__) have the following version numbers:
  • 0x0570 for BDS 2006
  • 0x0590 for C++Builder 2007
  • 0x0591 for update 1 to C++Builder 2007
  • 0x0592 for RAD Studio 2007
  • 0x0593 for the December update to RAD Studio 2007
  • 0x0610 for C++Builder 2009 and for C++Builder 2009 Update 1
  • 0x0620 for C++Builder 2010 and for C++Builder 2010 Update 1
  • 0x0621 for C++Builder 2010 Update 2
  • 0x0630 for C++Builder XE
  • 0x0631 for C++Builder XE Update 1
  • 0x0640 for C++Builder XE2
  • 0x0650 for C++Builder XE3

Macros Defined Elsewhere

The following macros are defined for backwards-compatibility when you #include System.hpp:
MacroValueDescription
ANSISTRING_AS_TEMPLATE
AnsiString type is defined as a template class, AnsiString<T>.
_STRINGCHECKS_OFF
(no longer supported)
In past releases, C++ programs expected the Delphi compiler to not set the STRINGCHECKS directive. The Delphi compiler no longer supports the STRINGCHECKS directive, so the related _STRINGCHECKS_OFF C++ macro is unnecessary and is no longer set. Therefore if you are migrating pre-2009 code to the current version, you need to update the event-handler signature (because a pre-2009 event handler expects AnsiString, while the run time now sends UnicodeString). See Unicode in RAD Studio.

See Also



C++ Builder XE3 MAC OS X [ILINK32 Error] Fatal: Error detected (ILI1548)

[Project]->[Options...]->[Packages]->[Runtime Packages]->[Link with runtime packages]  MUST be [true].


Thursday, January 17, 2013

[bccosx Error] sysmac.h(65): E2209 Unable to open include file 'CoreFoundation/CoreFoundation.h'

Mac OS X  Client 端需安裝 XCode command line tools.
安裝方法 :

參考:
http://www.itwriting.com/blog/7032-hands-on-cross-platform-windows-and-mac-with-c-builder-xe3.html

or

http://docwiki.embarcadero.com/RADStudio/XE3/en/Connecting_Your_PC_to_a_Mac#Xcode_Is_Required_on_the_Mac_for_C.2B.2B_and_FMX)


Xcode Is Required on the Mac for C++ and FMX

Xcode is the development and debug environment on the Mac, and provides the required development files for OS X applications.

Installing Xcode on Your Mac

You can install Xcode from any of the following sources:
  • On your "Mac OS X Install" DVD, under Optional Installs, double-click Xcode.mpkg to install Xcode on your system.
  • At the Mac App Store, download Xcode for free.
  • As a registered Apple Developer, you can download the free version of Xcode. To register and then download Xcode:
    1. Register (free of charge) as an Apple Developer at http://developer.apple.com/programs/register/.
    2. Go to the Mac Dev Center
    3. Click the View in Mac App Store link associated with Xcode, and download Xcode to your Mac.

Installing Xcode Command Line Tools (for C/C++ Development)

A clean install of the Lion operating system (OS X 107), even with Xcode, does not contain /usr/include. You also need to install the Xcode command-line tools.
You can download the command line tools in either of two ways:
To install the necessary Xcode tools from the Web:
You can download the Xcode command line tools directly from the developer portal as a .dmg file.
  1. On the Mac, go to https://developer.apple.com/downloads/index.action
    You are asked for your Apple Developer login during the install process.
  2. On the "Downloads for Apple Developers" list, select the Command Line Tools entry that you want.
To install the necessary Xcode tools from Xcode:
  1. Start Xcode on the Mac.
  2. Choose Preferences from the Xcode menu.
  3. In the General panel, click Downloads.
  4. On the Downloads window, choose the Components tab.
  5. Click the Install button next to Command Line Tools.
    You are asked for your Apple Developer login during the install process.


Wednesday, January 2, 2013

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...