|
Chesnokov Yuriy wrote: You can not use C functions in non static MFC application functions
That's very much incorrect.
You're basically making a statement saying "it's impossible to call Win32 API functions from non-static MFC class member functions".
The most common mistake when you get this linker error is that you're not compiling the source file with the definition of the function. It may be declared several times, but the linker could not find the implementation of it.
Which brings us back to Naveen's question: did you include the implementation file in the project? Is it the right file? Is it marked to be excluded from the build?
Chesnokov Yuriy wrote:
SomeDlg.h
static void function()
{
somefunction();
}
This doesn't prove anything. The "function" may not be called so the linker won't bother if it cannot find the implementation of it.
When you provide source code, please put your code snippets inside the <pre></pre> tags.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Are you the one who's down-voting everyone on this thread? If yes, that is not at all nice of you. I can almost say that for sure by looking at the vote weightage. These people here are trying to help you and you respond to them by marking their replies as "unhelpful"?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
Actually, *you* are rubbishing the thread with your ugly votes. Everything looks gray.
If you don't care much about it, what makes you go out of your way to one vote every message on the thread? You have one-voted even those posts where people were discussing among themselves and not talking to you.
Your behavior is very amateurish, and most of all, the thread looks UGLY because of your votes. Not that I care for any low vote where there is no justification or feedback provided on 'why' it was done so.
I need not mention that people providing you with the right answer WILL depend on how well you explain your problem too.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
I don't wanna talk to you no more, you empty headed animal
food trough wiper! I fart in your general direction!
Your mother was a hamster and your father smelt of elderberries!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Rajesh R Subramanian wrote: Are you the one who's down-voting everyone on this thread?
Seems like it.
Regarding the thread I rest my case.
He has not been able to explain his problem properly, he's asking basic questions, making statements that are gravely wrong on the most basic level of the C++ language in a way implying that the rest of us doesn't know what we're talking about.
He doesn't know how to format the code snippets properly.
And on top of that he's down voting the answers he get with a weight that is privileged to a very few on CP.
I consider it rude and he will never get another answer from me.
In my opinion he's disgrace to the MVP status and it should be removed by judging from level of questions and behaviour. I can't imagine how it was awarded.
Why did I send this at all?
Because if the behaviour is unintentional it's a signal to shape up.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Why did I send this at all?
Because if the behaviour is unintentional it's a signal to shape up.
I replied to him for the same very reason, but he's writing back to me asking if I earn money with votes, quoting Monty Python and all. How rude!
I also totally agree on the other things that you mentioned.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
yup, this guy is a child, and all he won here is that I will probably not ever try to help him anymore.
|
|
|
|
|
|
Hey please! Don't accuse me of down-voting your articles. I haven't even read any of them. I usually don't vote on articles and if I do, it is a 5. If I have to low-vote something, I always leave a feedback on why I had to do so.
If I had to low-vote your articles, I could have anonymously done that very well. Instead, I chose to publicly let you know my opinion.
Besides everything, if I had done such a bizarre thing, I have the nerve to accept it. I am not the kind of guy you think I am; you know zero about me.
Chesnokov Yuriy wrote: I can see you're really partial towards high votes on every message sorry If that really hurted you.
I am not sure what that could possibly mean. And thanks, I'm done with you.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
Chesnokov Yuriy wrote: But on every reply there are two choices: 'Was this a good answer to your question? Yes No'
There is a third option of not clicking on anything, if you were unable to explain your problem the right way at the first place.
And if you hadn't known that, YES, the votes considerably degrades the status - which we don't care about. Actually, what is annoying is - someone who is a fellow MVP, keeps on low-voting you, without even explaining the problem properly and the problem has something to do with the very fundamentals of the language.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Have you added file.c to your project?
|
|
|
|
|
don't know who voted us '1', but I countered yours up.
|
|
|
|
|
toxcct wrote: but I countered yours up.
Thanks. I already incremented yours..
|
|
|
|
|
toxcct wrote: don't know who voted us '1',
I know[^]
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Trolls all around. Just squaring off the low-vote.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Thanks
|
|
|
|
|
|
|
I'm not sure if the other answers help, but I think you are missing the extern and extern "C" keyword.
Iain.
# ifdef __cplusplus
extern "C"
{
# endif
extern int somefunc (int a);
# ifdef __cplusplus
}
# endif
#include <other.h>
int somefunc (int a)
{
...
return ...
}
...
#include "other.h"
...
bool CSomeClass::SomeFunc (int b)
{
int c = somefunc (b);
...
}
|
|
|
|
|
|