smartstream-stp
asked on
Problems running nsqlprep with Visual Studio 2005.
I have code which contains ESQL/C which is pre-processed by the Embedded SQL precompiler nsqlprep. This works fine when used with Visual Studio 6 but does not work when used with Visual Studio 2005.
As a simple test case I have a file called helloworld.sqc which contains the following text:
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
and I type
nsqlprep helloworld
from within a Visual Studio 2005 Command Prompt (Start -> All Programs -> Microsoft Visual Studio 2005 -> Visual Studio Tools), and I get
Microsoft (R) Embedded SQL for C Pre-Compiler. Version 6.50.04.
Copyright (c) Microsoft Corp 1993-1996. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.sqc
Warning: helloworld.sqc, line 3235: syntax error.
{
Warning: helloworld.sqc, line 3238: syntax error.
(
Warning: helloworld.sqc, line 3262: syntax error.
(
Warning: helloworld.sqc, line 5: syntax error.
{
However, it runs and creates helloworld.c.
If I then type
cl helloworld.c
upon the helloworld.c which is produced by nsqlprep, I get
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.c
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(171 7) : error C2
011: 'localeinfo_struct' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(171 7) :
see declaration of 'localeinfo_struct'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(172 3) : error C2
011: 'tagLC_ID' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(172 3) :
see declaration of 'tagLC_ID'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(173 2) : error C2
011: 'threadlocaleinfostruct' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(173 2) :
see declaration of 'threadlocaleinfostruct'
If we repeat this exercise where we have
INCLUDE=D:\Program Files\Microsoft Visual Studio\VC98\Include;
LIB=D:\Program Files\Microsoft Visual Studio\VC98\Lib
i.e. the Visual Studio 6 include files and libraries, then everything works OK.
As a simple test case I have a file called helloworld.sqc which contains the following text:
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
and I type
nsqlprep helloworld
from within a Visual Studio 2005 Command Prompt (Start -> All Programs -> Microsoft Visual Studio 2005 -> Visual Studio Tools), and I get
Microsoft (R) Embedded SQL for C Pre-Compiler. Version 6.50.04.
Copyright (c) Microsoft Corp 1993-1996. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.sqc
Warning: helloworld.sqc, line 3235: syntax error.
{
Warning: helloworld.sqc, line 3238: syntax error.
(
Warning: helloworld.sqc, line 3262: syntax error.
(
Warning: helloworld.sqc, line 5: syntax error.
{
However, it runs and creates helloworld.c.
If I then type
cl helloworld.c
upon the helloworld.c which is produced by nsqlprep, I get
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.c
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(171
011: 'localeinfo_struct' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(171
see declaration of 'localeinfo_struct'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(172
011: 'tagLC_ID' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(172
see declaration of 'tagLC_ID'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(173
011: 'threadlocaleinfostruct' : 'struct' type redefinition
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(173
see declaration of 'threadlocaleinfostruct'
If we repeat this exercise where we have
INCLUDE=D:\Program Files\Microsoft Visual Studio\VC98\Include;
LIB=D:\Program Files\Microsoft Visual Studio\VC98\Lib
i.e. the Visual Studio 6 include files and libraries, then everything works OK.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.