Sign in to follow this  

Endless Visual C++ 2005 problems...

This topic is 3813 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 download MSVC 2005 from microsoft but when i click on new project i cant create a dll or a Windows Application project so I searched the microsoft site and found i had to download some other 400mb thing to be able to make dlls and windows applications. I also had to go into some config file and change it to allow me to make dlls and windows appications. That was the least of my worries. If i dont select a precompiled header and i use #include <windows.h> i get an error saying nb40.h(or nb30.h cant remember) can only be used in windows application but my project is a windows application. Have i done something wrong? If i have how can i fix it? Thanks

Share this post


Link to post
Share on other sites
Yes, you need the PlatformSDK to do lots of "useful" stuff with the Express Edition. That's normal.

Otherwise it sounds like the normal process of getting any programmer tool to work properly. Programmers like lots of options so they can do 1000s of different things. It's just the nature of our domain to use complicated tools that require effort to set up properly.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by hahaha
Thanks but is there a way to not have to include "stdafx.h"?


Go to the project menu and at the bottom there will be <name of project> properties...
Under configuration properties, under c/c++ there is a bit for precompiled headers just select "Not Using Precompiled Headers" and you shouldn't need to include stdafx.h.

Share this post


Link to post
Share on other sites
Thanks i did that but it then says <windows.h> can only be used in a windows application with this error:
c:\program files\microsoft visual studio 8\vc\include\nb30.h(4) : fatal error C1189: #error : nb30.h can only be used in a Win32 Application
but i dont include nb30.h???

Share this post


Link to post
Share on other sites
Before you can choose to make an empty project, you must choose whether to make a Win32 project, a Win32 console project etc. Which did you choose?

Share this post


Link to post
Share on other sites
I select win32 and takes me to a win32 application wizard. It says the current project settings are Console Project. I chose next instead of finish. Then there is a header asking for an application type and i chose Windows Application and i checked empty project

Share this post


Link to post
Share on other sites
I ran the installer and let it do everything. The only thing i changed was commenting out the lines that didnt let me create dlls or windows applications.
Any ideas on how to fix it?

Share this post


Link to post
Share on other sites
Nuking it from orbit and reinstalling is one option, but that should be a last resort.

Open the nb30.h header file and look for the error message (it's probably a #pragma directive). The look at the #ifdef or similar preprocessor code that would cause that error message to fire. It might give you some hints as to why you are getting the message.

Share this post


Link to post
Share on other sites
nb30.h =
#ifdef __FLAT__
#include <win32\nb30.h>
#else
#error nb30.h can only be used in a Win32 Application
#endif

if i define __FLAT__, when i compile i get about 100 other "warning C4068: unknown pragma" error:(

Share this post


Link to post
Share on other sites
__FLAT__ should not be forcibly defined (by you). What kind of machine and OS are you running on? __FLAT__ is, iirc, related to enable or disabling the flat memory model for old machines.

What does the code you are compiling look like, and are there any other errors? Are you sure you following the installation instructions exactly? Which version of the Platform SDK did you install?

Share this post


Link to post
Share on other sites
this is the folder it istaleed to "Microsoft Platform SDK for Windows Server 2003 R2"

win32 and the code just has winmain and a small window procedure that returns everything. In winmain it doesnt do anything it returns immediately

Share this post


Link to post
Share on other sites
this is the folder it istaleed to "Microsoft Platform SDK for Windows Server 2003 R2"

windows xp and the code just has winmain and a small window procedure that returns everything. In winmain it doesnt do anything it returns immediately

Share this post


Link to post
Share on other sites
this is the folder it installed to "Microsoft Platform SDK for Windows Server 2003 R2"

windows xp and the code just has winmain and a small window procedure that returns everything. In winmain it doesnt do anything it returns immediately

Share this post


Link to post
Share on other sites

This topic is 3813 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this