Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3754

LP:808233 - Default Int or undefined uint in typelib.h

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      When trying to build a client application against the mariaDB 5.2.4 or 5.2.7 library the compiler complains about undefined uint in the line.

      my system info
      windows XP pro 32bit
      mariaDB 5.2.7 and 5.2.4 noinstall zip's tested and same results occur on both visual c++ 2005 and visual c++2010
      with 5.2.4 and 5.2.7

      If this builds on nix or with a C compiler it because assumes its a int (default int) then that could be another issue as well, as uint would say to me that its suppose to be a unsigned int.

      The error occurs on the line 32 and 33 of typelib.h

      extern uint find_type_or_exit(const char *x, TYPELIB *typelib,
      const char *option);

      The compiler error messages are

      d:\mariadb\include\typelib.h(32) : error C2146: syntax error : missing ';' before identifier 'find_type_or_exit'
      d:\mariadb\include\typelib.h(32) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      d:\mariadb\include\typelib.h(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

      the fix is

      extern unsigned int find_type_or_exit(const char *x, TYPELIB *typelib,
      const char *option);

      eadthem

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Default Int or undefined uint in typelib.h
            I fixed it in 5.1 upwards. The workaround is to include my_global. h

            "If this builds on nix or with a C compiler it because assumes its a int (default int) then that could be another issue as well, as uint would say to me that its suppose to be a unsigned int."

            Would not build with C compiler either, unless uint is defined (C4430 is followup error, the real one is C2146)

            On Unixes, uint is often be typedefed in system headers, thus it builds.

            Show
            wlad Vladislav Vaintroub added a comment - Re: Default Int or undefined uint in typelib.h I fixed it in 5.1 upwards. The workaround is to include my_global. h "If this builds on nix or with a C compiler it because assumes its a int (default int) then that could be another issue as well, as uint would say to me that its suppose to be a unsigned int." Would not build with C compiler either, unless uint is defined (C4430 is followup error, the real one is C2146) On Unixes, uint is often be typedefed in system headers, thus it builds.
            Hide
            eadthemakip eadthem akip added a comment -

            Re: Default Int or undefined uint in typelib.h
            I tested the fix by adding #include "my_global.h" to the orignal files of both 5.2.4 and 5.2.7 and i receved the error messages.

            d:\mariadb\include\my_global.h(605) : fatal error C1083: Cannot open include file: 'my_valgrind.h': No such file or directory

            i was not able to find my_valgrind.h in any of the noinstall zips for windows.

            i also had to change my inclusion of winsock.h to winsock2.h in my applcation as winsock.h was causing redefinition issues once my_global.h was included.

            I pulled my_valgrind.h out of the source tarball for 5.2.4 , placed it in the /include/ folder and received the following error messages.

            ------------------------------------------------------------------------
            d:\mariadb\include\my_compiler.h(104) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(105) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(106) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(107) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(108) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(109) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(126) : error C2894: templates cannot be declared to have 'C' linkage
            d:\program files\microsoft visual studio 8\vc\include\new(53) : error C2732: linkage specification contradicts earlier specification for 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(53) : see declaration of 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(54) : error C2732: linkage specification contradicts earlier specification for 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(54) : see declaration of 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(80) : error C2732: linkage specification contradicts earlier specification for 'operator delete[]'
            d:\program files\microsoft visual studio 8\vc\include\new(80) : see declaration of 'operator delete[]'
            d:\program files\microsoft visual studio 8\vc\include\new(83) : error C2732: linkage specification contradicts earlier specification for 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(82) : see declaration of 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(88) : error C2733: second C linkage of overloaded function 'operator new' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(87) : see declaration of 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(91) : error C2733: second C linkage of overloaded function 'operator new[]' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(90) : see declaration of 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(94) : error C2733: second C linkage of overloaded function 'operator delete' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(93) : see declaration of 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(97) : error C2733: second C linkage of overloaded function 'operator delete[]' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(96) : see declaration of 'operator delete[]'
            ------------------------------------------------------------------------

            and the same action for 5.2.7 yealds.

            ------------------------------------------------------------------------
            d:\mariadb\include\my_compiler.h(109) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(110) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(111) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(112) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(113) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(114) : error C2894: templates cannot be declared to have 'C' linkage
            d:\mariadb\include\my_compiler.h(131) : error C2894: templates cannot be declared to have 'C' linkage
            d:\program files\microsoft visual studio 8\vc\include\new(53) : error C2732: linkage specification contradicts earlier specification for 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(53) : see declaration of 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(54) : error C2732: linkage specification contradicts earlier specification for 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(54) : see declaration of 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(80) : error C2732: linkage specification contradicts earlier specification for 'operator delete[]'
            d:\program files\microsoft visual studio 8\vc\include\new(80) : see declaration of 'operator delete[]'
            d:\program files\microsoft visual studio 8\vc\include\new(83) : error C2732: linkage specification contradicts earlier specification for 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(82) : see declaration of 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(88) : error C2733: second C linkage of overloaded function 'operator new' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(87) : see declaration of 'operator new'
            d:\program files\microsoft visual studio 8\vc\include\new(91) : error C2733: second C linkage of overloaded function 'operator new[]' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(90) : see declaration of 'operator new[]'
            d:\program files\microsoft visual studio 8\vc\include\new(94) : error C2733: second C linkage of overloaded function 'operator delete' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(93) : see declaration of 'operator delete'
            d:\program files\microsoft visual studio 8\vc\include\new(97) : error C2733: second C linkage of overloaded function 'operator delete[]' not allowed
            d:\program files\microsoft visual studio 8\vc\include\new(96) : see declaration of 'operator delete[]'
            ------------------------------------------------------------------------

            thanks eadthem

            Show
            eadthemakip eadthem akip added a comment - Re: Default Int or undefined uint in typelib.h I tested the fix by adding #include "my_global.h" to the orignal files of both 5.2.4 and 5.2.7 and i receved the error messages. d:\mariadb\include\my_global.h(605) : fatal error C1083: Cannot open include file: 'my_valgrind.h': No such file or directory i was not able to find my_valgrind.h in any of the noinstall zips for windows. i also had to change my inclusion of winsock.h to winsock2.h in my applcation as winsock.h was causing redefinition issues once my_global.h was included. I pulled my_valgrind.h out of the source tarball for 5.2.4 , placed it in the /include/ folder and received the following error messages. ------------------------------------------------------------------------ d:\mariadb\include\my_compiler.h(104) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(105) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(106) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(107) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(108) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(109) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(126) : error C2894: templates cannot be declared to have 'C' linkage d:\program files\microsoft visual studio 8\vc\include\new(53) : error C2732: linkage specification contradicts earlier specification for 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(53) : see declaration of 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(54) : error C2732: linkage specification contradicts earlier specification for 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(54) : see declaration of 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(80) : error C2732: linkage specification contradicts earlier specification for 'operator delete[]' d:\program files\microsoft visual studio 8\vc\include\new(80) : see declaration of 'operator delete[]' d:\program files\microsoft visual studio 8\vc\include\new(83) : error C2732: linkage specification contradicts earlier specification for 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(82) : see declaration of 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(88) : error C2733: second C linkage of overloaded function 'operator new' not allowed d:\program files\microsoft visual studio 8\vc\include\new(87) : see declaration of 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(91) : error C2733: second C linkage of overloaded function 'operator new[]' not allowed d:\program files\microsoft visual studio 8\vc\include\new(90) : see declaration of 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(94) : error C2733: second C linkage of overloaded function 'operator delete' not allowed d:\program files\microsoft visual studio 8\vc\include\new(93) : see declaration of 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(97) : error C2733: second C linkage of overloaded function 'operator delete[]' not allowed d:\program files\microsoft visual studio 8\vc\include\new(96) : see declaration of 'operator delete[]' ------------------------------------------------------------------------ and the same action for 5.2.7 yealds. ------------------------------------------------------------------------ d:\mariadb\include\my_compiler.h(109) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(110) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(111) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(112) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(113) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(114) : error C2894: templates cannot be declared to have 'C' linkage d:\mariadb\include\my_compiler.h(131) : error C2894: templates cannot be declared to have 'C' linkage d:\program files\microsoft visual studio 8\vc\include\new(53) : error C2732: linkage specification contradicts earlier specification for 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(53) : see declaration of 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(54) : error C2732: linkage specification contradicts earlier specification for 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(54) : see declaration of 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(80) : error C2732: linkage specification contradicts earlier specification for 'operator delete[]' d:\program files\microsoft visual studio 8\vc\include\new(80) : see declaration of 'operator delete[]' d:\program files\microsoft visual studio 8\vc\include\new(83) : error C2732: linkage specification contradicts earlier specification for 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(82) : see declaration of 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(88) : error C2733: second C linkage of overloaded function 'operator new' not allowed d:\program files\microsoft visual studio 8\vc\include\new(87) : see declaration of 'operator new' d:\program files\microsoft visual studio 8\vc\include\new(91) : error C2733: second C linkage of overloaded function 'operator new[]' not allowed d:\program files\microsoft visual studio 8\vc\include\new(90) : see declaration of 'operator new[]' d:\program files\microsoft visual studio 8\vc\include\new(94) : error C2733: second C linkage of overloaded function 'operator delete' not allowed d:\program files\microsoft visual studio 8\vc\include\new(93) : see declaration of 'operator delete' d:\program files\microsoft visual studio 8\vc\include\new(97) : error C2733: second C linkage of overloaded function 'operator delete[]' not allowed d:\program files\microsoft visual studio 8\vc\include\new(96) : see declaration of 'operator delete[]' ------------------------------------------------------------------------ thanks eadthem
            Hide
            wlad Vladislav Vaintroub added a comment -

            Re: Default Int or undefined uint in typelib.h
            my_global.h worked at some point of time, and it is still in the official MySQL documentation, so I assumed it would still work ok.
            Sorry it did not work anymore. I'd suggest to go the #include <mysql.h> root and manually change uint to unsigned in the affected header,because this was the real fix pushed into 5.1,5.2 and 5.3

            The rest of the errors are mostly likely due to extern "C" somewhere in your code, prior to inclusion of my_global.h . It does not play well inside my_compiler.h , in #ifdef __cplusplus block.

            Show
            wlad Vladislav Vaintroub added a comment - Re: Default Int or undefined uint in typelib.h my_global.h worked at some point of time, and it is still in the official MySQL documentation, so I assumed it would still work ok. Sorry it did not work anymore. I'd suggest to go the #include <mysql.h> root and manually change uint to unsigned in the affected header,because this was the real fix pushed into 5.1,5.2 and 5.3 The rest of the errors are mostly likely due to extern "C" somewhere in your code, prior to inclusion of my_global.h . It does not play well inside my_compiler.h , in #ifdef __cplusplus block.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 808233

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 808233

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                eadthemakip eadthem akip
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: