News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Compiling results in "...built it now?" - but no outputfile is generated...

Started by cysign, March 12, 2013, 12:51:37 PM

Previous topic - Next topic

cysign

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

int anzahlmp = 7;
double mpx[7];
double mpy[7];

to

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:
-------------- 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...

Jenna

Quote from: cysign on March 12, 2013, 12:51:37 PM
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.

cysign

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?

thomas

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."

Jenna

Quote from: thomas on March 13, 2013, 10:55:12 AM
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.

stahta01

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.

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.

collect2: error: ld returned 1 exit status


A second regular expression that works for me; this one might be better than the prior one.

(collect2).*:.(error).*:.(ld returned.*)


C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ouch

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.

stahta01

Quote from: ouch on March 25, 2013, 11:18:29 AM
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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]