ssloy / tinyrenderer

A brief computer graphics / rendering course
https://github.com/ssloy/tinyrenderer/wiki
Other
20.38k stars 1.97k forks source link

LLVM linker error #137

Closed Nerd10000 closed 9 months ago

Nerd10000 commented 10 months ago

I don't know how can I fix this but the error is this : renderer-378788.o : error LNK2019: unresolved external symbol "public: cdecl TGAImage::TGAImage(int,int,int)" (??0TGAImage@@QEAA@HHH@Z) referenced in function main renderer-378788.o : error LNK2019: unresolved external symbol "public: bool cdecl TGAImage::set(int,int,struct TGAColor)" (?set@TGAImage@@QEAA_NHHUTGAColor@@@Z) referenced in function main renderer-378788.o : error LNK2019: unresolved external symbol "public: bool cdecl TGAImage::write_tga_file(char const *,bool)" (?write_tga_file@TGAImage@@QEAA_NPEBD_N@Z) referenced in function main renderer-378788.o : error LNK2019: unresolved external symbol "public: cdecl TGAImage::~TGAImage(void)" (??1TGAImage@@QEAA@XZ) referenced in function main a.exe : fatal error LNK1120: 4 unresolved externals clang++: error: linker command failed with exit code 1120 (use -v to see invocation)

C:\Users\Dragon\Desktop\Fontos Fájlok\Rust\C\renderer>clang++ renderer.cpp renderer.cpp:1:10: error: 'tga.h' file not found with include; use "quotes" instead

include

     ^~~~~~~
     "tga.h"

1 error generated.

C:\Users\Dragon\Desktop\Fontos Fájlok\Rust\C\renderer>clang++ renderer.cpp renderer-cdcff4.o : error LNK2019: unresolved external symbol "public: cdecl TGAImage::TGAImage(int,int,int)" (??0TGAImage@@QEAA@HHH@Z) r@Z) referenced in function main renderer-cdcff4.o : error LNK2019: unresolved external symbol "public: bool cdecl TGAImage::set(int,int,struct TGAColor)" (?set@TGAImage@mage@@QEAA_NHHUTGAColor@@@Z) referenced in function main renderer-cdcff4.o : error LNK2019: unresolved external symbol "public: bool __cdecl TGAImage::write_tga_file(char const *,bool)" (?write_tgte_tga_file@TGAImage@@QEAA_NPEBD_N@Z) referenced in function main renderer-cdcff4.o : error LNK2019: unresolved external symbol "public: __cdecl TGAImage::~TGAImage(void)" (??1TGAImage@@QEAA@XZ) referencedenced in function main a.exe : fatal error LNK1120: 4 unresolved externals clang++: error: linker command failed with exit code 1120 (use -v to see invocation)

C:\Users\Dragon\Desktop\Fontos Fájlok\Rust\C\renderer>clang++ renderer.cpp

C:\Users\Dragon\Desktop\Fontos Fájlok\Rust\C\renderer>a.exe Hell C++ C:\Users\Dragon\Desktop\Fontos Fájlok\Rust\C\renderer>clang++ renderer.cpp renderer-fd737d.o : error LNK2019: unresolved external symbol "public: cdecl TGAImage::TGAImage(int,int,int)" (??0TGAImage@@QEAA@HHH@Z) referenced in function main renderer-fd737d.o : error LNK2019: unresolved external symbol "public: bool cdecl TGAImage::set(int,int,struct TGAColor)" (?set@TGAImage@@QEAA_NHHUTGAColor@@@Z) referenced in function main renderer-fd737d.o : error LNK2019: unresolved external symbol "public: bool __cdecl TGAImage::flip_vertically(void)" (?flip_vertically@TGAImage@@QEAA_NXZ) referenced in function main renderer-fd737d.o : error LNK2019: unresolved external symbol "public: bool cdecl TGAImage::write_tga_file(char const *,bool)" (?write_tga_file@TGAImage@@QEAA_NPEBD_N@Z) referenced in function main renderer-fd737d.o : error LNK2019: unresolved external symbol "public: cdecl TGAImage::~TGAImage(void)" (??1TGAImage@@QEAA@XZ) referenced in function main a.exe : fatal error LNK1120: 5 unresolved externals clang++: error: linker command failed with exit code 1120 (use -v to see invocation)

Nerd10000 commented 10 months ago

Okay thank you .

Nerd10000 commented 9 months ago

Was it fix?

ssloy commented 9 months ago

What is the build setup? Have you used the cmake description of the project?

Nerd10000 commented 9 months ago

I didn't use cmake.

Dmitry V. Sokolov @.***> ezt írta (időpont: 2023. dec. 15., P 7:47):

What is the build setup? Have you used the cmake description of the project?

— Reply to this email directly, view it on GitHub https://github.com/ssloy/tinyrenderer/issues/137#issuecomment-1857363554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW7LXCA5FSEXGF43TEFTQG3YJPW75AVCNFSM6AAAAABAQDCU4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGM3DGNJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

ssloy commented 9 months ago

I'd recommend using it instead of compiling individual c++ files by hand.