emd4600 / Spore-ModAPI

A C++ library that allows you to create advanced mods for Spore (user interface, shaders,...)
https://emd4600.github.io/Spore-ModAPI
62 stars 13 forks source link

Unable to compile code accessing players space stage inventory #31

Closed Pacca64 closed 1 year ago

Pacca64 commented 2 years ago

This line, taken straight from the tutorial pages:

auto inventory = SimulatorSpaceGame.GetPlayerInventory();

Causes a linker error: Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol "__declspec(dllimport) unsigned int const Simulator::cSimPlanetHighLOD_addresses::DestroyCity" (__imp_?DestroyCity@cSimPlanetHighLOD_addresses@Simulator@@3IB) referenced in function "public: void __thiscall Simulator::cSimPlanetHighLOD::DestroyCity(class Simulator::cCity *,unsigned int)" (?DestroyCity@cSimPlanetHighLOD@Simulator@@QAEXPAVcCity@2@I@Z) SpaceToolCheat C:\PaccasStuff\SporeCMods\Projects\SpaceToolCheat\SpaceToolCheat\SpaceToolCheat\SporeModAPIBase.lib(SimulatorSpaceGame.obj) 1

This line is the sole cause. Commenting it out fixes the issue, placing it in a blank mod brings it back. Mod compiles just fine without this one line.

emd4600 commented 1 year ago

Fixed now that ModAPI Launcher Kit has automatic DLL updates.