• Advertisement
Sign in to follow this  

Problems building my first project after installing vc++ 2005 express

This topic is 3931 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

Hi everyone I'm having problems building my first project after installing vc++ 2005 express. Below is a step-by-step guide to exactly what I've done, seperated into sections. I've seen similar problems in old posts but still don't really understand it. I am a complete beginner so please try to keep instructions as detailed as possible and don't assume I know anything. ________________________________________________________________________________ Go to VC++ 2005 express download page- http://msdn.microsoft.com/vstudio/express/downloads/default.aspx Step 1- Make sure you're ready Met system requirements and didn't have any previous versions of the software Step 2- Download and Install Selected English language, downloaded setup program, ran it, went through procedure installing Graphical IDE as an optional feature but not any other products, downloaded and installed Step 3- Download Additional Components Downloaded setup program for Service Pack 1, ran it, downloaded and installed ________________________________________________________________________________ Go to Microsoft Platform SDK download page- http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ Step 1 Done (see above) Step 2 Link takes me here Validated system- http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en- Downloaded PSDK-x86.exe- http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&displaylang=en&Hash=EQ9UxSU%2bhNrmgXwSfaseFKzS9fsvhrc%2fviWyHJDEAPxBKnfXwN%2fcdZEUD0fv%2f0Sfx06jdKdw0iA2aSGaBVzgyQ%3d%3d Ran it, went through procedure doing typical install and installed Step 3 Open vc++ 2005 express Go tools> options, expand projects and solutions, select vc++ directories Choose show directoris for executable files, click folder button, copy and paste c:\Program Files\...\Bin (if it's not already there) Choose show directories for include files, click folder button, copy and paste c:\Program Files\...\Include (if it's not already there) Choose showe directoried for library files, click folder button, copy and paste c:\Program Files\...\Lib (if it's not already there) Click OK Step 4 Locate file, open it with notepad and insert text as required, that bit now reads: AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" Saved and closed file Step 5 Locate file, open it with notepad and insert text as required, that bit now reads: SUPPORT_ATL.disabled = true; support_atl_title.disabled = true; SUPPORT_MFC.disabled = true; support_mfc_title.disabled = true; // WIN_APP.disabled = true; // WIN_APP_LABEL.disabled = true; // DLL_APP.disabled = true; // DLL_APP_LABEL.disabled = true; Saved and closed file ________________________________________________________________________________ In vc++ 2005 express, go file> new> project, expand win 32, click win console application, enter name 'test' and click OK Click application settings, select windows application, leave empty project unchecked (not sure if this matters) and click finish See the of this message to see how the screen looks at this point Press F5, it comes up 'This project is out of date: test- debug win32. Would you like to build it? Output box at the same time looks like this: ------ Build started: Project: test, Configuration: Debug Win32 ------ Compiling... stdafx.cpp c:\documents and settings\chris moore\my documents\visual studio 2005\projects\test\test\stdafx.h(28) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory Build log was saved at "file://c:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\test\test\Debug\BuildLog.htm" test - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Click yes, it comes up 'There were build errors. Would you like to continue and run the last successful build? Click yes, it comes up 'Unable to start program c:\documents and settings\chris moore\my documents\visual studio 2005\projects\test\debug\test.exe. The system could not find the file specified. Click OK What have I done wrong? What do I need to do please? Any help would be much appreciated. Kind regards, Chris Moore ________________________________________________________________________________ See below for how the screen looked after creation of new project // test.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "test.h" #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name // Forward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_TEST, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TEST)); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; } // // FUNCTION: MyRegisterClass() // // PURPOSE: Registers the window class. // // COMMENTS: // // This function and its usage are only necessary if you want this code // to be compatible with Win32 systems prior to the 'RegisterClassEx' // function that was added to Windows 95. It is important to call this function // so that the application will get 'well formed' small icons associated // with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TEST)); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = MAKEINTRESOURCE(IDC_TEST); wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); return RegisterClassEx(&wcex); } // // FUNCTION: InitInstance(HINSTANCE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } // // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // Message handler for about box. INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: return (INT_PTR)TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; } break; } return (INT_PTR)FALSE; }

Share this post


Link to post
Share on other sites
Advertisement
You need to download and install the Windows Platform SDK
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB

Next time...please use the [ source] [/ source] tags. Thanks.

Share this post


Link to post
Share on other sites
The fact that the IDE can't find "windows.h" suggests that you did something in Step 3 (involving the paths to the include files) incorrectly. Reverify that step.

Quote:

You need to download and install the Windows Platform SDK
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB

Next time...please use the [ source] [/ source] tags. Thanks.

It appears that he has already downloaded and (attempted) to install the PSDK, as the instruction he says he's followed are those for acquiring and installing the SDK.

Share this post


Link to post
Share on other sites
Hi, thank you for your replies.

I checked the paths and found \'s missing after Program Files in include and library directories. I tried to create a new project, test 2. I still got the error messages 'There were build errors. Would you like to continue and run the last successful build?

But, when I click yes it seems to build OK. The output from the build is:

Compiling resources...
Compiling manifest to resources...
Linking...
Embedding manifest...
Build log was saved at "file://c:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\Test 2\Test 2\Debug\BuildLog.htm"
Test 2 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The outout from the debug is:

'Test 2.exe': Loaded 'C:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\Test 2\debug\Test 2.exe', Symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\Program Files\Common Files\Symantec Shared\AntiSpam\asOEHook.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\msvcr71.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\Program Files\Common Files\Symantec Shared\CCL40.DLL', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\msvcp71.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'Test 2.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'Test 2.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
'Test 2.exe': Loaded 'C:\WINDOWS\system32\msctfime.ime', No symbols loaded.
The program '[144] Test 2.exe: Native' has exited with code 0 (0x0).

Is everything OK now? Why would I still be getting the first error message?
Stormtrooper, I'm not sure what you mean by please use the [ source] [/ source] tags. How would my first message have looked if I'd used them

Thanks again guys, not sure how tose paths went wrong.

Regards,
Chris Moore.

Share this post


Link to post
Share on other sites
The source tags are forum tags that surround your code in a white scrollable
box:


Long segments of code in here.

Notice how your code is both color coded and properly...

....formatted.

These boxes also have scrollbars for long posts.





Alternatively, you can also use "code" tags for short code:

Notice how your code is...

...formatted.


When you get the message "'There were build errors. Would you like to continue and run the last successful build?", DONT click yes. Clicking yes does not
recompile your project (It uses an already built version of your project).

Looking at your output, your project is not being compilied, only its resources
are.

Instead, when you get the message, click NO. There are compilier errors,
and you should fix them. If you need help, post the output using the SOURCE
tag above. (You can edit my post to see it in action.)

Share this post


Link to post
Share on other sites
Hi, thank you for your reply.

When I created a new project, test 5, I think I got a slightly different result than last time. I still get 'This project is out of date: Test 5- Debug Win32. Would you like to build it?' I click yes.

In the output from build, I get



------ Build started: Project: Test 5, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
Test 5.cpp
Compiling resources...
Compiling manifest to resources...
Linking...
Embedding manifest...
Build log was saved at "file://c:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\Test 5\Test 5\Debug\BuildLog.htm"
Test 5 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========




Hopefully that worked!

In the output from debug, I get



'Test 5.exe': Loaded 'C:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\Test 5\debug\Test 5.exe', Symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\Program Files\Common Files\Symantec Shared\AntiSpam\asOEHook.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\msvcr71.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\Program Files\Common Files\Symantec Shared\CCL40.DLL', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\msvcp71.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'Test 5.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'Test 5.exe': Unloaded 'C:\WINDOWS\system32\version.dll'
'Test 5.exe': Loaded 'C:\WINDOWS\system32\msctfime.ime', No symbols loaded.




Hopefully that worked!

When I go to close it, it appears to be still debugging.

Should I also say what's in the main box?

If I create a new project and when it comes up 'This project is out of date: Test 5- Debug Win32. Would you like to build it?' I choose no, I again get the error message 'Unable to start program c:\documents and settings\chris moore\my documents\visual studio 2005\projects\test\debug\test6.exe.'

Thanks again guys, hopefully I can get this sorted soon.

Regards,
Chris.

Share this post


Link to post
Share on other sites
Well, from your last post it appears that your program compiled correctly. I'm not sure how you know it 'still appears to be debuggin' after you close the program. This is a windows program, and if you don't do things correctly the program Can continue to run even when you 'close it' . So, to stop debugging enter the debug menu and select the 'stop debugging' option, or 'halt' or something that will stop the program. Actually, to be really sure the program is still running check out the list of processes running (CTRL+ALT+DELETE) and look for your program in the list. If not found, your program is definately running. Kill all of the process instances that are open, if any. If no process is open, then the program closed.

If the program was still running then your code is wrong. No one will look at your code without you putting it into a source box. Which is easy, just click 'edit' on your original post and surround the code with the source tags.

Share this post


Link to post
Share on other sites
Hi, thank you for your reply.

What I meant by the still debugging thing is that when I went to close it and start a new project to see what happened if I clicked no, it asked me if I wanted to stop debugging.

By my program running in the processes list, do you mean 'test5.exe'? If so, this isn't there so that means it's running.

I get all the sme readings in the output boxes as my last post, except under the last line of the build output I get (after stopping debugging):



The program '[2128] Test 8.exe: Native' has exited with code 0 (0x0).





Is everything OK with it?

Regards,
Chris.

[Edited by - chockydavid1983 on July 18, 2007 10:10:48 AM]

Share this post


Link to post
Share on other sites
I've also tried another thing which won't work and may help in diagnosing my problem: Creating a new, empty project

File->New->Project.
Click Win32, click on Win32 Console Application. Enter name and click OK
Click on Application Settings, select Console application and empty project

Project->Add new item
Click Code, click on C++ File (.cpp ), enter name 'main'
Add the following code to the blank .CPP file:



//*************************************************************
// print string by Frank Luna
//*************************************************************
#include <iostream>
#include <string>
int main()
{
std::string firstName = “" ;
std::cout << “Enter your first name and press Enter : “;
std::cin >> firstName;
std::cout << endl;
std::cout << “ Hello, “ << firstName << std::endl << std::endl;
}




Build->Compile

I get the following in the output from build box:



------ Build started: Project: GI project, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(8) : error C2065: '“"' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: '“Enter' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'your'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: 'your' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'first'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: 'first' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'name'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: 'name' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'and'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: 'and' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'press'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: 'press' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2146: syntax error : missing ';' before identifier 'Enter'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(9) : error C2065: '“' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(11) : error C2065: 'endl' : undeclared identifier
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(12) : error C2146: syntax error : missing ';' before identifier 'Hello'
c:\documents and settings\chris moore\my documents\visual studio 2005\projects\gi project\gi project\main.cpp(12) : error C2065: 'Hello' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Chris Moore\My Documents\Visual Studio 2005\Projects\GI project\GI project\Debug\BuildLog.htm"
GI project - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




Thanks for all your help so far, does anyone know what else could be wrong please?

Regards,
Chris.

Share this post


Link to post
Share on other sites
All those double quotes need replacing, they are being ignored by the compiler. Standard " should solve the problem the slanted “ is causing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement