C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-12-2006, 05:01 AM   #1
C++ SharK
 
The SharK's Avatar
 
Join Date: Mar 2004
Location: Denmark
Posts: 62
Compiling from DOS Prompt using Visual Studio Express 2005

Hey


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   Reply With Quote
Old 06-12-2006, 05:10 AM   #2
(?<!re)tired
 
Mario F.'s Avatar
 
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   Reply With Quote
Old 06-12-2006, 05:12 AM   #3
(?<!re)tired
 
Mario F.'s Avatar
 
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   Reply With Quote
Old 06-12-2006, 04:28 PM   #4
C++ SharK
 
The SharK's Avatar
 
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   Reply With Quote
Old 06-12-2006, 04:30 PM   #5
Frequently Quite Prolix
 
dwks's Avatar
 
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   Reply With Quote
Old 06-12-2006, 04:35 PM   #6
C++ SharK
 
The SharK's Avatar
 
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   Reply With Quote
Old 06-12-2006, 04:42 PM   #7
(?<!re)tired
 
Mario F.'s Avatar
 
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   Reply With Quote
Old 06-12-2006, 04:44 PM   #8
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,761
Quote:
Nope, unless I ALWAYS run autoexec.bat, before I compile....
AUTOEXEC.BAT is always executed when the computer turns on. You'll just have to reboot, or at least re-launch your DOS prompts.
__________________
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   Reply With Quote
Old 06-13-2006, 01:24 AM   #9
and the hat of Destiny
 
Salem's Avatar
 
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
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 12:04 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22