473,695 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[VS 2005] Custom Build Step problem in C++

Hi all,

Sorry for the repost, but I never received any response when I first
asked this a few weeks ago. I would really appreciate some feedback on
this, it's driving me nuts...

I'm beginning the process of moving some projects from VS.Net 7 to
VS2005. I'm having problems getting a Custom Build Step to work.

In the dialog for the header file I want to perform the custom step on,
I copy and paste the command line:
$(QTDIR)\bin\mo c.exe "..\Messenger.h " -o ".\moc_Messenge r.cpp"

I also set description, outputs, additional dependencies
($(QTDIR)\bin\m oc.exe), and click Ok. I can open the dialog up again,
and see all the options as I set them.

However, when I do a build, it fails, with moc.exe complaining of
invalid arguments. When I check the Command Line entry in the Custom
Build Step properties again, it now contains:
$(QTDIR)\bin\mo c.exe -DQT_NO_DEBUG -D_WINDOWS -DUNICODE -DWIN32
-DQT_DLL -DQT_THREAD_SUPP ORT -I"$(QTDIR)\incl ude" -I"."
-I"d:\Qt\3.3.2\m kspecs\win32-msvc.net" "..\Messenger.h " -o
".\moc_Messenge r.cpp".

I can remove the '-DQT_NO_DEBUG -D_WINDOWS -DUNICODE -DWIN32 -DQT_DLL
-DQT_THREAD_SUPP ORT -I"$(QTDIR)\incl ude" -I"."
-I"d:\Qt\3.3.2\m kspecs\win32-msvc.net', compile, get the error, repeat
ad naseum.

Is there some option somewhere in VS2005 that is causing it to add the
defines and includes to the command line for a CBS? I never experienced
this in VS 7.

Thanks, Michael
Sep 19 '06 #1
1 2357
Michael Russell wrote:
Hi all,

Sorry for the repost, but I never received any response when I first
asked this a few weeks ago. I would really appreciate some feedback
on this, it's driving me nuts...

I'm beginning the process of moving some projects from VS.Net 7 to
VS2005. I'm having problems getting a Custom Build Step to work.

In the dialog for the header file I want to perform the custom step
on, I copy and paste the command line:
$(QTDIR)\bin\mo c.exe "..\Messenger.h " -o ".\moc_Messenge r.cpp"

I also set description, outputs, additional dependencies
($(QTDIR)\bin\m oc.exe), and click Ok. I can open the dialog up again,
and see all the options as I set them.

However, when I do a build, it fails, with moc.exe complaining of
invalid arguments. When I check the Command Line entry in the Custom
Build Step properties again, it now contains:
$(QTDIR)\bin\mo c.exe -DQT_NO_DEBUG -D_WINDOWS -DUNICODE -DWIN32
-DQT_DLL -DQT_THREAD_SUPP ORT -I"$(QTDIR)\incl ude" -I"."
-I"d:\Qt\3.3.2\m kspecs\win32-msvc.net" "..\Messenger.h " -o
".\moc_Messenge r.cpp".

I can remove the '-DQT_NO_DEBUG -D_WINDOWS -DUNICODE -DWIN32 -DQT_DLL
-DQT_THREAD_SUPP ORT -I"$(QTDIR)\incl ude" -I"."
-I"d:\Qt\3.3.2\m kspecs\win32-msvc.net', compile, get the error, repeat
ad naseum.

Is there some option somewhere in VS2005 that is causing it to add the
defines and includes to the command line for a CBS? I never
experienced this in VS 7.
I'm not aware of any switch - but I suspect that the problem lies in the
fact that .h is an extenion that the IDE recognizes, so it's "helping" you.
Would it be possible to use a different extension for this file - one that
the IDE doesn't know anything about?

You might want to look into the features in VC2005 that allow you to define
your own build tools (based on file extension) so you don't have to worry
about writing custom build steps. Finding the options in the help is rather
torturous, but...
In the solution explorer, right-click on your C++ project and choose "Custom
Build Rules..." from the context menu.
On the dialog that appears, click "New Rule File...".
Give your new rule file a name, like "Run MOC"

.... and so on. It's a bit more involved than one might hope (but it's also
pretty powerful). See

http://msdn2.microsoft.com/en-us/library/03t8bzzy.aspx

as a starting point.

-cd
Sep 20 '06 #2

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

Similar topics

3
2055
by: Gordon Watts | last post by:
Hi there, I've got a special header file which I run an small external program over to produce a .cpp file that I want to have my project build. The special header file includes a second header file. I'm using VS.NET 2003 and I'd like to automate the process. To automate this I used the Custom Build Step associated with my first input file. I specified the output file, and also the second header as an additional dependency, and add the...
2
1731
by: Peter Ritchie | last post by:
In VS/VC 2003: Simple question: for the Custom Build Step for the project (right click the project in the Solution Explorer, select "Properties", select the "Custom Build Step" in the "Configuration Properties" tree at the left, then select "General" under "Custom Build Step"), what is the implicitly dependent file? My situation is, there is a file I would like to copy after the build; but, only if it has changed. I've added a "copy...
5
1981
by: Steve Le Monnier | last post by:
I've just noticed that the menu items available in Visual Studio 2005 for the Debug and Build menus differ significantly when compared to the menu items in Visual Studio 2003. On my C# installation I don't have build solution, rebuild solution, Step into, Step out, or the Exceptions options on my menu Does anybody know why these important tools are missing from the menu structure?
10
2520
by: WT | last post by:
Hello, I have been publishing my web site many times to the remote where resides my final web site. Everything was ok, but to-day, without any configuration change, vs doesn't copy final files to the remote site. It finish with a message of publish sucess but no files nor folders on the remote disk ? I have checked rights on this folder, everyone have modify.
2
2524
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article is the usage of "Custom Attribute" in real life project. Can somebody please help me understand where are these informations really helpful in Development Environment; may be a few example(s) will help me understand.
7
12235
by: ashley.ward | last post by:
We have been using VB6 to develop small custom apps that access an Oracle database, in order to extend a larger product that is developed by our colleagues in Germany (who use C++ and Java). As each app is small and simple, we have been distributing each to the customer in the form of a single EXE file. I have been attempting to build another one of these small custom apps, using VB 2005 Express Edition. It doesn't seem to be possible...
10
8200
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied everything I can find on COM Interop and .NET. I've also tried many of the 'Walkthroughs' on the MSDN site relating to COM add-ins, .NET and Office XP but am unable to get even these working in Excel 2002 or Word 2002. I've installed the Office XP...
0
1048
by: Michael Russell | last post by:
Hi, I'm beginning the process of moving some projects from VS.Net 7 to VS2005. I'm having problems getting a Custom Build Step to work. In the dialog for the header file I want to perform the custom step on, I copy and paste the command line: $(QTDIR)\bin\moc.exe "..\Messenger.h" -o ".\moc_Messenger.cpp" I also set description, outputs, additional dependencies ($(QTDIR)\bin\moc.exe), and click Ok. I can open the dialog up again,
0
8565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9113
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8841
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6488
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2997
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.