0 Replies Latest reply on Mar 1, 2006 8:15 AM by 480036

    Does OCCI work with VC 7.1 MFC project???

    480036
      Hi, does OCCI work with VC 7.1 MFC project???
      (I use Oracle XE)

      If I tried this:

      1) I create new Win32 Console Project (Empty)
      2) I add occidml.cpp
      3) I add to Preprocessor: WIN32COMMON;_DLL;_MT
      4) I add to Linker: oci.lib msvcrt.lib msvcprt.lib oraocci10d.lib and /NODEFAULTLIB
      5) I copy header files to Vc7\include, library files to project directory and dll files to Debug directory. All files I get from c:\oraclexe\app\oracle\product\10.2.0\server\OCI\
      6) I modify user and passwd in occidml.cpp to my values
      7) I compile my application

      All worked, but when I tried this:

      1) I created new MFC Aplication (Dialog Based) with name "test2"
      2) I added only:
           #include <iostream>
           #include <occi.h>
           using namespace oracle::occi;
           using namespace std;
      into test2Dlg.cpp
      3) I added to Preprocessor: WIN32COMMON;_DLL;_MT (Debug and Release)
      4)
      I added to Linker: oci.lib msvcrt.lib msvcprt.lib oraocci10d.lib and /NODEFAULTLIB (Debug)
      I added to Linker: oci.lib msvcrt.lib msvcprt.lib oraocci10.lib and /NODEFAULTLIB (Release)
      5) I copied header files to Vc7\include, library files (oci.lib, oraocci10.lib and oraocci10d.lib) to project directory and dll files to Debug and Release directory. All files I got from c:\oraclexe\app\oracle\product\10.2.0\server\OCI\
      6) And I compiled my application:

      I got this errors:

      in Debug mode:
      Compiling...
      stdafx.cpp
      Compiling...
      test2Dlg.cpp
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : warning C4229: anachronism used : modifiers on data are ignored
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2365: 'new' : redefinition; previous definition was a 'member function'
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2491: 'new' : definition of dllimport data not allowed
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2078: too many initializers
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2440: 'initializing' : cannot convert from 'int' to 'void *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2143: syntax error : missing ';' before '('
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(29) : error C2226: syntax error : unexpected type 'size_t'
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(30) : error C2059: syntax error : ')'
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : warning C4229: anachronism used : modifiers on data are ignored
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C2365: 'new' : redefinition; previous definition was a 'member function'
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C2491: 'new' : definition of dllimport data not allowed
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C2078: too many initializers
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C2440: 'initializing' : cannot convert from 'int' to 'void *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C2143: syntax error : missing ';' before '['
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(33) : error C3409: empty attribute block is not allowed
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(34) : warning C4091: '' : ignored on left of '__w64 unsigned int' when no variable is declared
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(34) : error C2143: syntax error : missing ';' before ','
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(34) : error C2059: syntax error : ','
      c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xdebug(34) : fatal error C1004: unexpected end of file found test2.cpp

      in Release mode:
      Compiling...
      stdafx.cpp
      Compiling...
      test2Dlg.cpp
      test2.cpp
      Generating Code...
      Compiling resources...
      Linking...
      test2.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
      test2Dlg.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
      stdafx.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
      test2.obj : error LNK2001: unresolved external symbol __afxForceSTDAFX
      test2Dlg.obj : error LNK2001: unresolved external symbol __afxForceSTDAFX
      stdafx.obj : error LNK2001: unresolved external symbol __afxForceSTDAFX
      test2.obj : error LNK2001: unresolved external symbol "protected: void __thiscall CWinApp::OnHelp(void)" (?OnHelp@CWinApp@@IAEXXZ)
      etc.

      What I do wrong? Or OCCI does not work with VC 7.1 with MFC? Does I use wrong headers or libraries or version of Visual C++?