Dark Bit Factory & Gravity
PROGRAMMING => Coding tutorials => Topic started by: Stonemonkey on January 17, 2007
-
a d/l of devc++ that's been sitting on my HD fro a while, v 4.9.9.2
I have got VC installed but my reg key's been messed up.
-
ive got visual studio 2005 express but i dont yous it is it really posible to get extra speed from visual studio that isnt there in dev c++ 5by getting it to generate code for sse sse2? cause if so i think ill be ditching dev c!
-
Nino,
Well I dont know about dev C++ supporting an sse switch but certainly gcc supports sse acceleration. I usually use my own makefiles which I find far easier than devC++ projects. I would check your gcc manual for SSE glags, maybe like -msse -mfpmath=sse???
Mind you there are other reasons for switching to studio, like directx works a lot easier with cl than with gcc.
-
In full VS2005, the option is Project->Properties->C/C++->Code Generation->Enable Enhanced Instruction Set. I need to get the install of Express to see if it's there - it's supposed to be.
Jim
-
In full VS2005, the option is Project->Properties->C/C++->Code Generation->Enable Enhanced Instruction Set. I need to get the install of Express to see if it's there - it's supposed to be.
Jim
Project->Properties->Configuration Properties->c/C++->Code Generation->Enable Enhanced Instruction Set
So almost the same on Express.
-
Finally, thanks to Jim I've got VC++ set up and this working in it although with the different rounding from using the asm in devc the interpolations a little off and it's a bit slow again probably due to the float-int conversions. It's late now and I've gotta go but I'll sort this stuff out tomorrow.
Thanks again Jim.
-
Here are some basic instructions to get started using Microsoft's cut down Visual Studio.NET 2005. It's a truly excellent free compiler and IDE.
First of all, you need to be able to do big downloads. For doing Windows development you need both Visual Studio Express and the Platform SDK which in total are around 900Mb.
Microsoft's own instructions for installation are actually very good, so you might just want to follow those. The home page for Express is here (http://msdn.microsoft.com/vstudio/express/)
*** Update 20/11/08 *** The instructions for patching VS2005 to make Win32 Applications have moved to here (http://msdn.microsoft.com/en-us/library/ms235626(VS.80).aspx)
First of all, you need to download Visual C++ 2005 Express Edition. Its homepage is here (http://msdn.microsoft.com/vstudio/express/visualc/download/)
As with many Microsoft downloads, the initial part of the install only downloads a small installer which grabs the rest of the software off the net while it's installing. I don't like this, personally, so I went to the manual install page and downloaded the .ISO file which is 474,686Kb. The big advantage here is you get everything in one hit.
Once you have that installed, you are able to develop command line programs and not much else. To develop Windows applications and DLLs you need the Platform SDK. This is all the headers and libs to develop Windows programs (except DirectX which is a separate download).
So to install the Platform SDK and patch VSE2005 to use it, go here (http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/).
Again, the default download is tiny, and you can download the entire SDK via a link at the end of
this page (http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en). It's 409Mb.
Once you have the Platform SDK installed you need to follow instructions 3,4 and 5 on the usingpsdk page.
In section 3, the Options page it is talking about is
Tools->Options->Projects and Solutions->VC++ Directories
Click the New Folder icon top right to create a new line, and either paste in the lines from the website or browse to the files if you didn't install them in the default location.
Follow options 4 and 5 closely. Once you've done that, close and reopen Visual Studio Express for the changes to take effect.
Finally, back here (http://msdn.microsoft.com/vstudio/express/visualc/download/) again, you should install the Visual Studio Express Editions 2005 Service Pack 1.
To create a new Windows project, go to File->New->Project.
Choose
Visual C++->Win32->Win32 Console Application
And type in the name of the Solution and Project. Click OK.
A Solution can contain more than one project, to keep all your related work together.
Choose
Application Settings at the left hand side of the dialog.
Choose
Windows Application radio button.
Select
Empty Project and click Finish.
This will create an empty Windows project.
If you already have source code, in the solution explorer you can right click the project name and select
Add->Existing Item
if not you can choose
Add->New Item
I suggest you make a copy of any code you port into Visual Studio, since you might have to change it a little if you're moving from another compiler like devc.
Once you have some buildable code, you will probably want to turn off Unicode support. Most code isn't Unicode, but Microsoft are (probably correctly) defaulting their tools to support character sets with more than 256 characters in.
To do this, choose
Project->Properties->Configuration Properties->General->Character Set->Use Multi-Byte Character Set
Click OK.
Finally you can use
Build->Build Solution (F7) to build your code
and
Debub->Start Debugging (F5) to start running it in the debugger.
If the code doesn't build, click on the error message and it will take you to the line the error occurred. If you don't understand anything F1 always brings up related help (I choose not to use online help, since it's all in the Platform SDK you installed).
To change to a Release build instead of Debug, choose the drop down box on the toolbar that says 'Debug' and choose 'Release'. You will need to change the Unicode setting again since project properties are specific to each configuration. You can have as many configurations as you want using the Configuration Manager which is also in that drop down box.
There are loads of other useful features in the editor and the debugger is excellent.
Please correct, update or reply to this article if you see mistakes or omissions.
Jim
-
awesome post jimbo.. inc(karma);
been thinking about making the switch to a c syntax language and this might be exactly what i need..
-
I've tried following the instructions above, for me they are unclear. The compiler does not seem to know where to look to find an include file.
I've installed vcstudio and psdk.
I also tried to follow the guidelines above but I don't know why, they are just confusing.
Once you have the Platform SDK installed you need to follow instructions 3,4 and 5 on the usingpsdk page.
????????????????????
Would this be the page in the platform SDK doccumentation that appears in the program menu after installation?
Options 3 4 and 5 are confusing. The directory structure that they talk about does not exist.
Not on my installation anyway.
Never mind, I can make "hello world" console apps!
hehe.
This will be nice when it works but for now it sucks.
-
My installation is so fucked up now.
I will probably have to uninstall everything. Thinking of using devc instead, as usual Microsoft makes what should be an easy install a fucking nightmare. Advice to anyone wanting to use Visual Studio Express... Well I'd say don't ask >me< how to install it because I followed the instructions to the best of my ability and ruined it. :vangry:
-
I think I have it working.
Basically I had to manually add the directory paths for lib , bin and inc in the visual studio options menu.
I still think M$ is totally sucky, but at least is seems to be working (in that I can include windows.h and build a successful exe) no doubt more problems will surface later from this typically lame and shit microtwatsoft installation.
-
I think I have it working.
Basically I had to manually add the directory paths for lib , bin and inc in the visual studio options menu.
I still think M$ is totally sucky, but at least is seems to be working (in that I can include windows.h and build a successful exe) no doubt more problems will surface later from this typically lame and shit microtwatsoft installation.
Totally agree with you here. I also remember having some troubles installing M$ VC++.
Though my first experience working with it was quite positive. Nevertheless, I want to
give Eclipse C++ plugin a try someday - because I nearly do all my programming with
the Eclipse IDE nowadays.
Nevertheless, I also had to do some changes manually and I really wonder why M$
makes installing such a product like the Visual Suite so complicated. Every shareware
product provides a more comfortable way to install.
-
VC++2005 was designed first for .Net programs, to make all modifications to use it for win32 project is really annoying :( , you need to carefully follow the procedures to install PSDK libraries.
That IDE is really good, believe me, it's really worthy to try hard and install VC++2005
@Shock: Let me know if you get more troubles with it...
-
Thanks Rbraz, having used a few different Ide's in my life I agree with you, this one looks excellent as you say. I don't know if I have made all the right paths to the psdk libraries but I will appreciate the help in the future as I am bound to run into problems! Thanks mate.
-
If there's anything wrong with my instructions can you please update them or add a note? The bit you had to do manually is correct - you have to add the paths to the platform SDK (inc/lib/bin) to the global paths in the options.
Stick with it :D
Jim
-
Installing the DirectX SDK
If you don't already have it, download the DirectX9c February Edition from here
http://www.microsoft.com/downloads/details.aspx?FamilyId=09F7578C-24AA-4E0A-BF91-5FEC24C8C7BF&displaylang=en (http://www.microsoft.com/downloads/details.aspx?FamilyId=09F7578C-24AA-4E0A-BF91-5FEC24C8C7BF&displaylang=en), it's 432Mb.
Once you have it installed, you need to add the paths just like you did with the Platform SDK, that is
Tools->Options->Projects and Solutions->VC++ Directories
Click the New Folder icon top right to create a new line, and browse to the files in the installation.
By default they are
C:\Program Files\Microsoft DirectX SDK (February 2007)\Include
C:\Program Files\Microsoft DirectX SDK (February 2007)\Lib\x86
Jim
-
This is nothing to do with DX but I'm getting reports of this message from others trying to run my exe:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. ...
It's something to do with missing files so what do i need to distribute?
-
Probably the runtime library DLLs. Try going in to
Project->Properties->Configuration Properties->C/C++->Code Generation->Runtime Library
and change it from Multi-threaded DLL to Multi-threaded. That will build it with static libraries.
Jim
-
Thanks Jim, that worked although the exe's now a little bit bigger.
-
Get this bad boy onto it :)
KKRUNCHY! (http://www.pouet.net/prod.php?which=26088)
It'll squish it down again.
-
In VS2005, the dlls you need to distribute are in here C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT. Not sure if that'll be the same with Express.
Jim
-
What did I do wrong?
I installed visual studio C++ to the default directory and followed steps 4&5 as well as I understood but I'm getting this error
File: C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults\CoreWin_Express.vsprops
Line: 9
Column: 1
Error Message:
A name was started with an invalid character.
the file the error is referring to is the same file that M$ told me to edit in step 4 I thought I did it right but the line the error is reporting the problem with isnt the line I edited its the next one down here is what that file looks like
<?xml version="1.0"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="Core Windows Libraries">
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
</VisualStudioPropertySheet>
the last line is the problem apharently so what did I do wrong?
-
You've managed to chop /> off the end of the previous line. Exactly what Shockwave did ;D
It used to read
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib" />
Jim
-
The really should bulletproof these things Thanks Jim :whack:
-
What? You mean you don't understand XML tags?! :P Actually, it's ridiculous isn't it? They could have made an exe that would automate the entire process, including installing the Platform SDK.
Jim
-
Everything is working now thanks again Jim I just ran my first app (step 5) it worked, didnt do much mind you but its a start
-
Excellent!
-
Service Pack 1 for Visual Studio 2005 and Express has been out for a while now.
http://msdn2.microsoft.com/en-au/vstudio/bb265237.aspx (http://msdn2.microsoft.com/en-au/vstudio/bb265237.aspx)
.NET 2005 431Mb
2005 Express 19-149Mb
And then there is a Service Pack 1 Update for Vista available too. 28.9Mb.
If you get an error like this:
fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411'
It means you're using a non SP1 version and you're trying to link in a library or object built with SP1. The two solutions are to upgrade your install, or rebuild the library from source.
Jim
-
Hi guys im having problems with the install paths in step 3 followed all ms install steps and still gives me cannot find windows.h whenever i try compile anything everytime update paths click ok dell .dat file in documents and settings restar VS same error .
Any Suggestions Except Throw It Away ;)
-
Throw it away:)
just kidding
I installed this a few days ago and all acually vent fine(more or less). one problem that i had was that the paths in step 3 where wrong for me, so check them manually maxx.
installing the directx sdk worked the same way with these dodgy paths.
//Paul
-
Throw it away:)
just kidding
I installed this a few days ago and all acually vent fine(more or less). one problem that i had was that the paths in step 3 where wrong for me, so check them manually maxx.
installing the directx sdk worked the same way with these dodgy paths.
//Paul
Thanx Paul i tried again but this time with paths as $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2\include and everything worked fine including DirectX with same path routine.
Thankyou Very Much.
-
Good stuff! Welcome to the forum!
Jim
-
Yip, Hi Maxx :)
-
Thanx for the help and the welcome guys and big hands up on the forums great community you have here.
-
HI!
I just re-installed Visual Studio 2003 .NET again after fighting with VS Express. I tried to compile an 64k intro with it and the only way I could get it running at the Euskal compo machine was to use static linking which, after Kkrunchy, did take the exe from 41 Kb up to 72 Kb.. I think I tried everything just to make the bastard work but it wouldn't find the new c++ standard library dll's on the compo machine. I searched everywhere for answers but couldn't find a proper solution. :-[
The worst part is that I really miss VS Express now, perhaps I should re-install again and find a solution that works. Any one here who has got it working without static linking? It makes me really mad since I know the dll's are there, the program is just too lazy to go looking for them. :)
-
Which dll do you're talking about ? Msvcrt.dll perhaps ?
-
Which dll do you're talking about ? Msvcrt.dll perhaps ?
Yeah, the msvcr80.dll which my intro did everything to avoid. :(
Perhaps the problem lies in that I haven't had time too dig deeper in too what differences they have made in the 2005 edition ( manifest files and such ) compared to earlier releases.
On my computer things just worked smooth. On some computers which had VS Express and the Platfrom SDK installed it worked, on others it didn't. On computers which only have the runtime installed the thing just dies due to missing dll. I tried the depends software and it confirms that the intro can't locate the msvcr80.dll on the computer.
It feels like there is something wrong in the project but I gave up searching for a solution since VS 2003 gets it working without a problem.
Anyone who had similar problems and fixed it? I know it´s possible to get things working without static linking, I just failed on finding how.
-
I looked into this recently. I think there's more than one version of msvcr80.dll, and that newer versions of VC2005 with the latest service pack generate exes that need the newest version of it. And I think that when you get the .NET Framework updates from Microsoft Updates you automatically get the new DLLs.
And this is Microsoft's attempt to fix what us developers call "DLL Hell"!
Jim
-
ok, thanks Jim. Then I use 2003 for intros and Express for demos. :)
-
Which dll do you're talking about ? Msvcrt.dll perhaps ?
Yeah, the msvcr80.dll which my intro did everything to avoid. :(
Perhaps the problem lies in that I haven't had time too dig deeper in too what differences they have made in the 2005 edition ( manifest files and such ) compared to earlier releases.
On my computer things just worked smooth. On some computers which had VS Express and the Platfrom SDK installed it worked, on others it didn't. On computers which only have the runtime installed the thing just dies due to missing dll. I tried the depends software and it confirms that the intro can't locate the msvcr80.dll on the computer.
It feels like there is something wrong in the project but I gave up searching for a solution since VS 2003 gets it working without a problem.
Anyone who had similar problems and fixed it? I know it´s possible to get things working without static linking, I just failed on finding how.
I had similar problem, my solution for this was using an old msvcrt.lib file from MSVC 6.0 renaming it to msvcrts.lib and copy it to the psdk lib folder, using this method I can use the standard msvcrt.dll present on all pc config.
-
I don't think there's any guarantee that will work if Microsoft built the C runtime library against different standard headers than the ones your app is built against - some of the structures might have changed, eg. FILE.
Jim
-
hi guy's....
i've followed all of the instructions on the "getting started with VC++ EE" and it realy helped me a lot!
thanks, i am at the point the IDE completes the linking stage with all the DX SDK libraries and the platform SDK.
but...
i am now getting an error in the code gen. part about the MT:
1>Embedding manifest...
1>mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "..\static runtime\guy.exe". The process cannot access the file because it is being used by another process.
1>Build log was saved at "file://c:\Users\zaidi\Documents\Visual Studio 2005\Projects\guy\guy\static runtime\BuildLog.htm"
1>guy - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =======
-
One way that can happen is that last time you ran guy.exe it didn't exit properly, so it is in fact still running. Start task manager and see if it's still in the process list. If it is, kill it, and work out why it's not stopping properly.
Another thing is that sometimes, rarely, visual studio gets confused. Try closing it and reopening it.
Jim
-
well.... once every four try's it does work...
i monitored my processes but there was nothing running.... hmmmmmm weird.........
(well i only need it for the static run time so i could handle the repressing build...0
but theres just something which isnt right....
-
Hmm, sounds bad, but you really should try to fix it :)
Jim
-
I installed visual studio express, and it said I must register it in 30 days :-\ . Is this necessary, can I use it without registering? Thanks for your answer already...
- Kypho
-
sorry about my stupid post. I figured that the reg key could be achieved free from microsoft :)
- Kypho
-
Good news :) Welcome to the forum Kypho!
Jim
-
Yeah. Welcome to the forum !!! :hi:
-
Thanks guys :)
-
Hi I have done everything right got Microsoft Visual C++ 2005 Express Edition to work on Windows and some DirectX projects. But I tried to type in some code from the book Beginning DirectX 9 and it would work. I made sure to open up the code from the book and it updated it to work in Microsoft Visual C++ Express 2005 Express Edition and it runs fine.
Then I just copied her code from the book into my program thinking I might have typed it in wrong and it still would not work right. I then went into Project Properties and set it up the way hers was I just opened up two programs at once to do this and it still will not work. I want to know does anybody know what else I need to setup on this program to work on a project like this here on this site. I say this because it does on the one from the book, so it should work correctly if setup right.
-
I'm sorry I forgot the output information here it is below.
1>------ Rebuild All started: Project: TestTriangle, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'TestTriangle', configuration 'Debug|Win32'
1>Compiling...
1>cl : Command line warning D9007 : '/Gm' requires '/Zi or /ZI'; option ignored
1>winmain.cpp
1>dxManager.cpp
1>.\dxManager.cpp(63) : error C2511: 'void dxManager::drawVB(LPDIRECT3DVERTEXBUFFER9)' : overloaded member function not found in 'dxManager'
1> c:\documents and settings\mike neiheisel\my documents\visual studio 2005\projects\testtriangle\testtriangle\.\dxmanager.h(8) : see declaration of 'dxManager'
1>Generating Code...
1>Build log was saved at "file://c:\Documents and Settings\Mike Neiheisel\My Documents\Visual Studio 2005\Projects\TestTriangle\TestTriangle\Debug\BuildLog.htm"
1>TestTriangle - 1 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
-
dxManager.cpp(63) : error C2511: 'void dxManager::drawVB(LPDIRECT3DVERTEXBUFFER9)' : overloaded member function not found in 'dxManager'
OK, what this error message means is, that in the class "dxManager" there is no function (member) called "drawVB" that takes a parameter of type "LPDIRECT3DVERTEXBUFFER9".
So you are trying to call drawVB() from your own code with a parameter of the wrong type.
That's about all I can tell you without you posting more :)
Jim
-
I could unerstand if I put it in wrong, but I copied the code from her book. And by the way it works fine when I put tried her code it makes an .exe file. I've typed this code in before and got it to work with Dev-C++ just cannot do it in Microsoft's Visual C++ 2005 Edition I have the Windows Server SDK installed put in correctly too. I've run some other programs in Windows and DirectX just not this program and one in my Windows book is the same.
I thought I had to fix the Project Properties I set them up just the way hers was still not working. I do not know if there is something else I need to fix in order to run this program correctly maybe someone knows I sent an e-mail off to the author in case she knows too.
-
Have you got the DirectX9 SDK? Have you set the include and lib paths to it in
Tools->Options->Projects and Solutions->VC++ Directories.
Have you made sure the DirectX include paths are first in the list, before the Platform SDK ones?
I think you're probably be right to suspect you've not set up VS2005 properly. Is there anywhere I can get a look at this dxManager.cpp code?
Jim
-
Yes I do I set it up the way this guy tells you on his site works fine on DirectX and Windows for some things just not this one. I tried to set the proerties up the way she had hers, but still will not work that is why I am stuck.
http://www.burninghands.net/2006/04/01/vcexpress-with-directx-sdk/
-
I found my mistake I did not start a New Win32 Console then go to Windows and Empty project. I just went to empty project from the New I was not thinking that I had to go to Win32 at first I thought it would be just in Dos Mode and not let you click on something to add a window to the project sorry for the question. But you guys did try to help thank you.
-
:D Cool, you got it fixed. Microsoft haven't supported DOS development since, ..., forever.
Jim
-
I am thinking on this alot lately, probably will need a new PC before I do.
How much Disk Space is roughly needed?
-
You want to be on VS2008 now, but about 3Gb is needed in any event.
Jim
-
Confused. o_0
People keep on about the Platform SDK, and I cant find a dickie bird of it mentioned on the Express website, seen stuff about the web development sdk, but im dont think thats it, and im not into making a website. What exactly is the Platform SDK, I would instantly think platform meaning Windows Vista 32, as thats what I have.
I've got the 2008 express edition: please could you post the correct download link for me please?
Thanks if you can,
Clyde.
-
I was under the impression that VS2008 Express came with the Platform SDK built in <edit>checked, it does<edit>. It was separate in 2005. You're right in that the Plaform SDK is what you need to start writing Windows programs, everything except device drivers.
Jim
-
Cool thankyou mate.
-
a d/l of devc++ that's been sitting on my HD fro a while, v 4.9.9.2
I have got VC installed but my reg key's been messed up.
Thank you for sharing
-----------------------
quang cao online (http://blinkb.vn) | quang cao (http://blinkb.vn)