Control doesn't execute one of the C functions that I call
Hello All,
I have few C files my project and from my mainwindow.cpp file I'm calling one of the function that is defined in one of the C file, but the control doesn't go into(execute) the function that I'm calling. Could someone please help me in fixing this. Thanks in advance. Following is the code.
in mainwindow.cpp file
Code:
// Other include headers
#ifdef __cplusplus
extern "C"{
#include "c_s.h"
#include "c_s.c"
//Other part of the code
void MainWindow::u_data(void)
{
//other code
m_VT(&pt1);
in c_s.c file
Code:
void m_VT(struct vt_data *out){
//do something
}
Re: Control doesn't execute one of the C functions that I call
I would say that no one ever calls MainWindow::u_data(). Of course, I would need the whole program to know for sure.
Re: Control doesn't execute one of the C functions that I call
General observation on the snippet presented:
- Close the braces around the extern "C" { } block.
- #include is not usually used to pull in implementation code. Move c_s.c to SOURCES in your qmake PRO file and remove the #include.
Apart from that there's little to be said without more information
Re: Control doesn't execute one of the C functions that I call
Thanks very much!! It worked after making changes you suggested and a few more.