473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Macro to compile a file set (cpp/h)

Hi

Is it possible to write a macro that compiles a file set (cpp/h).
I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a shortcut.

Can anyone show me what that macro should look like?

Thanks Torben

Jan 7 '08 #1
5 1195
>Is it possible to write a macro that compiles a file set (cpp/h).
>I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a shortcut.
In VS the normal mapped keystroke for the compile menu option (for
C/C++) is Ctrl+F7.

Dave
Jan 7 '08 #2
Thanks Dave, I did not see that one.

But it only works if I select the file in the solution explorer and only if
I select the .cpp file.

Isn't there a way to compile if I am in the editor for eigther the .h or
..cpp file?

Torben

"David Lowndes" <Da****@example.invalidwrote in message
news:h7********************************@4ax.com...
Is it possible to write a macro that compiles a file set (cpp/h).
I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a shortcut.

In VS the normal mapped keystroke for the compile menu option (for
C/C++) is Ctrl+F7.

Dave
Jan 7 '08 #3
>Isn't there a way to compile if I am in the editor for eigther the .h or
>.cpp file?
It should work if you're currently editing the cpp file - it always
has for me.

Dave
Jan 7 '08 #4
Torben Laursen wrote:
Thanks Dave, I did not see that one.

But it only works if I select the file in the solution explorer and only
if I select the .cpp file.

Isn't there a way to compile if I am in the editor for eigther the .h or
.cpp file?
Torben:

I'm not sure that this is a realistic goal. Not all code is organized
into .h/.cpp pairs.

There is an old add-in that switches between the .h and .cpp files (if
any), or it can be done with Visual Assist. That is what I do.

I also add the Compile command to my build toolbar (next to the build
project button). The button is dimmed if the current file is not an
implementation file.

--
David Wilkinson
Visual C++ MVP
Jan 7 '08 #5
Ctrl+F7 works fine in a .cpp file, sorry my mistake.

I have a macro to switch between .cpp and .h.
What I was looking for was a general method to compile a file or file set
just like in C++ builder 6.0
When I worked in that compiler I jused it a lot to check my code for syntax
errors.

Torben

"David Wilkinson" <no******@effisols.comwrote in message
news:e9**************@TK2MSFTNGP03.phx.gbl...
Torben Laursen wrote:
>Thanks Dave, I did not see that one.

But it only works if I select the file in the solution explorer and only
if I select the .cpp file.

Isn't there a way to compile if I am in the editor for eigther the .h or
.cpp file?

Torben:

I'm not sure that this is a realistic goal. Not all code is organized into
.h/.cpp pairs.

There is an old add-in that switches between the .h and .cpp files (if
any), or it can be done with Visual Assist. That is what I do.

I also add the Compile command to my build toolbar (next to the build
project button). The button is dimmed if the current file is not an
implementation file.

--
David Wilkinson
Visual C++ MVP
Jan 7 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John H. Krueckeberg | last post by:
How does the macro operator ## work? For example, given a macro like this #define REGISTER_CLASS(_class, _symname) _class::MetaClass instance##_class(_symname); What would...
3
by: Baloff | last post by:
Hello I am building a macro using edit-kbd-macro. ****************************** C-x C-f ;; find-file E ;; self-insert-command TAB ;; c-indent-command T ;; self-insert-command...
20
by: Jim Ford | last post by:
I understand that some compilers define a symbol that can be used anywhere in the code in order to find out, at run time, the name of the file where the code corresponding to the current execution...
0
by: Don Wimani | last post by:
Hi, I'm working with code that won't compile, unless I leave out some macro's. The person I got this code from, tells me it has allways worked. And I believe it, because I actually saw it. ...
6
by: Gabest | last post by:
I'm asking this because I'd like to include a few (but often used) inline assembly code via marcos to make the whole thing a bit more readable, and more resistant to typos (by keeping the repeating...
8
by: Seeker | last post by:
Hello, In using Solaris Pro Compiler to compile Pro*C code. I am getting this error: make: Fatal error in reader: parser_proc_online.mk, line 26: Badly formed macro assignment Based on other...
0
by: Jérôme Le Bougeant | last post by:
Hello (and sorry for my English), I downloaded the VideoCapture module on the http://videocapture.sourceforge.net/ site. I tested it with a webcam and that functions. Now I want to...
2
by: George2 | last post by:
Hello everyone, The compile error of the following code is, foo.cpp(7) : error C2146: syntax error : missing ';' before identifier '_' foo.cpp(7) : error C2065: '_' : undeclared identifier...
1
by: todWulff | last post by:
Good day folks. Let me open with the statement that I am not a C++/C programmer. The environment that I am programming in is ARMbasic, an embedded BASIC targeted toward ARM-based...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.