| | |
problems wid cpp files
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Hello.I have been using Microsoft Visual Studio 2000 enterprise edition and I'm having a problem with linking files.I have saved a file named as "class declaration.h" by default and another named as "cppfile.cpp" by default.Let me tell you how I actually started this.First I created a new project workspace and then a c++ header file.I saved the header file ( my compiler or vc++6 saves header files as .h by default not .hpp) and opened a c++ source file.I saved the source file too and then compiled and got only 1 error saying that my .h file didn't exit.I have tried all names like "class declaration" and "classdeclaration" etc but it doesn't work.I know file namea are case-sensitive but I don't know about whitespaces.Note that I have not installed visual foxpro or interdev... :eek: and what does the " erro spawning file" message mean?
•
•
Join Date: Sep 2003
Posts: 81
Reputation:
Solved Threads: 0
I used MVS .net a bit and from that experience here are my suggestions:
1. Save files as "class_declaration.h" and "cppfile.cpp" in the same directory
2. Add both files to the project
3. When including class_declaration.h type
#include "class_declaration.h"
4. In your header file (class_declaration.h) start it with
#ifndef _class_declaration
#define _class_declaration
and end with
#endif
This will lower the chances of overflow by making sure the file is included only once and has no overloads etc.
5. Make sure the anything you refer to has a prototype in the header (just in case)
6. Make sure no other application is reading your file while you are trying to compile (that would explain your "spawning error"
Hope that helps..
Ilya
1. Save files as "class_declaration.h" and "cppfile.cpp" in the same directory
2. Add both files to the project
3. When including class_declaration.h type
#include "class_declaration.h"
4. In your header file (class_declaration.h) start it with
#ifndef _class_declaration
#define _class_declaration
and end with
#endif
This will lower the chances of overflow by making sure the file is included only once and has no overloads etc.
5. Make sure the anything you refer to has a prototype in the header (just in case)
6. Make sure no other application is reading your file while you are trying to compile (that would explain your "spawning error"
Hope that helps..
Ilya
![]() |
Similar Threads
- Installing .cpp files in C#? (C#)
- Including stdafx.h in other .cpp files (C++)
- Problems Linking C++ Files (C++)
- Problems running WMLScript files (Computer Science)
- Problems with linking OBJ files (C)
- can't link to included files... y? (C++)
Other Threads in the C++ Forum
- Previous Thread: inheritance
- Next Thread: Noob help!
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy desktop developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference rpg sorting string strings struct temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





