Как исправить неразрешенные внешние блоки кода?
Недавно я установил CodeBlocks и Borland C++ в качестве компилятора, чтобы просто создать C-программу. Но когда я начал строить это выдает ошибку.
bcc32.exe -q -IE:\Borland\Include -o"C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.obj" -c "C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.c"
C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.c:
ilink32.exe -q -ap -LE:\Borland\Lib -LE:\Borland\Lib\PSDK c0x32 "C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.obj","C:\Users\thamidu\Documents\Thamidu's Documens\Self Learning\C++\helloc.exe",,,,
Error: Unresolved external '___CRTL_VCL_Init' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_MEM_UseBorMM' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_VCLLIB_Linkage' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__ExceptInit' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'GetModuleHandleA' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__startup' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__GetExceptDLLinfoInternal' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'HeapAlloc' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_SetValue' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_InitThread' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Alloc' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_GetValue' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'GetProcessHeap' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external 'HeapFree' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_ExitThread' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '___CRTL_TLS_Free' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '_printf' referenced from C:\USERS\THAMIDU\DOCUMENTS\THAMIDU'S DOCUMENS\SELF LEARNING\C++\HELLOC.OBJ
Error: Unresolved external '__matherr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__matherrl' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__fmode' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__argv_expand_ptr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__wargv_expand_ptr' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_setargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_exitargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_wsetargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__handle_wexitargv' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__fileinfo' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__setargv__' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__setenvp__' referenced from E:\BORLAND\LIB\C0X32.OBJ
Error: Unresolved external '__turboFloat' referenced from E:\BORLAND\LIB\C0X32.OBJ
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Пожалуйста, как я могу избавиться от этого? Спасибо
1 ответ
Решение
Эти недостающие символы взяты из библиотек компилятора Borland-C++.
Поскольку вы используете Code::Blocks, добавьте их в Link Libraries
Панель параметров сборки вашего проекта (Строка меню-> Параметры проекта-> Настройки компоновщика):
- cw32.lib - однопоточный
- cw32i.lib - однопоточный (динамический)
- cw32mt.lib - многопоточный
- cw32mti.lib - многопоточный (динамический)