Solved

Problems running nsqlprep with Visual Studio 2005.

Posted on 2008-06-25
3
601 Views
Last Modified: 2013-11-26
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(1717) : error C2
011: 'localeinfo_struct' : 'struct' type redefinition
        D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(1717) :
see declaration of 'localeinfo_struct'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(1723) : error C2
011: 'tagLC_ID' : 'struct' type redefinition
        D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(1723) :
see declaration of 'tagLC_ID'
D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(1732) : error C2
011: 'threadlocaleinfostruct' : 'struct' type redefinition
        D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdefs.h(1732) :
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.


0
Comment
Question by:smartstream-stp
3 Comments
 
LVL 31

Accepted Solution

by:
James Murrell earned 250 total points
ID: 21886940
push/pop pragmas are like open/close braces
for each push pragma there has to be one pop pragma

from http://www.velocityreviews.com/forums/t515341-warnings-building-multi-threaded-dll.html
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL query for highest sequence 4 62
SQL Add Parameter in Variable 4 21
SQL works but want to get the XML node data separately 11 27
Nested forach loop to linq 3 27
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question