locked
Visual C++ - 'uint64_t' : redefinition; different basic types RRS feed

  • Question

  • Hello,

    I have a Visual C++ project that compiles fine as a 64bit platform but I get a boatload of errors similar to the following. when compiling as a 32bit platform:

    <kbd>'uint64_t'</kbd> : redefinition; different basic types

    I don't know where in the project that the project is still stuck on "64bit" even though I specified in the configuration manager that I need 32bit.

    I will note that within my specific code itself I am not doing any typedefs and I am using open source libraries; in this case the GLM OpenGL math libraries.

    I also specified the correct includes, etc. for 32bit support.

    Has anyone ever seen this before?

    Thank you.


    Regards, Christopher K.

    Thursday, September 11, 2014 12:42 AM

Answers

  • "I don't know where in the project that the project is still stuck on "64bit" even though I specified in the configuration manager that I need 32bit."

    That error has nothing to do with the project being 32 or 64 bit. uint64_t is a standard C/C++ type that is available in both 32 and 64 bit projects.

    What probably happens is that the GLM library has its own definition of uint64_t instead and that conflicts with the definition provided by VC++ in stdint.h. You'll probably have to search the library headers, figure out where uint64_t is defined and change its definition.

    @Vegan Fanatic: give me one good reason not to delete your post for being off topic.

    Thursday, September 11, 2014 7:24 AM

All replies

  • you will need to use the preprocessor and some typedefs to make some modern types work on legacy systems

    99% of people who visit my gaming site have been using x64 Windows for a long time, its a better platform for games 

    32-bit is limited to 2048MB RAM and 512MB VRAM, my GPU has 2048MB so it could run XP (assuming the OS would run)


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 11, 2014 1:47 AM
  • "I don't know where in the project that the project is still stuck on "64bit" even though I specified in the configuration manager that I need 32bit."

    That error has nothing to do with the project being 32 or 64 bit. uint64_t is a standard C/C++ type that is available in both 32 and 64 bit projects.

    What probably happens is that the GLM library has its own definition of uint64_t instead and that conflicts with the definition provided by VC++ in stdint.h. You'll probably have to search the library headers, figure out where uint64_t is defined and change its definition.

    @Vegan Fanatic: give me one good reason not to delete your post for being off topic.

    Thursday, September 11, 2014 7:24 AM
  • Yo danes, I suggested using #defines, which will quickly find any problems with other #defines in the headers he is using

    the OP might want to post his stdafx.h file so somebody can see what is going on better

    clearly the OP has some problems

    and I am reporting you to my MVP lead too for terms violation


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 11, 2014 11:36 AM
  • "I suggested using #defines, which will quickly find any problems"

    That's a vague suggestion that won't help anyone.

    "with other #defines in the headers he is using"

    It happens so that uint64_t is a typedef, not a #define. It's sometimes possible to use #defines to avoid some conflicts but simply saying that it is possible doesn't help the OP in any way.

    "clearly the OP has some problems"

    You'd think that this is obvious. Why would the OP ask a question in this forum otherwise?

    "and I am reporting you to my MVP lead too for terms violation"

    Please do. Maybe he/she will get in touch with me and I'll have someone to complain about your useless ramblings in the Visual C++ forum. I will also note that your contribution to this forum is abysmal: only 19 answers out for 347 posts: http://mvp.microsoft.com/en-us/mvp/Ian%20E%20Green-4029192

    Thursday, September 11, 2014 11:49 AM
  • look mike, I work with a lot of chess programs, and I have reported you already

    world+dog all use #define to switch from Linux to Windows and 32-bit to 64-bit and these are all console projects

    #define AMD64

    // headers for 64-bit

    #define X86

    // headers

    this is the architecture I suggest

    it obviously is more tricky with typedef and other user defined types

    there may need to be some #ifdef as well to deal with some duplicate definitions

    I recommend the OP zip up his code and post it to OneDrive so we can look at the whole project and figure out what is wrong'


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 11, 2014 12:00 PM
  • On 9/11/2014 7:49 AM, "Mike Danes" wrote:

    Please do. Maybe he/she will get in touch with me

    As a matter of fact, she does want to get in touch with you (for an unrelated reason), but lacks any contact information (unfortunately, these forums don't have a way to send a private message). If interested, ping me at itandetnik@mvps.org.


    Igor Tandetnik
    Thursday, September 11, 2014 2:37 PM
  • What version of VisualC++ are you using?

    The error message should tell you where conflicting typedefs are.


    Yan

    Thursday, September 11, 2014 3:45 PM
  • (unfortunately, these forums don't have a way to send a private message).

    I think you meant: (fortunately, these forums don't have a way to send a private message).

    David Wilkinson | Visual C++ MVP

    Thursday, September 11, 2014 3:53 PM
  • I downloaded the latest glm version from here: http://sourceforge.net/projects/ogl-math/files/

    It seems to work fine with VS2013 when targeting 32 bit. By works fine I mean that I included its header in a cpp file and the project compiles without errors.

    Some library headers do contain a uint64_t typedef but that typedef is not in the global namespace so it shouldn't cause any problems. In the worst case you'll get an "ambiguous symbol" error if you have something like "using namespace glm;" in your code. That's different from "redefinition; different basic types".

    Are you using any other libraries in your project?

    Thursday, September 11, 2014 5:16 PM
  • as a suggestion to the OP, maybe using C++ namespaces will allow you to get around the problem of the 3rd party library conflicts

    namespace mycode {
    
    // insert code here
    
    }

    then using...

    using namespace mycode;

    which is about the fastest idea to get around older libraries which were developed before the ISO managed to make more of a mess

    I use namespaces with all the code I develop simply to dodge the mess I used to experience before the standards people finally adopted the idea


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Thursday, September 11, 2014 11:21 PM
  • as a benefit to the OP, here is the page for the stdint.h

    http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html

    this header is a C header which is part of the problem that the OP is experiencing


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Friday, September 12, 2014 8:17 PM