Anyone know why the gcc line would show up three times during a compile?
1) I am using 4.9.9.2 on XP.
2) I have a huge program and I'm not sure what code would be appropriate to post. It doesn't seem like a code issue anyway. I started with a Dev-Cpp example program and built on it. It's all in C.
3) Here's the log:
Compiler: Default compiler
Building Makefile: "C:\Bittware\chamber\Makefile.win"
Finding dependencies for file: C:\Bittware\chamber\chamber.c
Executing make...
make.exe -f "C:\Bittware\chamber\Makefile.win" all
"c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-08-21
OK, I've got it!
In general you need to post the "Compile Log" to see what is going on, the "Compile" tab is a filtered version of that. It may have helped in this case to see the two logs (with and without redirection), but I think I know what is happening.
The filtering that generates the Compile tab output can stumble over text output by custom rules (i.e. not compiler or linker output) and may parse and count an error where the is none. Redirecting the output prevents that because it is not captured into the log.
You may consider redirecting to >NUL, which will stop the text from being output without having to create a file.
You probably don't need the subst - and sorry about forgetting the quotes!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you're right. These lines show up in the compile log without the redirection:
SubWCRev: 'C:\Bittware\chamber\'
Last committed at revision 1535
Mixed revision range 663:1535
Local modifications found
And the text on the Compile tab is from the first line of that output. Thanks for clearing things up for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-08-19
Very strange. Dev-C++ (or rather make.exe) sometimes has problems with spaces in paths, so calling your .exe "The Chamber Maid.exe" is ill-advised (it also sounds like a porn title!). The fact that it comprises of three words may be germane.
For the same reason it may be wise to move your svn installation (although that does not look like a problem in this case).
It is worth noting that it is not compiling three times but linking three times - that is a linker invocation through the compiler. I say it is worth noting, because it is the only time that the .exe name is used.
You can change the exe name under Project->Project options->Build options. Or just create a new project.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The spaces in the filename were the problem. Removing them made the linking line show up only once. Unfortunately the program name has already caught on with my co-workers and I'm not changing it at this point. I'm curious, do you think it's actually doing something three times or is the message just printing three times?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-08-19
I suppose you could run the make file in debug mode to determine that, but I have no doubt that it is running three times. I suggest that you build with a 'compatible' name, and then use your after-all rule to rename or copy it to the preferred name.
I have to say however what weird co-workers you have to think that an executable name with spaces is a good idea; where have you ever seen that before? It is 'unconventional' to say the least.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the after-all rule, I already have one in my makefile. Do I just add a second line beginning with a tab? I don't know the syntax very well, sorry. Can I do this:
Any idea how that will affect my svn control? Does move just do copy and delete when it overwrites? Or does it first delete the destination, which would mess up svn probably.
I briefly looked through my Program Files folder and a bunch of commercially available software uses spaces in both folder name and exe name. I think if you have no unix background you'd see no reason to think it's bad, and you would just name your executable the name of the program itself. I'll admit though, it is more common to use the capitalize-every-first-letter syntax (TheChamberMaid.exe) than to have the spaces.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-08-20
>> Can I do this: ...
It would have been quicker to just try it that to ask, but basically - yes. I would use copy rather than move since the make file will use the time stamp or existence of the .exe to determine whether it needs to build, the missing .exe will cause a re-link every time. That said, your after-all rule already does that by deleting other intermediate files - it kind of misses the point of using make in the first place!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had such bad luck trying to get the custom makefile thing to work the first time around that I thought it better to ask than to just experiment. I still don't have it quite right. It might have to do with spaces in the svn install path (which I can't change due to company policy) but right now this works:
The computer is my work computer, but the project is not. It's used by my co-workers, but not developed on company time, and I develop it for other uses as well. It's a small company, so things like that are normal I guess?
I used the subst command (needs quotes though) and I get the same basic result. If all-before is this:
I think in both cases it's actually compiling, but it won't Compile and Run in the first case. It stops after the compile and indicates Total Errors = 1 on the Compile Log. Also, the compile logs are identical except for the last line. When it fails it stops at "Execution terminated" and when it succeeds it adds "Compilation successful".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anyone know why the gcc line would show up three times during a compile?
1) I am using 4.9.9.2 on XP.
2) I have a huge program and I'm not sure what code would be appropriate to post. It doesn't seem like a code issue anyway. I started with a Dev-Cpp example program and built on it. It's all in C.
3) Here's the log:
Compiler: Default compiler
Building Makefile: "C:\Bittware\chamber\Makefile.win"
Finding dependencies for file: C:\Bittware\chamber\chamber.c
Executing make...
make.exe -f "C:\Bittware\chamber\Makefile.win" all
"c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
gcc.exe -c chamber.c -o chamber.o -I"C:/Dev-Cpp/include"
windres.exe -i chamber_private.rc --input-format=rc -o chamber_private.res -O coff
gcc.exe chamber.o chamber_private.res -o "The Chamber Maid.exe" -L"C:/Dev-Cpp/lib" -mwindows -lcomctl32 visaext.lib agvisa32.lib agvisaext.lib visa32.lib
gcc.exe chamber.o chamber_private.res -o "The Chamber Maid.exe" -L"C:/Dev-Cpp/lib" -mwindows -lcomctl32 visaext.lib agvisa32.lib agvisaext.lib visa32.lib
gcc.exe chamber.o chamber_private.res -o "The Chamber Maid.exe" -L"C:/Dev-Cpp/lib" -mwindows -lcomctl32 visaext.lib agvisa32.lib agvisaext.lib visa32.lib
del chamber.o chamber_private.h chamber_private.rc chamber_private.res
Execution terminated
Compilation successful
Also, here are the makefiles:
Auto-generated:
Project: The Chamber Maid
Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES = chamber_private.res
OBJ = chamber.o $(RES)
LINKOBJ = chamber.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" -mwindows -lcomctl32 visaext.lib agvisa32.lib agvisaext.lib visa32.lib
INCS = -I"C:/Dev-Cpp/include"
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
BIN = "The Chamber Maid.exe"
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f
.PHONY: all all-before all-after clean clean-custom
all: all-before "The Chamber Maid.exe" all-after
include version/version.mak
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "The Chamber Maid.exe" $(LIBS)
chamber.o: chamber.c C:/Dev-Cpp/include/windows.h C:/Dev-Cpp/include/commctrl.h C:/Dev-Cpp/include/stdio.h C:/Dev-Cpp/include/sys/types.h C:/Dev-Cpp/include/time.h visa.h visatype.h chamber.h profiles.h chamber_globals.h chamber_prototypes.h version.h utils.c power.c serial.c logonce.c setpoint.c logging.c settings.c ini.c
$(CC) -c chamber.c -o chamber.o $(CFLAGS)
chamber_private.res: chamber_private.rc chamber.rc
$(WINDRES) -i chamber_private.rc --input-format=rc -o chamber_private.res -O coff
My own makefile to get the svn version:
Automatically retrieves svn version prior to build
all-before:
"c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
all-after:
del chamber.o chamber_private.h chamber_private.rc chamber_private.res
Done
OK, I've got it!
In general you need to post the "Compile Log" to see what is going on, the "Compile" tab is a filtered version of that. It may have helped in this case to see the two logs (with and without redirection), but I think I know what is happening.
The filtering that generates the Compile tab output can stumble over text output by custom rules (i.e. not compiler or linker output) and may parse and count an error where the is none. Redirecting the output prevents that because it is not captured into the log.
You may consider redirecting to >NUL, which will stop the text from being output without having to create a file.
You probably don't need the subst - and sorry about forgetting the quotes!
Clifford
I think you're right. These lines show up in the compile log without the redirection:
SubWCRev: 'C:\Bittware\chamber\'
Last committed at revision 1535
Mixed revision range 663:1535
Local modifications found
And the text on the Compile tab is from the first line of that output. Thanks for clearing things up for me.
Very strange. Dev-C++ (or rather make.exe) sometimes has problems with spaces in paths, so calling your .exe "The Chamber Maid.exe" is ill-advised (it also sounds like a porn title!). The fact that it comprises of three words may be germane.
For the same reason it may be wise to move your svn installation (although that does not look like a problem in this case).
It is worth noting that it is not compiling three times but linking three times - that is a linker invocation through the compiler. I say it is worth noting, because it is the only time that the .exe name is used.
You can change the exe name under Project->Project options->Build options. Or just create a new project.
Clifford
The spaces in the filename were the problem. Removing them made the linking line show up only once. Unfortunately the program name has already caught on with my co-workers and I'm not changing it at this point. I'm curious, do you think it's actually doing something three times or is the message just printing three times?
I suppose you could run the make file in debug mode to determine that, but I have no doubt that it is running three times. I suggest that you build with a 'compatible' name, and then use your after-all rule to rename or copy it to the preferred name.
I have to say however what weird co-workers you have to think that an executable name with spaces is a good idea; where have you ever seen that before? It is 'unconventional' to say the least.
Clifford
For the after-all rule, I already have one in my makefile. Do I just add a second line beginning with a tab? I don't know the syntax very well, sorry. Can I do this:
all-after:
<tab>del chamber.o chamber_private.h chamber_private.rc chamber_private.res
<tab>move /Y maid.exe "The Chamber Maid.exe"
Any idea how that will affect my svn control? Does move just do copy and delete when it overwrites? Or does it first delete the destination, which would mess up svn probably.
I briefly looked through my Program Files folder and a bunch of commercially available software uses spaces in both folder name and exe name. I think if you have no unix background you'd see no reason to think it's bad, and you would just name your executable the name of the program itself. I'll admit though, it is more common to use the capitalize-every-first-letter syntax (TheChamberMaid.exe) than to have the spaces.
>> Can I do this: ...
It would have been quicker to just try it that to ask, but basically - yes. I would use copy rather than move since the make file will use the time stamp or existence of the .exe to determine whether it needs to build, the missing .exe will cause a re-link every time. That said, your after-all rule already does that by deleting other intermediate files - it kind of misses the point of using make in the first place!
Clifford
I had such bad luck trying to get the custom makefile thing to work the first time around that I thought it better to ask than to just experiment. I still don't have it quite right. It might have to do with spaces in the svn install path (which I can't change due to company policy) but right now this works:
"c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
and this doesn't:
"c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h
I have to redirect to a file or something gets confused.
I delete the intermediate files because I hate having them clutter up my folder. Is there a way to have them go somewhere else, somewhere hidden?
>> which I can't change due to company policy
If this is a commercial development I would question whether Dev-C++ were an appropriate tool to use.
You could leave SVN where it is and use the subst command to create a virtual drive. Place the command:
subst s: c:\program files\tortoisesvn
in a batch file, and create a shortcut to that in the Start Menu's Startup group, or put the command in autoexec.bat in c:\
then your all-before rule would look like:
all-before:
<TAB>"s:\bin\subwcrev.exe" .\ .\version\version.repo .\version.h
Obviously the first time you will have to execute the subst command manually or reboot to see the new drive.
Clifford
The computer is my work computer, but the project is not. It's used by my co-workers, but not developed on company time, and I develop it for other uses as well. It's a small company, so things like that are normal I guess?
I used the subst command (needs quotes though) and I get the same basic result. If all-before is this:
"p:\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h
I get this on my Compile tab in the Message column (Line and File are blank):
'C:\Bittware\chamber\'
When I change to this:
"p:\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
It works.
I think in both cases it's actually compiling, but it won't Compile and Run in the first case. It stops after the compile and indicates Total Errors = 1 on the Compile Log. Also, the compile logs are identical except for the last line. When it fails it stops at "Execution terminated" and when it succeeds it adds "Compilation successful".