Re: Oracle and Objective C++
Also file a bug report with Oracle: describe the issue and suggest to them that if they're using C++, they ought to use namespaces in order to avoid naming conflicts. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Oracle and Objective C++
Le 5 sept. 08 à 17:13, Bradley Randy a écrit : But I get the following errors when I try to compile it. Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here Line Location occiAQ.h:320: error: 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' Line Location occiAQ.h:321: error: 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' Can anybody tell me if this is because “Protocol” is a reserved word in Objective C? If so, can anyone think of a work=-around? The only idea I have is to call the OCCI code as a process with NSTask and pipe queries and results results back and forth. Thanks all. Protocol is not a reserved word, it is a type defined in runtime.h> #ifdef __OBJC__ @class Protocol; #else typedef struct objc_object Protocol; #endif A workaround may be to use a macro to hide the objc variable (untested). #define Protocol ObjCProtocol #import #undef Protocol An other workaround is to wrap your oracle calls into a .cpp file that includes "occiAQ.h", and then call thoses functions from you objcpp file. --- mywrapper.h extern int myOracleFunction(); --- mywrapper.c -- #include "mywrapper.h" #include "occiAQ.h" int myOracleFunction() { // perform oracle specific code } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Oracle and Objective C++
> But I get the following errors when I try to compile it. > > Line Location occiAQ.h:280: error: > 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here > Line Location occiAQ.h:280: error: > 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here > Line Location occiAQ.h:320: error: > 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' > Line Location occiAQ.h:321: error: > 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' > > Can anybody tell me if this is because ³Protocol² is a reserved word in Objective C? If so, can anyone think of a work=-around? The only idea I have is to call the OCCI code as a process with NSTask and pipe queries and results results back and forth. Thanks all. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Oracle and Objective C++
I'm having difficulty importing data from an Oracle database into a Cocoa application. I've installed the Oracle client and OCCI examples. The example occidml.cpp seemed to make and run just fine from the command line. Now, I would like to get some data from Oracle into my Cocoa application but I'm stuck. Since the Oracle header files are for C++ programs I thought an objective C++ solution would be the easiest. With obvious credit due to Oracle engineers, my header file starts off like: #import #include #include using namespace oracle::occi; using namespace std; class occiCon { private: Environment *env; Connection *conn; Statement *stmt; public: occiCon (string user, string passwd, string db){ env = Environment::createEnvironment (Environment::DEFAULT); conn = env->createConnection (user, passwd, db); } ~occiCon () { env->terminateConnection (conn); Environment::terminateEnvironment (env); } But I get the following errors when I try to compile it. Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here Line Location occiAQ.h:280: error: 'oracle::occi::aq::Subscription::Protocol' has a previous declaration here Line Location occiAQ.h:320: error: 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' Line Location occiAQ.h:321: error: 'oracle::occi::aq::Subscription::Protocol' referred to as 'struct' Looking at Oracle's header file: occiAQ.h in the area of line 280: ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]