|
I have edited the original message, changing a bit the names, I hope it now makes more sense .
EDIT:
Richard MacCutchan wrote: I suspect there may be some part(s) of your code that we are not seeing Over 8k Lines, but I think I have really extracted the relevant parts.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Don't blame MS. It is C/C++.
foo();
Is indeed incompatible with void foo()
The first is implicitly int foo() according to the C language standard!
I'm not sure why a cleanup helped though...
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
megaadam wrote: foo();
Is indeed incompatible with void foo()
The first is implicitly int foo() according to the C language standard!
Note: I believe you, but don't really understand it
I am just calling one function in a place that is declared in another place. That makes a change of type?
I am editing the original question to give another kind of names, not that I just messed it up.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
modified 6-Feb-19 8:49am.
|
|
|
|
|
I have edited the OP...
Which means... your quote would now be...
megaadam wrote: function01();
Is indeed incompatible with void function01()
The first is implicitly int function01() according to the C language standard!
is it still what you say, with the new names in original post?
If yes... I still don't understand it
BTW the project is a Visual C++ Win32 Console with ATL/MFC Support
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
modified 6-Feb-19 8:56am.
|
|
|
|
|
I suggest you try changing the forward declaration:
from: function01(); to: => void function01();
In C++ void func() is different from void func(int i) they are two different function types/signatures that can coexist due to overloading. The return type is also part of of the function type/signature.
What I do not understand how your code could compile at all. I would expect the build to always fail. But maybe there was an object file left over from a previous build with another function signature but same name?
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I always use warning level 4 and warnings==error with my code and a function without a return type would trigger a warning which would cause the compilation to fail.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
the function01() in myApp.cpp is not a declaration... is the call to that function of the subModule
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
edited again to add main
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Quote: // a bit of stuff for the test
function01 ();//line XXX
// not much more
You omitted possibly important stuff.
if it is something like
void foo()
{
function01 ();}
then it is a function call, you are right and the compiler is wrong.
On the other hand, if
function01 (); stays freely outside a function definition then it is interpreted (actually compiled ) as function declaration, therefore megaadam remarks apply and you are wrong.
|
|
|
|
|
Hi Carlo
yes, I forgot to put the "main ()"
just added it in "Edit3".
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I just re-created the code (without any extra)...
inline.h
#pragma once
inline void function01()
{
}
main.h
#pragma once
#include "inline.h"
main.cpp
#include "main.h"
int main()
{
}
function01();
Got two very clear errors:
E0311 cannot overload functions distinguished by return type alone -> inline.h 3
E0260 explicit type is missing ('int' assumed) -> main.cpp 7
The problem is that C++ is not JavaScript... That function01(); is not a function call but a definition (a re-definition)...
Moving it inside main() (or any other method) will fix any problem...
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: #include "main.h"
int main()
{
function01(); // line XXX
}
function01();
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
But darling, your car was blocking the garage.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Sorry, I couldn't see it well. Something was on the road blocking my view...
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
A neo-classic drive-in movie theater.
The best way to improve Windows is run it on a Mac.
The best way to bring a Mac to its knees is to run Windows on it.
~ my brother Jeff
|
|
|
|
|
Is that the first British attempt at a Drive Thru window at a fast food joint?
You might want to check out how the rest of the world does it...
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|
|
Here's a quick one:
One may fail to explore Earth (8)
[EDIT]
The answer is: EXAMINEE (charade)
explore - EXAMINE
EARTH - E
one may fail - EXAMINEE (definition part)
You have just been Sharapova'd.
modified 14-Feb-19 23:41pm.
|
|
|
|
|
Be ready for Tomorrow!!
I have no idea how to start..
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
And the answer is ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Well, you are up again tomorrow - And I'm glad to see I wasn't the only one with absolutely no idea what the solution was ... what was it?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What was the answer?
This space for rent
|
|
|
|
|
He's very quiet isn't he ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
Probably still working on it.
If I suggest SKYGAZER can we move on?
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|
|
Is the right answer - you are up today
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|