Makefile is 'screwed up' sometimes Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Makefile is 'screwed up' sometimes

Post by GeertVc »

Hi,

Already the second time in 2 days, I have a Makefile which is screwed up. When compiling, I get the following error:

Code: Select all

69 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\QacDlg.cpp unexpected end of file 
 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\Makefile.win [Build Error]  [Qac_private.res] Error 258 
When looking where this 'Qac_private.res' is defined, I found it to be in the Makefile.

When looking at the end of the Makefile, I see the following:

Code: Select all

Qac_private.res: Qac_private.rc QacApp.rc 
	$(WINDRES) -i Qac_private.rc --input-format=rc -o Qac_private.res -O coff  --include-dir |$
ssigala
Earned some good credits
Earned some good credits
Posts: 109
Joined: Fri Sep 03, 2004 9:30 am
Location: Brescia, Italy

Re: Makefile is 'screwed up' sometimes

Post by ssigala »

GeertVc wrote: Anyone had the same experience?
It reminds me when you don't remember to add the terminating null character to a string, e.g.:

Code: Select all

char buf[128], *s;
s = "some text";
char *p = buf;
while ((*p++ = *s++) != '\0')
    ;
printf("%s\n", buf); // prints some text + garbage
Sandro Sigala - Kynosoft, Brescia
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Re: Makefile is 'screwed up' sometimes

Post by GeertVc »

ssigala wrote:It reminds me when you don't remember to add the terminating null character to a string, e.g.:

Code: Select all

char buf[128], *s;
s = "some text";
char *p = buf;
while ((*p++ = *s++) != '\0')
    ;
printf("%s\n", buf); // prints some text + garbage
@ssigala:

This is not the case with me. I'm (currently) not having such constructions in my code.

Just had the same problem again and 'reparing' the Makefle doesn't help. Whenever you recompile the project, wxDevCpp regenerates again the Makefile and adds same crap at the end of it.
Unfortunately, I can't attach any file to this message, otherwise I would have attached the generated Makefile...

How can I correct this makefile again?

Hope someone can point this out, otherwise it's useless for me to continue with wxDevCpp, I'm afraid. And that would be a pity, cause I like the concept...

Best rgds,

--Geert
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave »

Did you try "rebuild all"? Did you have this problem before you installed the alpha? Could you create a new empty project and add your files back in?
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Post by GeertVc »

daddydave wrote:Did you try "rebuild all"? Did you have this problem before you installed the alpha? Could you create a new empty project and add your files back in?
@daddydave:

1. Yes, I tried a 'Rebuild all'. I tried to repair the Makefile, since I know what has to be in. But when recompiling the project, the Makefile is regenerated again, resulting in recreating the same unreadable characters.

2. I just started with wxDevCpp. I had the problem with release 6.8Beta, then tried 6.7Beta but also there the problem popped up. But I have no experience with older versions.

3. Yes, tried it. Created a new project and added my two .cpp and .h files, together with the .wxform file to the project via the 'Add to project' feature. Didn't copy any other file from the previous project (like, for instance, the _private.h and _private.rc files).
When building (F9), it worked fine again...

Best rgds,

--Geert
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Makefile is 'screwed up' sometimes

Post by GeertVc »

Would like to 'unsolve' this thread, since creating a new empty project is only a workaround, not a solution.

I have this dreadful error too many times, I can hardly believe I'm the only one...

I submitted a bug report about this too, so as long as it's not really solved, I would like to keep this thread alive.

Hope you understand.

Best rgds,

--Geert
In commemoration of my beloved Mother...
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Re: Makefile is 'screwed up' sometimes

Post by GeertVc »

ssigala wrote:It reminds me when you don't remember to add the terminating null character to a string, e.g.:

Code: Select all

char buf[128], *s;
s = "some text";
char *p = buf;
while ((*p++ = *s++) != '\0')
    ;
printf("%s\n", buf); // prints some text + garbage
An update on this one:

I have the impression the phenomenon happens when you write 'mistakes' into your code.
For example:

I have a wxCheckBox variable, named chkboxShortNames. In the init of the dialog box, I give it a label. So, the command is:

Code: Select all

chkboxShortNames->SetLabel( "Show short names" );
However, when I mistakenly type (forgot the 's' of 'chkboxShortNames'):
chkboxShortName->SetLabel( "Show short names" );
then I get problems with the generated Makefile.

Solving the error results again in a problem-less Makefile.

Best rgds,

--Geert

PS: moral of the story => don't write mistakes... ;-)
In commemoration of my beloved Mother...
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave »

Were you getting any compiler errors prior to the build error (is that the same as a linker error?) ?
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina »

What directory did you install wxdevcpp into? Also, did you change the "User's Default Directory" in Tools->Environment Options->Files & Directories?

I'd suggest trying the alpha version (since your current one seems to be screwed up anyway).

-Tony
Everybody's got something to hide except for me and my monkey.
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Post by GeertVc »

daddydave wrote:Were you getting any compiler errors prior to the build error (is that the same as a linker error?) ?
@daddydave:

I reconstructed the problem (not difficult anymore, now I know the mechanism behind it). See one of my earlier posts with the wxCheckBox example.

This is the exact output of the compiler:

Code: Select all

 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\QacDlg.cpp In member function `void QacDlg::CreateGUIControls()': 
76 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\QacDlg.cpp [Warning] passing NULL used for non-pointer converting 1 of `wxArrayString::wxArrayString(int)' 
101 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\QacDlg.cpp `chkboxShortName' undeclared (first use this function) 
  (Each undeclared identifier is reported only once for each function it appears in.) 
 F:\AppData\My Program Data\wxWidgets\wxDevCpp\Qac\Makefile.win [Build Error]  [QacDlg.o] Error 1 
The first warning should be ignored for this problem (already mentioned this one in another thread and it has been answered already over there).

I hope the rest is clear for analyzing?

As you can see, the next complaint is about the non-existing chkboxShortName variable (should be chkboxShortNames). Then I get the message of a corrupted Makefile via a very cryptic description.

But maybe you can try it yourself, if you're willing to do that. Introduce deliberately a similar bug into an application and see what it does.

Best rgds,

--Geert
In commemoration of my beloved Mother...
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Post by GeertVc »

tbreina wrote:What directory did you install wxdevcpp into? Also, did you change the "User's Default Directory" in Tools->Environment Options->Files & Directories?

I'd suggest trying the alpha version (since your current one seems to be screwed up anyway).

-Tony
@tbreina:
  1. I installed wxDevCpp in the following directory:

    D:\WinApps\Programming\wxWidgets\wxDevCpp
  2. I changed indeed the user's default directory. This one is now pointing to the following location:

    F:\AppData\My Program Data\wxWidgets\wxDevCpp\

    Could the spaces in the pathname be a problem maybe?
  3. I will definitely download the alpha version and try out the same. I will also change the user's default path to a path without spaces and see what effect this gives. In fact, I will try this first and come back on it very soon.
Best rgds,

--Geert
In commemoration of my beloved Mother...
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave »

OK, so the real error is `chkboxShortName' undeclared. The talk about makefiles made it sound more exotic. ;)
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Post by GeertVc »

daddydave wrote:OK, so the real error is `chkboxShortName' undeclared. The talk about makefiles made it sound more exotic. ;)
I agree, but why should this screw up the Makefile? That's not clear to me. You agree we have a 'small' problem here, don't you? :-)

Best rgds,

--Geert
In commemoration of my beloved Mother...
GeertVc
Super wx Problem Solver
Super wx Problem Solver
Posts: 273
Joined: Fri Sep 09, 2005 4:42 pm
Location: Belgium

Makefile is sometimes 'screwed up'

Post by GeertVc »

tbreina wrote:What directory did you install wxdevcpp into? Also, did you change the "User's Default Directory" in Tools->Environment Options->Files & Directories?

I'd suggest trying the alpha version (since your current one seems to be screwed up anyway).

-Tony
@tbreina:

Just tried with a user's default directory without spaces (F:\AppData\ProgData\wxWidgets\wxDevCpp). Result is the same: Makefile is corrupted. So, the spaces in the path name are not causing this problem.

I will now switch over to the Alpha version you mentioned.

Best rgds,

--Geert
In commemoration of my beloved Mother...
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave »

GeertVc wrote:
daddydave wrote:OK, so the real error is `chkboxShortName' undeclared. The talk about makefiles made it sound more exotic. ;)
I agree, but why should this screw up the Makefile? That's not clear to me. You agree we have a 'small' problem here, don't you? :-)

Best rgds,

--Geert
Why do you care about the makefile if obviously the incorrect variable name is going to cause a compile error? All the makefile ultimately does is call the compiler and linker. Bottom line is you get a compiler error. And it incidentally cascades into a makefile error, which doesn't matter anyway, since the makefile won't be able to fix the compiler error.

And as you discovered, the makefile is autogenerated each time. When the compiler error was fixed, did the new makefile still prevent your program from compiling? Perhaps I misunderstood that point.
Post Reply