Author Topic: Compiling results in "...built it now?" - but no outputfile is generated...  (Read 5654 times)

Offline cysign

  • Single posting newcomer
  • *
  • Posts: 5
Hi,
I'm using code::blocks für a c-project since a few days.
At one point I got a compiling problem.
There was no code-error but code::blocks asks:

It seems that this project has not been built yet.
Do you want to built it now?

But....that project previously existed.
I compiled it thousands of times...but when I changed
Code
int anzahlmp = 7;
double mpx[7];
double mpy[7];
to
Code
int anzahlmp = 7;
double mpx[anzahlmp];
double mpy[anzahlmp];
That problem occured. I undoed the changes but c::b isn't able to compile the project anymore.

The same issue happened the thirt time right now and the previous times I created a new projectfile and copied all sources into it.
As I like c::b I't like to reslve that problem.

Maybe you should know I'm using GCC with the linkers: m;udev

I enables -Wall. And Build log tells me:
Code
-------------- Build: Debug in j2k_mp ---------------

Linking console executable: bin/Debug/j2k
obj/Debug/fileio.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
obj/Debug/main.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
obj/Debug/sensor.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Build Message:
||=== Build finished: 0 errors, 0 warnings ===|

But there's still no outputfile...
« Last Edit: March 13, 2013, 09:00:52 am by cysign »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Maybe you should know I'm using GCC with the linkers: m;udev

I enables -Wall. And Build log tells me:
-------------- Build: Debug in j2k_mp ---------------

Linking console executable: bin/Debug/j2k
obj/Debug/fileio.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
obj/Debug/main.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
obj/Debug/sensor.o:(.data+0x0): multiple definition of `anzahlmp'
obj/Debug/data2angle.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

0 errors, 0 warnings
 
Build Message:
||=== Build finished: 0 errors, 0 warnings ===|

You obviously have linking errors, that are not recognized by C::B's regexes.
That can happen, if new or unusual compilers/linkers are used.
But the build log clearly states the errors.

By the way, please use code-( or quote-)tags if you post the content of a build-log or source-code. This makes your post much more readable.

Offline cysign

  • Single posting newcomer
  • *
  • Posts: 5
Thanks for your answer.
But I didn't change any linker while this error orrured.

Do you have any idea why my changes effect the linkers?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Though this highlights an actual bug. If the linker reports an error, the build log shouldn't say "0 errors, 0 warnings" afterwards.

Never noticed this before (probably because I rarely have linker errors). Apparently the build log only cares about compiler messages and ignores the linker.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Though this highlights an actual bug. If the linker reports an error, the build log shouldn't say "0 errors, 0 warnings" afterwards.

Never noticed this before (probably because I rarely have linker errors). Apparently the build log only cares about compiler messages and ignores the linker.
There have been changes to how the compiler-plugin counts errors and warnings recently, so it might be fixed.

Or the plugin just do not recognize the errors as errors, because the regexes do not cover them coorectly.
Nevertheless a linking process with a return value, that is not zero, can (should) probably be treated as error or whatever.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
The error appears to be in trunk.

I added a regular expression and it now reports an error in Build Messages.
Edit: I got the regular expression by trial and error; it might not be a good one.
Code
Description:
Linker error (collect2: error: ld returned)
Regular Expression:
(collect2.*):.(ld returned.*)(exit status.*)
1
2
3
0
0

The string I got on my error.
Code
collect2: error: ld returned 1 exit status

A second regular expression that works for me; this one might be better than the prior one.
Code
(collect2).*:.(error).*:.(ld returned.*)

« Last Edit: March 25, 2013, 04:03:56 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ouch

  • Almost regular
  • **
  • Posts: 223
I noticed when right click building with the trunk of codeblocks on win 7, the popup box that shows up at the end of completion always displays an error code of 0 even if an error occurred.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
I noticed when right click building with the trunk of codeblocks on win 7, the popup box that shows up at the end of completion always displays an error code of 0 even if an error occurred.

What pop-up box are you talking about?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org