T
T
Type Programmer2020-03-01 14:55:47
C++ / C#
Type Programmer, 2020-03-01 14:55:47

"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(); // Этот же вызов здесь работает вполне нормально.
...


The linker screams this:
ld: Source/shell.o: у функції «test»:
shell.c:(.text+0x40): невизначене посилання «__stack_chk_fail_local»
ld: kernel: прихований символ «__stack_chk_fail_local» не визначено
ld: спроба остаточного компонування зазнала невдачі: помилкове значення


In general, the whole program is on github. Only there is no call because of which everything falls:
https://github.com/ASMcoder555/Neo-Operating-System

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2020-03-01
@MegaCraZy6

undefined reference __stack_chk_fail_local
hidden symbol __stack_chk_fail_local not defined final
link attempt failed:
invalid value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question