Answer the question
In order to leave comments, you need to log in
"undefined reference to" when linking, what to do?
I can easily call a function within one function, but when I try to call the same function within another, in the same file, the linker screams. I would like to throw it in Russian or English, but alas, for some reason my linker speaks Ukrainian)
The getMessage () function is defined in another file, I compile this file, after which I add everything through ld.
(if anyone will look at the source code, then
getMessage() is in the task_controll.c file.
And everything that I showed here in the shell.c file)
void test(void){
// getMessage(); // Если здесь этого вызова нет, то все компилит нормально.
return;
}
void shell(void)
{
putLine(t1);
while( 1 ){
putChar('>');
key = 0;
i = 0;
for( int i = 0; i < 255; i++ )
buff[i] = 0;
do{
shellMessageLine = getMessage(); // Этот же вызов здесь работает вполне нормально.
...
ld: Source/shell.o: у функції «test»:
shell.c:(.text+0x40): невизначене посилання «__stack_chk_fail_local»
ld: kernel: прихований символ «__stack_chk_fail_local» не визначено
ld: спроба остаточного компонування зазнала невдачі: помилкове значення
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question