Thread: compile problem

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    Smile compile problem

    hi everyone!

    I am having one problem,
    When i am trying to compile my code it is giving errors in external dependencies.

    code:

    Code:
    
    #pragma warning (disable:4018)
    #include <iostream>
    #include<uf.h>
    #include"defFile.h"
    #include"common.h"
    #include"runner_blade.h"
    #include"defGeometry.h"
    #include<uf_part.h>
    #include<uf_view.h>
    #include"inputFile.h"
    #include"clone.h"
    #include"dwgs.h"
    
    using namespace std;
    
    static void runnerBladeMain(char*InputFile)
    {
    	int i=1;	
    
    	defGeometry defGeom;
    
    	tag_t part;
    
    	inputFile inp;
    
    	drawingInfo dwg;
    
    	//////////////////////////////////////////////////
    	//Step 1										//				
    	//Read the input file and store the data		//
    	//////////////////////////////////////////////////
    
    	sysLogPrint("%d] Reading the Input file\n\n",i++);
    
    	if(inp.readInput(InputFile))
    	{
    		//////////////////////////////////////////////////
    		//Step 2										//				
    		//Load the files								//
    		//Set the load options to load the files from   //
    		//current directory								//
    		//////////////////////////////////////////////////
    
    		sysLogPrint("%d] Setting the search directory for cloning\n\n",i++);
    		setLoadFromSearchDir(inp.InPutDir);			
    
    		sysLogPrint("%d] Cloning the part files\n\n",i++);	
    		
    		//////////////////////////////////////////////////////////
    		//Step 3												//
    		//Copy the part files from Input Dir to Output Dir		//
    		//////////////////////////////////////////////////////////
    		
    		clone clone(inp.InPutDir,inp.OutPutDir,inp.MasterFile);
    
    		sysLogPrint("\n%d] Setting load options to from dir\n",i++);
    		setLoadFromSearchDir(inp.OutPutDir);
    
    		UF_CALL(UF_MODL_set_update_fail_option(UF_MODL_UPDATE_ACCEPT_ALL));				
    		
    		////////////////////////////////////////////////////////////////
    		//Step 4												      //
    		//Searching Dummy_Blade part file in an given master assembly //
    		////////////////////////////////////////////////////////////////
    
    		setLoadFromSearchDir(inp.OutPutDir);	
    		
    		part=defGeom.FindPart(inp.MasterFile,inp.OutPutDir);
    
    		////////////////////////////////////////////////////////////////
    		//Step 5												      //
    		//If Dummy_Blade part file is found ,only then call		      //
    		//"populateGeometry" &"ReplaceSpline" function				  //
    		////////////////////////////////////////////////////////////////
    		if(part)
    		{
    			sysLogPrint("\n%d] Reading the Defination file\n",i++);
    
    			//////////////////////////////////////////////////
    			//Step 6										//
    			//Read the Defination file and store the data	//
    			//////////////////////////////////////////////////
    
    			defGeom.readFile(inp.DefinitionFile.c_str(),inp.ScaleFactor["SF"],inp.InPutDir);			
    
    			defGeom.populateGeometry(inp.SplitPointNumber["N1"],inp.SplitPointNumber["N2"],inp.option["OpenEnd"]);		
    
    			//////////////////////////////////////////////////////////
    			//												        //
    			//Replace Splines										//
    			//Now we are replacing the existing splines with splines//
    			//created with points from input file.                  //
    			//The corrusponding sheet body created with through     //
    			//curves, will also get updated                         //
    			//////////////////////////////////////////////////////////
    			
    			sysLogPrint("\n%d] Replacing existing sections",i++);
    			
    			defGeom.ReplaceSpline(defGeom.sections,inp.BladePartFile.c_str(),part);
    		}
    		//////////////////////////////////////////////////////////////
    		//Step 7													//													
    		//Importing expressions in to main assembly file & saving it//								
    		//////////////////////////////////////////////////////////////
    				
    		sysLogPrint("\n%d] Importing expressions & Updating the Model",i++);
    		
    		ImportExpressions(inp.ExpFile,inp.BladePartFile.c_str(),inp.OutPutDir,inp.InPutDir);
    
    		////////////////////////////////////////////////////////////////
    		////Step 8													  //													
    		////Upadating the mass properties of specified parts          //								
    		////////////////////////////////////////////////////////////////
    
    		if(inp.ComponentPart.size())
    		{
    			sysLogPrint("\n%d] Updating Mass prperties of models\n",i++);
    
    		for(int k=0;k<inp.ComponentPart.size();k++)	
    		{
    			UpdateMassProperties(inp.MassProp,inp.ComponentPart[k].c_str(),inp.OutPutDir);
    		}
    		sysLogPrint("\n%d] Updating the Drawing Sheets\n",i++);
    		}
    
    		////////////////////////////////////////////////////////////////
    		//Step 9													  //													
    		//Upadating the Drawing attributes & updating the out of date //
    		//sheets													  //								
    		////////////////////////////////////////////////////////////////
    
    		if(inp.DraftingFile.size())
    		{
    			dwg.UpdateOutOfDateDrawings(inp.BladePartFile.c_str(),inp.OutPutDir);
    			for(int M=0;M<inp.DraftingFile.size();M++)
    			{
    				dwg.UpdateDrawingAttributes(inp.DraftInfo,inp.DraftingFile[M].c_str(),inp.OutPutDir);
    			}
    		}
    		////////////////////////////////////////////////////////////////
    		////Step 10													  //													
    		////Saving all the assembly									  //								
    		////////////////////////////////////////////////////////////////
    		
    		sysLogPrint("\n%d] Saving & Closing All Loaded Parts\n\n",i++);
    
    	SaveAssembly();
    	closeAllParts();
    }
    else
    {
    	cout << "**************************************************************************\n";
    	cout << "Incorret arguments passed\n";
    	cout << "**************************************************************************\n";
    }
    sysLogLine();
    }
    void main(int argc,char *argv[])
    {
    	cout << "Version: " << __DATE__ << "-|-" << __TIME__ << endl;
    
    	//sysLogPrint("Force brute Log method! Not recommended.\n");
    
    if (argc==2)
    {
    	if (!UF_CALL(UF_initialize()))
    	{
    		char *syslogname;
    
    		if(!UF_CALL(UF_ask_syslog_filename(&syslogname)))
    			{
    				UF_free(syslogname);
    			}
    			/////////////////////////////////////////////////
    			//INTRODUCTION MODULE						   //
    			/////////////////////////////////////////////////
    
    			sysLogLine();		
    			sysLogPrint("\t\t\tHITACHI AUTOMATION TOOL\n");
    			sysLogPrint("\t\t\t  DEVELOPED BY QuEST\n");
    			sysLogPrint("\t\t  Last updated: 31 JAN 2008 00:45 P:M:\n\n");
    			sysLogLine();
    
    			runnerBladeMain(argv[1]);
    
    			UF_terminate();
    	}
    	else
    	{
    		sysLogPrint("There is no UFUNC Execute licence avaibale at this time to execute!");	
    	}
    }
    }



    errors:


    Deleting intermediate files and output files for project 'Hitachi_VS6 - Win32 Debug'.
    --------------------Configuration: Hitachi_VS6 - Win32 Debug--------------------
    Compiling...
    clone.cpp
    common.cpp
    defFile.cpp
    defGeometry.cpp
    dwgs.cpp
    inputFile.cpp
    runner_blade.cpp
    d:\apps\ugs\nx 4.0\ugopen\uf_retiring.h(3982) : error C2955: 'vector' : use of class template requires template argument list
    c:\program files\microsoft visual studio\vc98\include\vector(244) : see declaration of 'vector'
    d:\apps\ugs\nx 4.0\ugopen\uf_modl.h(4497) : error C2955: 'vector' : use of class template requires template argument list
    c:\program files\microsoft visual studio\vc98\include\vector(244) : see declaration of 'vector'
    Generating Code...
    Error executing cl.exe
    .

    Hitachi_VS6.exe - 2 error(s), 0 warning(s)

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Perhaps there is a name conflict?

    Do you have a using namespace std in any of your header files? That's generally considered bad practice because situations like this can occur.

    You can tell by checking the lines of code in uf_retiring.h and uf_modl.h to see if the vectors they are using are the standard vector class or something else with the name vector.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    they are not standard vector class, they are pointing to something else!!!
    But i think the point you said about namespace is right . i have used namespaces!!
    I will remove them & see. thanks!!!

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    A general rule is never use a using directive or using declaration where it could be included before code from other libraries.

    That means never use it in any header file. That also means never put it before any #includes.

    My personal choice is to always explicitly put std:: in front of names from the std namespace for consistency. That way I never have to figure out if the using directive is ok, and since it is only a few extra characters it is not that hard. Plus, when you do it consistently, it makes it easy to see quickly that the name you are using is a standard name, which is somewhat helpful for readability IMO.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile problem on linux
    By cnb in forum C Programming
    Replies: 3
    Last Post: 09-29-2008, 04:14 AM
  2. Replies: 9
    Last Post: 09-14-2008, 02:35 PM
  3. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  4. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  5. size of Object c++ compile problem
    By micha_mondeli in forum C++ Programming
    Replies: 5
    Last Post: 04-06-2005, 01:20 PM