iProgramMC / NanoShellOS

The NanoShell Operating System 🐢
GNU General Public License v3.0
205 stars 16 forks source link

Compiling apps error #26

Closed cursedUs64-git closed 10 months ago

cursedUs64-git commented 10 months ago

error: call to undeclared function '_I_ReadChar'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

cursedUs64-git commented 10 months ago

I get this error in all the apps i try to compile.

iProgramMC commented 10 months ago

Paste the entire build log.

Also, don't make issues with your ideas, put them into action yourself! (Or wait until I do it)

cursedUs64-git commented 10 months ago

Should i post the log of ALL the apps?

cursedUs64-git commented 10 months ago

Here: for dir in Calc Chess Clock CrtDemo Doom Edit Finder Fireworks GameTest List Minesweeper NesEmu Notepad NyanCat Raycaster StickyNotes Tcc Tiny VBuilder WavePlayer WindowTest WorldMap; do \ make -C $dir; \ done make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Calc' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Calc' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Chess' compiling: src/chess.c src/chess.c:937:2: error: call to undeclared function 'ChessUpdateMoveList'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ChessUpdateMoveList(); ^ 1 error generated. make[1]: [../CommonMakefile:87: build/chess.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Chess' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Clock' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Clock' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/CrtDemo' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/CrtDemo' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Doom' compiling: src/v_video.c src/v_video.c:868:22: error: call to undeclared function 'fabs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!usemouse || fabs(mouse_acceleration - 1) < 0.01) ^ 1 error generated. make[1]: [../CommonMakefile:87: build/v_video.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Doom' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Edit' compiling: src/editor.c src/editor.c:283:6: warning: unused variable 'conheight' [-Wunused-variable] int conheight = GetConsole()->height; ^ src/editor.c:386:33: warning: unused parameter 'c' [-Wunused-parameter] void EditorHandleCharacter(char c) ^ src/editor.c:405:7: error: call to undeclared function '_I_ReadChar'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] c = _I_ReadChar(); ^ 2 warnings and 1 error generated. make[1]: [../CommonMakefile:87: build/editor.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Edit' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Finder' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Finder' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Fireworks' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Fireworks' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/GameTest' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/GameTest' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/List' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/List' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Minesweeper' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Minesweeper' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/NesEmu' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/NesEmu' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Notepad' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Notepad' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/NyanCat' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/NyanCat' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Raycaster' linking: Raycaster.nse build/game.c.o build/main.c.o build/i386.asm.o build/a_sort.c.o build/a_printf.c.o build/a_time.c.o build/a_error.c.o build/a_ver.c.o build/a_assert.c.o build/entry.c.o build/a_string.c.o build/a_video.c.o build/a_math.c.o build/a_cc.c.o build/calls.c.o build/a_env.c.o build/a_mem.c.o build/zstub.c.o build/a_window.c.o build/a_file.c.o build/crt0.asm.o build/math.asm.o build/rescomp.o ld: build/math.asm.o: in function atan2l': ../../crt/src/math.asm:(.text+0x35a): multiple definition ofatan2l'; build/i386.asm.o:src/i386.asm:(.text+0x24): first defined here make[1]: [../CommonMakefile:65: Raycaster.nse] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Raycaster' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/StickyNotes' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/StickyNotes' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Tcc' compiling: src/tccelf.c src/tccelf.c:1639:9: error: call to undeclared function 'getcwd'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] getcwd (wd, sizeof(wd)); ^ src/tccelf.c:1639:9: note: did you mean 'getc'? ../../crt/include/stdio.h:55:5: note: 'getc' declared here int getc(FILE stream); ^ src/tccelf.c:1644:5: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] unlink((char )ptr); ^ src/tccelf.c:2606:5: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] unlink(filename); ^ src/tccelf.c:2598:13: warning: variable 'mode' set but not used [-Wunused-but-set-variable] int fd, mode, file_type; ^ 1 warning and 3 errors generated. make[1]: * [Makefile:64: build/tccelf.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Tcc' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/Tiny' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/Tiny' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/VBuilder' compiling: src/w_main.c src/w_main.c:110:115: error: incompatible function pointer types passing 'void (Window , int, int, int)' (aka 'void (struct WindowStruct , int, int, int)') to parameter of type 'WindowProc' (aka 'void ()(struct WindowStruct , int, long, long)') [-Wincompatible-function-pointer-types] PopupWindowEx(g_pMainWindow, "Select Control", mwr.left + 50, mwr.top + 50, SELECT_CTL_WIDTH, SELECT_CTL_HEIGHT, PrgVbSelectCtlProc, WF_SYSPOPUP | WF_NOMINIMZ, &ctler); ^~~~~~ ../../crt/include/nanoshell/nanoshell.h:84:147: note: passing argument to parameter 'newWindowProc' here void PopupWindowEx(Window pWindow, const char newWindowTitle, int newWindowX, int newWindowY, int newWindowW, int newWindowH, WindowProc newWindowProc, int newFlags, void pData); ^ 1 error generated. make[1]: [../CommonMakefile:87: build/w_main.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/VBuilder' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/WavePlayer' compiling: src/main.c src/main.c:195:51: error: call to undeclared function 'GetFileSize'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] SetScrollBarPos(g_pWindow, C_SEEK_BAR, bAtEnd ? GetFileSize() : g_fileCurrentPlace); ^ src/main.c:188:11: warning: unused variable 'outwrote' [-Wunused-variable] uint32_t outwrote = write(g_soundFD, samples, readSamples * sizeof(int16_t)); ^ 1 warning and 1 error generated. make[1]: *** [../CommonMakefile:87: build/main.c.o] Error 1 make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/WavePlayer' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/WindowTest' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/WindowTest' make[1]: Entering directory '/home/artix/gitclones/NanoShellOS/apps/WorldMap' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/artix/gitclones/NanoShellOS/apps/WorldMap'

cursedUs64-git commented 10 months ago

Disable -Wimplicit-function-declaration?

iProgramMC commented 10 months ago

Well, I've just fixed the root cause :)

Pull again and it should be fixed.