Author |
Message
|
BBM |
Posted: Fri Jun 29, 2007 7:33 am Post subject: Problems compiling C code |
|
|
Master
Joined: 10 Nov 2005 Posts: 217 Location: London, UK
|
Does anyone know why when I try and compile some C code on the bloodshed compiler under windows using the MQ 6.0 headers I get the following message:
2287 C:\Dev-Cpp\include\cmqc.h syntax error before "MQINT64"
2287 C:\Dev-Cpp\include\cmqc.h [Warning] data definition has no type or storage class
I'm a bit of dev novice so if this obvious apologies in advance...
Thanks
BBM |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jun 29, 2007 7:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Unsupported compiler?
Mixing 32 & 64 bit compilation options?
Mixing 32 & 64 bit header files?
One or more of the above in combination?
Please post platform & option details _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
BBM |
Posted: Fri Jun 29, 2007 7:46 am Post subject: |
|
|
Master
Joined: 10 Nov 2005 Posts: 217 Location: London, UK
|
Hi,
I think unsupported compiler might be the case - I could compile simple code in 5.3 OK maybe things have changed for 6.0.
Platform is Windows XP - no options specified. Compiler is Bloodshed shareware compiler.
Looks like the compiler is objecting to the following line (amongst others)from cmqc.h :
typedef _int64 MQINT64
I'll try with Visual C++ |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 29, 2007 10:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
BBM wrote: |
Looks like the compiler is objecting to the following line (amongst others)from cmqc.h :
typedef _int64 MQINT64
|
Looks like this is a case of mixing 64 bit and 32 bit libraries...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
markt |
Posted: Fri Jun 29, 2007 10:42 am Post subject: |
|
|
 Knight
Joined: 14 May 2002 Posts: 508
|
Quote: |
Looks like this is a case of mixing 64 bit and 32 bit libraries... |
Nothing to do with libraries. Looks like a compiler that does not have an inbuilt 64-bit datatype. Which is needed for some applications EVEN IF it's a 32-bit program (eg some of the PCF attributes are 64-bit integers). |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Jul 03, 2007 10:07 am Post subject: Re: Problems compiling C code |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
BBM wrote: |
2287 C:\Dev-Cpp\include\cmqc.h syntax error before "MQINT64"
2287 C:\Dev-Cpp\include\cmqc.h [Warning] data definition has no type or storage class |
Hi,
I'm pretty sure I've posted this here before. Add the following to the top of your code before your MQ includes.
Code: |
#ifndef _int64
#define _int64 long long
#endif |
Lets see:
- WinXP is a 32-bit OS
- WMQ for Windows is 32-bit
- Compiler on 32-bit OS is generating defines for 32-bit applications
I'm just surprised that IBM made an assumption that '_int64' would be present on a 32-bit OS for a 32-bit compiler. It would have been so easy to put the code above at the top of cmqc.h header file.
Note: Users should not put the code above in the cmqc.h header file as the next time you apply a CSD or RefreshPack, the changes will be lost.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
tleichen |
Posted: Fri Jul 06, 2007 7:19 am Post subject: Re: Problems compiling C code |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
RogerLacroix wrote: |
...
I'm pretty sure I've posted this here before. Add the following to the top of your code before your MQ includes.
Code: |
#ifndef _int64
#define _int64 long long
#endif |
Lets see:
- WinXP is a 32-bit OS
- WMQ for Windows is 32-bit
- Compiler on 32-bit OS is generating defines for 32-bit applications
I'm just surprised that IBM made an assumption that '_int64' would be present on a 32-bit OS for a 32-bit compiler. It would have been so easy to put the code above at the top of cmqc.h header file... |
IBM doesn't want to make things too seemless on non-IBM systems. After all, they do sell hardware too, you know!  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
|