Assuming the CMakeLists.txt file you attached to your first message is what you are trying to use, that is incomplete. You seem to be using the CMakeLists.txt provided as a sample with the template_project in the Chrono distribution, yet you are trying to use an additional module in Chrono (namely the vehicle module). As indicated in the comments at the top of that file, you must modify that CMake script to request any additional Chrono modules that you want to use in the call to find_package(Chrono…). In your case, in addition to the “Irrlicht” package, you must also request “Vehicle”.
Look at how various projects are set up in some other public repositories, such as chrono-tutorial<https://github.com/projectchrono/chrono-tutorial> and chrono-projects<https://github.com/projectchrono/chrono-projects>. The projects there (including some that use Chrono::Vehicle) are all set up as “3rd party” projects, using a CMakeLists.txt like the one in template_projects, but modified appropriately. --Radu From: [email protected] <[email protected]> On Behalf Of Angry Penguin Sent: Friday, November 24, 2023 2:21 PM To: ProjectChrono <[email protected]> Subject: [chrono] Re: Unresolved external symbol I've got it to work by adding additional .lib files (_vehicle, _vechicle_irrlicht) under Project Properties -> Linker -> Input -> Additional Dependencies. Can I somehow automate this in CMake to have all of required libraries filled in during generating Project? Best Regards piątek, 24 listopada 2023 o 11:38:44 UTC+1 Angry Penguin napisał(a): Hello, I compiled Chrono from sources and everything went without problems. The .exe demos work. The template project compiles without any problem as well. I wanted to start building my project, so I tried with simple examples. Unfortunately, I can't compile the CityBus demo using CMakeLists from the template, VS gets multiple (54) errors like this: Error LNK2019 unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl chrono::vehicle::GetDataFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?GetDataFile@vehicle@chrono@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@@Z) referenced in function main Error LNK2019 unresolved external symbol "__declspec(dllimport) public: double __cdecl chrono::vehicle::ChVehicle::GetMass(void)const " (__imp_?GetMass@ChVehicle@vehicle@chrono@@QEBANXZ) referenced in function main Error LNK2001 unresolved external symbol "public: virtual bool __cdecl chrono::vehicle::ChInteractiveDriverIRR::HasJoystick(void)const " (?HasJoystick@ChInteractiveDriverIRR@vehicle@chrono@@UEBA_NXZ) What am I doing wrong? What am I missing? Best regards -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/718e2011-d299-409b-b799-dabb19a13f37n%40googlegroups.com<https://groups.google.com/d/msgid/projectchrono/718e2011-d299-409b-b799-dabb19a13f37n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/PH0PR06MB82376E524BBD70460485F588A7B8A%40PH0PR06MB8237.namprd06.prod.outlook.com.
