X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_40,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-class: urn:content-classes:message Subject: Oracle OCI under cygwin Date: Wed, 7 Mar 2012 14:38:03 +0100 Message-ID: <6BFA9AF2C7556E42AFF3F187ECAB07B802DAF981@bespdc01.mediaxim.local> From: "Michel Bardiaux" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q27DcVxZ003125 I have an up-to-date cygwin on XP SP3 (and yes, rebasealled). I have also installed the Oracle basic (NOT instant) client for Win32. And I have a C application that queries an Oracle DB using OCI. Another relevant bit of setup info: environment variable TNS_ADMIN = \\besprd01\techdoc\database\oracle\OracleNet_WinClient (set in XP Control Panel). Now, when compiled with MS Visual Studio 2010 Express, and run from a DOS (sic) box, the app works fine, which proves both the app and the setup are basically fine. Ditto when run from a Cygwin mintty. But if I compile my app with cygwin, and run it in mintty (of course), I get an error message meaning essentially that OCILogon failed because it did not find an Oracle config file called tnsnames.ora that is supposed to be in $TNS_ADMIN. Strace gives no clue - because the app WORKS when run by strace! The Win32 PROCMON shows that tnsnames.ora is looked for in %TNS_ADMIN% for the pure win32 app, but in the local directory for the cygwin app. Indeed, if I kluge my code in the cygwin case to temporarily chdir to $TNS_ADMIN (rewritten as a cygwin path of course) just before calling OCILogon, it works. So, it is all rather mysterious. My guess is that some magic is done inside cygwin that intercepts some "system calls" (though there is not really such a thing in Windows) made by the Oracle libs and transforms them in some way. But I am not familiar enough with cygwin internals to go much farther (besides, my C++ is minimal). Help? Please? Pretty please? (s) Michel Bardiaux -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple