Archived

This topic is now archived and is closed to further replies.

xropi

MS VC pragmas

Recommended Posts

Hi! Is there a way to have any of the compiler options pragmatically from inside a cpp source file using MS VC++? [edited by - xropi on October 21, 2002 11:15:45 AM]

Share this post


Link to post
Share on other sites
you can set compiler options for specific files by selecting the individual file in Project->Settings or by right clicking on the file in the ''file view'' tree window on the right.

or did you mean to ask about the #pragma directive?

Share this post


Link to post
Share on other sites
Yes, because there are some options I prefer to set and I hate setting them manually through the compiler settings in the IDE every time I start a new project.

I'd rather include a header file which does the work via #pragmas.


( /QIfist would be one of that options )


[edited by - xropi on October 21, 2002 11:42:36 AM]

Share this post


Link to post
Share on other sites
in msvc7, you can just change the settings in the wizard, see vsnet\vc7\vcwizards folder. not sure about msvs6.

Share this post


Link to post
Share on other sites
he''s saying he wants to control it via his cpp or h files or whatever.
i hate using ms wizards :\
i always include lib files with #pragma comments

-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Share this post


Link to post
Share on other sites
quote:
Original post by niyaw
in msvc7, you can just change the settings in the wizard, see vsnet\vc7\vcwizards folder. not sure about msvs6.


I''ve MS VC6.0...

Share this post


Link to post
Share on other sites
quote:
Original post by xropi
I''ve MS VC6.0...

then you''re out of luck. some project options can be changed via pragmas, #pragma warning and #pragma optimize come to mind. see #pragma in msdn for a complete list of (documented ) available pragmas. since msvc6 appears to store its wizards in executables as opposed to javascript text files, you can''t change them if you don''t have their source code. looks like you''ll have to change those settings by hand for every project.

quote:
Original post by eldee
i hate using ms wizards :\
i always include lib files with #pragma comments


as i said, you can only change so much using the #pragmas. congratulations on your decision to hate your development environment and deprive yourself of fully utilizing it.

Share this post


Link to post
Share on other sites
1) I can think of a couple of ways to do it, but they''re evil, twisted (serious abuse of custom build steps, dsp files etc) and not so portable so I won''t mention them here


2) Surely you could just set up an empty project, close it and then copy and rename the .DSP file for the project every time you want to make something similar.


3) Or make a custom app wizard for your settings.


4) Or maybe replace CL.EXE with a batch file called CL.BAT which selectively replaces the compilation command line parameters from a specified source file - could even write a small program to do that - you already have the paths etc


5) Alternatively you may find the project settings lying around in the registry.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
quote:
Original post by niyaw
congratulations on your decision to hate your development environment and deprive yourself of fully utilizing it.


congratulations?
im sorry, but i must''ve missed the part on the EULA that said
i had to enjoy *every* aspect of visual studio.
for your information, the ONLY reason i use visual c++ is because
its compiler is slightly faster, its intellisence is very handy,
and the fact that visual assist isnt availible on any other IDE.
congratulations on assuming that everybody has the exact same needs
as you.

-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Share this post


Link to post
Share on other sites
quote:
Original post by eldee
im sorry, but i must''ve missed the part on the EULA that said
i had to enjoy *every* aspect of visual studio.


so your bashing spirit woke up and told you to express your hate of a feature you aren''t even using?

Share this post


Link to post
Share on other sites