List:MySQL++« Previous MessageNext Message »
From:Michael Nye Date:March 24 2007 12:41am
Subject:Re: Problems with Visual C++
View as plain text  
Hello again,

Yep I followed those instructions, and to make sure I hadn't done 
anything wrong I even tried putting a form into one of the examples 
which made it stop compiling.  There is a warning you get when adding a 
form to the mysql++ example which says

"You are adding a CLR component to a native project.  Your project will 
be converted to have Common Language Runtime support. Do you wish to 
continue"

, and below is the error output (no code on the form or modification to 
simple1):

    ------ Build started: Project: simple1, Configuration: Debug Win32
    ------
    Compiling...
    cl : Command line warning D9025 : overriding '/EHa' with '/EHs'
    cl : Command line error D8016 : '/clr' and '/EHs' command-line
    options are incompatible
    Build log was saved at "file://c:\Program
    Files\MySQL\mysql++-2.2.1\Debug\simple1\BuildLog.htm"
    simple1 - 1 error(s), 1 warning(s)

If I do it the other way around and try to include "mysql++.h" into a 
windows form project, it spits out alot of errors (this project has been 
set up as described in README.vc, with all the links to 
libraries/includes/dependencies inserted).  I can't fit all the errors 
in but here are some of them (106 in total):

------ Build started: Project: Test, Configuration: Debug Win32 ------
Compiling...
Login.cpp
D:\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h(7408) : 
error C2872: 'IDataObject' : ambiguous symbol
        could be 'D:\Microsoft Visual Studio 
8\VC\PlatformSDK\include\objidl.h(246) : 
System::Windows::Forms::IDataObject IDataObject'
        or 
'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll 
: System::Windows::Forms::IDataObject'
D:\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h(7408) : 
error C3699: '*' : cannot use this indirection on type 'IDataObject'
        compiler replacing '*' with '^' to continue parsing
D:\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h(7422) : 
error C2371: 'IDataObject' : redefinition; different basic types
        D:\Microsoft Visual Studio 
8\VC\PlatformSDK\include\objidl.h(246) : see declaration of 'IDataObject'
D:\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h(7583) : 
error C2872: 'IDataObject' : ambiguous symbol
        could be 'D:\Microsoft Visual Studio 
8\VC\PlatformSDK\include\objidl.h(7422) : IDataObject'
        or 
'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll 
: System::Windows::Forms::IDataObject'

<CUT HERE>

c:\program files\mysql\mysql++-2.2.1\lib\connection.h(52) : error C3389: 
__declspec(dllexport) cannot be used with /clr:pure or /clr:safe
c:\program files\mysql\mysql++-2.2.1\lib\connection.h(57) : error C3389: 
__declspec(dllexport) cannot be used with /clr:pure or /clr:safe
c:\program files\mysql\mysql++-2.2.1\lib\connection.h(117) : error 
C3395: 'mysqlpp::Connection::Connection' : __declspec(dllexport) cannot 
be applied to a function with the __clrcall calling convention
c:\program files\mysql\mysql++-2.2.1\lib\connection.h(117) : fatal error 
C1003: error count exceeds 100; stopping compilation
Build log was saved at "file://e:\Visual C++ 
Project\Test\Debug\BuildLog.htm"
Test - 106 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As much as I try to search around on the web, there seems to be little 
to no examples of people using windows forms but rather just console 
output which made me concerned.  Hope the extra info helps.

Michael.



Warren Young wrote:
> Michael Nye wrote:
>>
>> I'm trying to make a Windows Form program in Visual C++ that can 
>> interact with a mySQL database,
>
> Did you follow the instructions in README.vc?  Did you double-check 
> that you applied the required settings correctly?
>
> If that doesn't do it, post the error messages.  We can't guess.
>
Thread
Problems with Visual C++Michael Nye23 Mar
  • Re: Problems with Visual C++Warren Young23 Mar
    • Re: Problems with Visual C++Michael Nye24 Mar
      • Re: Problems with Visual C++gary clark24 Mar
        • Re: Problems with Visual C++Michael Nye25 Mar
          • RE: Problems with Visual C++Jim Wallace25 Mar
            • Re: Problems with Visual C++Michael Nye26 Mar
              • RE: Problems with Visual C++Jim Wallace26 Mar
                • Re: Problems with Visual C++Michael Nye28 Mar
        • Re: Problems with Visual C++Michael Nye26 Mar
Re: Problems with Visual C++Andre Sodermans29 Mar
  • Re: Problems with Visual C++Warren Young29 Mar
    • RE: Problems with Visual C++Matt Dargavel29 Mar
    • Re: Problems with Visual C++Warren Young29 Mar