We have a visual design makefile project. We already had to present a solution like this in order to recognize compiler errors. I.e. We have implemented a Perl script to parse the output from GCC and convert it into a form that Visual Studio will understand. If we declare:
int succ = thisRandomFunction(userPointer, 1, 1);
without definition for thisRandomFunction , then we get a linker error:
1> ./program.a(taskqueue.o): In function `TaskQueueAdd': 1> D:\Git\program\taskqueue.c(94,1) : undefined reference to `thisRandomFunction' 1> collect2: ld returned 1 exit status 1> make: *** [program.exe] Error 1
But the visual studio does not really recognize this as a mistake. The Visual Studio C ++ console with the same problem has a linker error:
1> TestUndefinedReference.cpp 1>TestUndefinedReference.obj : error LNK2019: unresolved external symbol "int __cdecl something(int)" ( ?something@ @ YAHH@Z ) referenced in function _main 1>D:\Projects\New folder\TestUndefinedReference\Debug\TestUndefinedReference.exe : fatal error LNK1120: 1 unresolved externals
Using this converter:
sub parseLinkerError { my $str = $_[0]; my $find = "undefined reference to"; my $replace = "error LNK2019: unresolved external symbol"; $str =~ s/$find/$replace/g; return $str }
We can convert this:
1> d:\Git\program/taskqueue.c:94: undefined reference to `thisRandomFunction'
in that
1> D:/Git/eV+/program/taskqueue.c(94,1) error LNK2019: unresolved external symbol `thisRandomFunction'
But this is not enough to deceive the interpreter of the errors of the linker of the visual studio. What are the minimum requirements to view linker errors? Are there any solutions that can work without direct text analysis?
source share