dbl instead of double
I am using a function written by someone else, that I am trying to use myself. It doesnt run successfully with the GCC compiler, but I think the issues are solveable - with a little help:
I have a file called mat.c that is included in my project it has a load of lines like this in it
extern void vectorfprint(fd, n, x) ; //ベクトル x の出力
about 20 of them.
the function i am using calls this line
vectorfprint(fd, nvar, simp[i]);
however it states that it is an undefined reference to vectorfprint although mat.c is included in the project. How do i define it?
Maybe he had used a macro
Originally Posted by a.mlw.walker
#define dbl double
...try adding it...
EDIT:that made me think its a macro...but he edited the entire post....
If manually replacing didn't work, what makes you think that a macro would ?
Originally Posted by subhash.rao
dbl has never been a standard way of declaring a double.
From what you describe, dbl and alloc() are both non-standard macros in the original code - and dbl is more than just an alias for double. If the code was written by someone else, that person presumably had some files (a header, definitely, an associated source file, maybe) that are required for those macros to work.
Do a search through all the files from this "someone else" to find out what dbl and alloc() really are. If that fails, something is missing from the files you have been given, and you will probably need to contact that "someone else".
Incidentally, although I'm not saying definitively this is the case here, it is not unknown for an unethical programmer to attempt to make themselves indispensable to their employer. Such people use tricks in their code so it is very difficult for someone else to maintain. What you're describing is not completely inconsistent with such behaviour.
h edited the post...check post #2 please...
Originally Posted by manasij7479
Thanks guys yeah it was a macro. But it was very hard to find as the comments are in an eastern asian language so google wasnt putting it very high up the search!