{"id":19287495,"url":"https://github.com/tachoknight/oracle-pro-c-to-cpp-on-a-mac","last_synced_at":"2026-05-11T07:04:12.187Z","repository":{"id":22843598,"uuid":"26190886","full_name":"tachoknight/oracle-pro-c-to-cpp-on-a-mac","owner":"tachoknight","description":"Example project of using Oracle's Pro*C compiler on a Mac using C++11","archived":false,"fork":false,"pushed_at":"2014-11-04T22:40:19.000Z","size":136,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T06:11:18.714Z","etag":null,"topics":["clang","cpp","database","macos","oracle"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tachoknight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-04T22:05:28.000Z","updated_at":"2023-10-06T02:38:37.000Z","dependencies_parsed_at":"2022-08-05T20:00:18.467Z","dependency_job_id":null,"html_url":"https://github.com/tachoknight/oracle-pro-c-to-cpp-on-a-mac","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachoknight%2Foracle-pro-c-to-cpp-on-a-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachoknight%2Foracle-pro-c-to-cpp-on-a-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachoknight%2Foracle-pro-c-to-cpp-on-a-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachoknight%2Foracle-pro-c-to-cpp-on-a-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tachoknight","download_url":"https://codeload.github.com/tachoknight/oracle-pro-c-to-cpp-on-a-mac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240391840,"owners_count":19793961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","cpp","database","macos","oracle"],"created_at":"2024-11-09T22:06:05.267Z","updated_at":"2026-05-11T07:04:07.143Z","avatar_url":"https://github.com/tachoknight.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compiling and running an Oracle Pro\\*C-based application using C++-11.\n\nSo you want to write Oracle Pro\\*C programs on a Mac with C++11 features? So do I, and after looking through a lot of\nweb pages and experimentation, I've been able to come up with a basic project that:\n\n* Uses clang++ to compile C++11 source code\n* Uses Oracle's Mac-native 11g Instant Client installation with its accompanying Pro\\*C compiler\n* Works on the latest version of OS X (10.10 as of this writing) with the latest XCode toolchain.\n\nHopefully this helps someone who also wants to compile native Mac apps that use Oracle's databases. Enjoy!\n\n## Setup\n\nThe first thing needed is Oracle's Instant Client which is available at http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html.\nI used the 11.2.0.4.0 (64-bit) version and downloaded, well, pretty much everything except the WRC package (no idea what that's for). \nI installed everything into and defined $ORACLE_HOME as /opt/instantclient_11_2. \n\nThat's the only Oracle-specific thing that needs to be done, I assume XCode has been installed in the usual place and configured.\n\n## Files\n\n### `ora.cfg`\nThis is the configuration file that the Pro\\*C compiler will use to `mac_ora_cpp_test.pc` into `mac_ora_cpp_test.cpp`. It\ndefines the header locations (that took a *lot* of work to figure out!), along with code type (cpp). **Note!** The most\nimportant part of the file is `parse=none`. This is the only setting that will allow all the various C++ objects and classes\nto pass unaltered into the resulting cpp file. \n\n### `mac_ora_cpp_test.pc`\nThis is the actual source code that mingles Oracle sql with C++. It is hard-coded to log into a database identified as\n`orcl` with the standard scott/tiger user, open a cursor to get the employee name from the employee table, putting the\nname into a vector, and then after the cursor is done and closed, and after disconnecting from the database, uses a\nC++11 lambda to print the list of names.\n\n### `Makefile`\nStandard Makefile with the exception that it first invokes the Pro\\*C compiler, passing it the configuration file\n(`ora.cfg`), and connects to the database for validation. The resulting cpp file is then compiled with clang++ with\npretty much everything you *absolutely need to have* to get a binary. The only exception to this is that if you don't\nneed C++-11 features, then you can omit the -std=c++11 line.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachoknight%2Foracle-pro-c-to-cpp-on-a-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftachoknight%2Foracle-pro-c-to-cpp-on-a-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachoknight%2Foracle-pro-c-to-cpp-on-a-mac/lists"}