cancel
Showing results for 
Search instead for 
Did you mean: 

STVD linker error symbol not defined, how to locate the c source line?

FarkasG
Associate

If an symbol not defined, the compiler does not give any error, only the linker.
Unfortunately it cannot say in which c source line is the undefined symbol, only the obj. file name.
The only way is to select/copy and search for the text, which is many steps, and then may give a lot of results if the symbol name appears in comments too.

Other compilers (Microchip, Visual Studio...) goes to the source error line on doubleclick.
Any idea how to go fast to the source line?

4 REPLIES 4
AA1
Senior III

The error "unresolved external" is always a linker error. You don't need the source line, Open the source file and search for the symbol. I don't believe it gives a lot of results. You should search only for whole words.

Check the compilation settings, if the compiler is outputting enough debug or line numbering data to achieve this back-referencing.

You can also use grep or find-in-files to find the usage.

Typically the error is a result of you not having source for the function in your code base and attendant libraries, or that you misspelled the name in your usage of it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User

@FarkasG wrote:

The only way is to select/copy and search for the text, which is many steps, and then may give a lot of results if the symbol name appears in comments too.


As @AA1 said, be sure to set your search for "whole words only". Also make it case-sensitive.

If the name appears widely in comments, maybe that's a hint to choose a better name ... ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Your solution is the original problem. It looks like the correct answer is "No solution".
It will be good if the error window showing up with all occurences in the sources, then an double click goes to them.