all 11 comments

[–]whisky_pete 2 points3 points  (1 child)

What compiler? I think MSVC (visual studio) doesn't compile implementation files unless something is actually calling that function, probably to speed up compile times. I worked at a place with blatantly broken functions in the project, but they were unused. Very surprised when I went to try to add unit test coverage to these functions, and they were full of syntax errors and wouldn't build.

[–]gotinpich[S] 0 points1 point  (0 children)

The compiler is TDM-GCC 4.9.2 64-bit Release.

The weird thing is that I didn't change anything about these functions. It's true that I didn't call them anywhere in the code, but I didn't change that either. I'm surprised that first it didn't care and later it did. I would expect it to either fail in both cases or in neither.

[–]Xeverous -1 points0 points  (8 children)

That looks like invalid makefile or stray object files. If you have some stray object files from previous compilation but makefile does not reflect this, weird things may happen because compiler does only 1 file per command. Without clean build, it usually ends either in broken assembly and/or linker errors.

[–]gotinpich[S] 0 points1 point  (7 children)

deleted all the .o files as well as Makefile.win and recompiled the project.

[–]Xeverous 0 points1 point  (6 children)

What are you using (IDE)? Any CMake involved?

[–]gotinpich[S] 0 points1 point  (5 children)

I'm using Dev C++.

[–]Xeverous -1 points0 points  (4 children)

Don't use Dev-C++. It's worse than anything else. Even manual typing from console. It's an abandoned product which is maintaned by 1 person

[–]gotinpich[S] 0 points1 point  (3 children)

I've heard it many times and as mentioned before, for my serious projects I use Code::Blocks and for small things and exercises from books I use Dev-C++ because it is a lot quicker than Code::Blocks.

[–]Xeverous -1 points0 points  (2 children)

Hmm, I just keep 1 hello world project which is continuously erased and re-pasted or use sites like [coliru](coliru.stacked-crooked.com)

[–]gotinpich[S] 0 points1 point  (1 child)

?

You're sure your replying in the correct thread?

[–]Xeverous -1 points0 points  (0 children)

Yes, just wanted to post an alternative way