![]() |
| | #1 |
| C++ SharK Join Date: Mar 2004 Location: Denmark
Posts: 62
| Compiling from DOS Prompt using Visual Studio Express 2005 I have been trying to compile my programs using Visual Studio Express 2005 from the Command Line in windows xp. One tutorial says: cl -GX prog1.cpp but the compiler says something like "-GX will not be used in a future release of the compiler....", and it will NOT compile. Of course I can use the GUI to compile, and then it all works fine, but I think I should be able to do it by hand, so to speak....in a DOS prompt. ;-) Any suggestions
__________________ Studying programming languages, you'll ALWAYS be a student ;-) |
| The SharK is offline | |
| | #2 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 6,092
| /GS would be want you want. Not -GS. However, this switch instructs the compiler to do buffer security checks for you. Which is unecessary since it is ON by default. /GS- would disable it. cl /EHs prog1.cpp is probably the most minimalist choice. It compiles prog1.cpp with exception handling.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. Quiet Technologies... that make some noise. |
| Mario F. is offline | |
| | #3 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 6,092
| Didn't correctly read your original post. You were trying to use GX, not GS. GX enables exception handling. However it is deprecated. Use /EH options instead, like the exaple on my previous post.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. Quiet Technologies... that make some noise. |
| Mario F. is offline | |
| | #4 |
| C++ SharK Join Date: Mar 2004 Location: Denmark
Posts: 62
| hmm... The compiler still complains: no include path set If I run vcvars32.bat, then it works, but I would like the change to be PERMANENT
__________________ Studying programming languages, you'll ALWAYS be a student ;-) |
| The SharK is offline | |
| | #5 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,761
| Put the contents of vcvars32.bat in \autoexec.bat.
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, nort, etc. |
| dwks is offline | |
| | #6 |
| C++ SharK Join Date: Mar 2004 Location: Denmark
Posts: 62
| hi dwks Nope, unless I ALWAYS run autoexec.bat, before I compile.... seems very complicated.....hmmmm...
__________________ Studying programming languages, you'll ALWAYS be a student ;-) |
| The SharK is offline | |
| | #7 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 6,092
| Ah, yes. The environment variables. Open vsvars32.bat with a text editor. It's located on your visual studio folder/common7/tools. You see those set commands? Those are the environment variables you need to add to your system environment variables. Right-click my computer->Properties->Advanced->Environment Variables. Add each and one of those to the system variables part.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. Quiet Technologies... that make some noise. |
| Mario F. is offline | |
| | #8 | |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,761
| Quote:
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, nort, etc. | |
| dwks is offline | |
| | #9 |
| and the hat of Destiny Join Date: Aug 2001 Location: The edge of the known universe
Posts: 22,495
| It might be run when you run a particular kind of backward compatibility DOS emulator, I didn't think it was touched at all in a normal XP boot up. Besides, the environment can be set on a per user basis in XP, so a global autoexec.bat doesn't make sense. Create a cmd file with Code: call vcvars32.bat start cmd |
| Salem is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Testing some code, lots of errors... | Sparrowhawk | C Programming | 48 | 12-15-2008 04:09 AM |
| Difference between Visual studio 2005 command prompt and the regular one | jordanguyoflove | C Programming | 3 | 10-16-2008 02:09 PM |
| Another syntax error | caldeira | C Programming | 31 | 09-05-2008 01:01 AM |
| Avoiding Global variables | csonx_p | Windows Programming | 32 | 05-19-2008 12:17 AM |
| Visual C++ 2005 Express Edition | BestGameMovie | C++ Programming | 6 | 05-15-2005 01:49 PM |