shaktazuki |
Nov 26, 2008 1:14 am |
Subject: problems compiling
I get the following errors - am I missing a file?
Quote:------ Build started: Project: MAXR, Configuration: Debug Win32 ------
Linking...
buildings.obj : error LNK2019: unresolved external symbol "public: int __thiscall cUpgradeCalculator::calcPrice(int,int,int)const " (?calcPrice@cUpgradeCalculator@@QBEHHHH@Z) referenced in function "public: void __thiscall cBuilding::ShowUpgrade(void)" (?ShowUpgrade@cBuilding@@QAEXXZ)
menu.obj : error LNK2001: unresolved external symbol "public: int __thiscall cUpgradeCalculator::calcPrice(int,int,int)const " (?calcPrice@cUpgradeCalculator@@QBEHHHH@Z)
buildings.obj : error LNK2019: unresolved external symbol "public: int __thiscall cUpgradeCalculator::calcIncreaseByUpgrade(int)cons t " (?calcIncreaseByUpgrade@cUpgradeCalculator@@QBEHH@ Z) referenced in function "public: void __thiscall cBuilding::ShowUpgrade(void)" (?ShowUpgrade@cBuilding@@QAEXXZ)
menu.obj : error LNK2001: unresolved external symbol "public: int __thiscall cUpgradeCalculator::calcIncreaseByUpgrade(int)cons t " (?calcIncreaseByUpgrade@cUpgradeCalculator@@QBEHH@ Z)
buildings.obj : error LNK2019: unresolved external symbol "public: static class cUpgradeCalculator & __cdecl cUpgradeCalculator::instance(void)" (?instance@cUpgradeCalculator@@SAAAV1@XZ) referenced in function "public: void __thiscall cBuilding::ShowUpgrade(void)" (?ShowUpgrade@cBuilding@@QAEXXZ)
menu.obj : error LNK2001: unresolved external symbol "public: static class cUpgradeCalculator & __cdecl cUpgradeCalculator::instance(void)" (?instance@cUpgradeCalculator@@SAAAV1@XZ)
menu.obj : error LNK2019: unresolved external symbol "public: int __thiscall cSavegame::load(void)" (?load@cSavegame@@QAEHXZ) referenced in function "void __cdecl RunSPMenu(void)" (?RunSPMenu@@YAXXZ)
menu.obj : error LNK2019: unresolved external symbol "public: __thiscall cSavegame::cSavegame(int)" (?0cSavegame@@QAE@H@Z) referenced in function "void __cdecl RunSPMenu(void)" (?RunSPMenu@@YAXXZ)
server.obj : error LNK2001: unresolved external symbol "public: __thiscall cSavegame::cSavegame(int)" (?0cSavegame@@QAE@H@Z)
menu.obj : error LNK2019: unresolved external symbol "public: int __thiscall cSavegame::save(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?save@cSavegame@@QAEHV?$basic_string@DU?$char_tra its@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl ShowDateiMenu(bool)" (?ShowDateiMenu@@YAH_N@Z)
server.obj : error LNK2001: unresolved external symbol "public: int __thiscall cSavegame::save(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?save@cSavegame@@QAEHV?$basic_string@DU?$char_tra its@D@std@@V?$allocator@D@2@@std@@@Z)
menu.obj : error LNK2019: unresolved external symbol "public: void __thiscall cSavegame::loadHeader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?loadHeader@cSavegame@@QAEXPAV?$basic_string@DU?$ char_traits@D@std@@V?$allocator@D@2@@std@@00@Z) referenced in function "void __cdecl ShowFiles(class cList<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > *,int,int,bool,bool,bool,struct SDL_Rect)" (?ShowFiles@@YAXPAV?$cList@V?$basic_string@DU?$cha r_traits@D@std@@V?$allocator@D@2@@std@@@@HH_N11USD L_Rect@@@Z)
Debug\MAXR.exe : fatal error LNK1120: 7 unresolved externals
Build log was saved at "file://c:\MAX\trunk\Debug\BuildLog.htm"
MAXR - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
balthasar |
Nov 26, 2008 2:46 am |
Subject: Re: problems compiling
It may be because the Makefile has not been updated, you need to include these 2 lines:
SRCS += savegame.cpp
SRCS += upgradecalculator.cpp |
balthasar |
Nov 26, 2008 2:50 am |
Subject: Re: problems compiling
By the way, how about replacing the many lines with something like this:
SRC = $(wildcard *.cpp) |
shaktazuki |
Nov 26, 2008 6:37 am |
Subject: Re: problems compiling
Quote by balthasar:By the way, how about replacing the many lines with something like this:
SRC = $(wildcard *.cpp)
I tried that line; it still doesn't work. I am using MSVC++ 2008; I'm not sure if the changes would be the same.
Wait - I got it. For some reason, those files were not included in the project. |
beko |
Nov 26, 2008 6:29 pm |
Subject: Re: problems compiling
yeah, that's your ide's fault. It didn't register the new files |
shaktazuki |
Nov 28, 2008 5:28 am |
Subject: Re: problems integrating
New problem.
I added MVEPlayer.h and MVEPlayer.c to the project. I copied them to the maxr project directory, where all the other source is. I #included "MVEPlayer.h" in main.cpp. I call MVEPlayer(const char *) from main(). When I compile, I notice that MVEPlayer.c is NOT compiled, and the linker gives me an "unresolved external" error - the unresolved external being MVEPlayer(char const *).
I have tried the same procedure of adding MVEPlayer to a trash project, and it works properly. What's going on with MAXR in VC++ that it acts like the function definition is not there?
Edit: finally found a source.
extern "C"
{
#include "MVEPlayer.h"
}
fixes the problem. |
balthasar |
Jan 09, 2009 3:54 pm |
Subject: Re: problems compiling
Maybe you could replace the Makefile in the subversion repository by my version - then there would be no problems when source files are added or removed. |
Attachments: Makefile.txt (Filesize: 1.20 KB)
|