MinGW dosent like __int64

C, C++, and Visual C++
Jacob
Phidgetly
Posts: 38
Joined: Tue Sep 29, 2009 8:56 pm
Contact:

MinGW dosent like __int64

Postby Jacob » Fri Jul 15, 2011 12:17 pm

MinGW says

Code: Select all

phidget21.h:1390:107: error: '__int64' has not been declared
phidget21.h:1398:108: error: '__int64' has not been declared
phidget21.h:2979:94: error: '__int64' has not been declared
phidget21.h:2987:94: error: '__int64' has not been declared
phidget21.h:2995:95: error: '__int64' has not been declared
phidget21.h:3003:95: error: '__int64' has not been declared
phidget21.h:3011:91: error: '__int64' has not been declared
phidget21.h:3019:91: error: '__int64' has not been declared
phidget21.h:3027:172: error: '__int64' has not been declared


When __int64 is replaced with long I get

Code: Select all

C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0x32): undefined r
eference to `_imp__CPhidgetInterfaceKit_create@4'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0x4a): undefined r
eference to `_imp__CPhidget_open@8'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0x6a): undefined r
eference to `_imp__CPhidgetInterfaceKit_set_OnInputChange_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0x8a): undefined r
eference to `_imp__CPhidget_set_OnAttach_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0xaa): undefined r
eference to `_imp__CPhidget_set_OnDetach_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0xba): undefined r
eference to `_imp__CPhidget_close@4'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccNgKNFV.o:testone.cpp:(.text+0xca): undefined r
eference to  `_imp__CPhidget_delete@4'
collect2: ld returned 1 exit status


My code:

Code: Select all

#include "phidget21.h"
#include <iostream>
using namespace std;

int __stdcall InputChangeHandler(CPhidgetInterfaceKitHandle phid, void *userPtr, int index, int inputState){

}

int __stdcall AttachHandler(CPhidgetHandle phid, void *userPtr){

}

int __stdcall DetachHandler(CPhidgetHandle phid, void *userPtr){

}

int main(){
   CPhidgetInterfaceKitHandle ifkit;
   
   CPhidgetInterfaceKit_create(&ifkit);
   
   CPhidget_open((CPhidgetHandle)ifkit, -1);
   
   CPhidgetInterfaceKit_set_OnInputChange_Handler(ifkit, InputChangeHandler, NULL);
   CPhidget_set_OnAttach_Handler((CPhidgetHandle)ifkit, AttachHandler, NULL);
   CPhidget_set_OnDetach_Handler((CPhidgetHandle)ifkit, DetachHandler, NULL);
   
   
   
   CPhidget_close((CPhidgetHandle)&ifkit);
   CPhidget_delete((CPhidgetHandle)&ifkit);
   
   return 0;
}


Any ideas?

Thanks,
Jacob

User avatar
Patrick
Lead Developer
Posts: 3100
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: MinGW dosent like __int64

Postby Patrick » Fri Jul 15, 2011 12:51 pm

Try replacing with 'long long', not 'long'

You could just typedef it:

Code: Select all

typedef long long __int64;
typedef unsigned long long __uint64;

-Patrick

Jacob
Phidgetly
Posts: 38
Joined: Tue Sep 29, 2009 8:56 pm
Contact:

Re: MinGW dosent like __int64

Postby Jacob » Fri Jul 15, 2011 1:07 pm

With long long I still get

Code: Select all

C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0x32): undefined r
eference to `_imp__CPhidgetInterfaceKit_create@4'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0x4a): undefined r
eference to `_imp__CPhidget_open@8'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0x6a): undefined r
eference to `_imp__CPhidgetInterfaceKit_set_OnInputChange_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0x8a): undefined r
eference to `_imp__CPhidget_set_OnAttach_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0xaa): undefined r
eference to `_imp__CPhidget_set_OnDetach_Handler@12'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0xba): undefined r
eference to `_imp__CPhidget_close@4'
C:\DOCUME~1\Jacob\LOCALS~1\Temp\ccbD2iLk.o:testone.cpp:(.text+0xca): undefined r
eference to `_imp__CPhidget_delete@4'
collect2: ld returned 1 exit status

User avatar
Patrick
Lead Developer
Posts: 3100
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: MinGW dosent like __int64

Postby Patrick » Fri Jul 15, 2011 2:08 pm

Looks like you aren't linking in phidget21.lib.

-Patrick

Jacob
Phidgetly
Posts: 38
Joined: Tue Sep 29, 2009 8:56 pm
Contact:

Re: MinGW dosent like __int64

Postby Jacob » Fri Jul 15, 2011 2:12 pm

I am compiling with

c++ testone.cpp -o testone.exe phidget21.lib

mphi
Phidgetly
Posts: 39
Joined: Tue Nov 16, 2010 4:27 pm
Contact:

Re: MinGW dosent like __int64

Postby mphi » Mon Jul 18, 2011 9:29 am

Is your system 32 or 64 bit? Are you using the x86 or x64 phidget21.lib?


Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 1 guest