Archived

This topic is now archived and is closed to further replies.

Initialization error when building project...help

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using Visual C++ .NET. And when I have my project loaded, I can''t use the compile function. It doesn''t let me, I can''t figure out why. And so i decide to click on build project, and it looks like it''s gonna compile, and it says initialization error. Can anyone tell me what exactly and initialization error is and how to fix it. Thanx

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Perhaps if you posted the code and error it gave you. People would respond better.

Share this post


Link to post
Share on other sites
Ah, of course, thank you AP. Dunno why I didn''t do it before. This is the first program I''ve written in VC++ so i just wanted a simple program to calculate the area of a given space. I split it up into three files, test.cpp, test.h, and area.cpp.
Ok, test.cpp holds the main() function, test.h holds the prototype for the Area() function, and area.cpp holds the definition of the Area() function. I didnt'' put the Area() function in the same file as the main() function because i wanted to try the linking and get the idea of it for larger projects.

test.h code:
//////////////function prototypes//////////////////////////

long Area(int width, int height); //prototype function to calculate area


test.cpp code:
// using the Area function

#include <iostream>
#include "test.h"



int main()
{
using namespace std;

int length
int width
int area

cout << "\nWhat is the width? ";
cin >> width;
cout << "\nWhat is the length? ";
cin >> length;

area= Area(length,width);

cout << "\nThe area is ";
cout << area;
cout << "square feet\n\n";
return 0;
}


area.cpp code:
///////function declaration//////////

int Area(int l, int w)
{
return l * w;
}


Here is the output when i attempt to build the project:

quote:
------ Build started: Project: Test, Configuration: Debug Win32 ------

There is no build command line to execute.
Performing Makefile project actions
Test : error PRJ0003 : Error spawning ''''.

Build log was saved at "file://c:\Documents and Settings\DigitalChaos\My Documents\Visual Studio Projects\Test\Debug\BuildLog.htm"
Test - 1 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped





So, i hope this is all that''s needed, can anyone help me now?

Share this post


Link to post
Share on other sites
All i did was click build Test under the build menu, where Test is the name of my project. And as for creating the project, i went File>New>Project and then i chose managed C++ application. There are quite a few options for a new project, so which one am i supposed to choose for a normal application? Not a Win32 project necessarily, but a console project. And how do i give VS instructions on how to build it?

Share this post


Link to post
Share on other sites
Right click the cpp file and choose properties. Then choose general and make sure that C/C++ Compiler Tool is selected.

Another thing to check is if your right click on the project, and choose properties, then c/c++ and command line. Paste all that reads in there, here on the forum.

If this is all ok, and other projects doesn''t work either, then you need to reinstall visual studio.

Share this post


Link to post
Share on other sites
It''s not all of the projects, only the ones that it seems i create. Because the project files i download from gametutorials.com work.

And when i right click on the project inside VS, I don''t get the option for properties. So where am i supposed to right click then...?

Share this post


Link to post
Share on other sites
The project in the solution explorer(the list with all the projects in the solution). You should only have the project test there. Under that is the list with all the files in the project. It''s usually on either left or right side of the screen, depending on your settings.

Share this post


Link to post
Share on other sites
Well, thank you fredizzimo. I right clicked my project in the solution explorer, and i was looking at all the settings, and I changed something and it worked. What i did was, in the property page, the configuration type was makefile (by default i guess), so i looked at the options for that and there were configuration types for a dll, exe, etc. so i chose exe, hit apply. And i went to build it again, and it worked! i now have the .exe and it works. I had a few syntax errors, but once those were fixed, it worked. woohoo. Thanx again.

Share this post


Link to post
Share on other sites