Mechanized Assault & eXploration Reloaded



#1 Nov 26, 2008 12:14 am
shaktazuki Offline
Mitglied
Registered since: Apr 30, 2008
Posts: 123


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 ==========
↑  ↓

#2 Nov 26, 2008 1:46 am
balthasar Offline
Mitglied
Registered since: Nov 15, 2008
Posts: 11


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
↑  ↓

#3 Nov 26, 2008 1:50 am
balthasar Offline
Mitglied
Registered since: Nov 15, 2008
Posts: 11


Subject: Re: problems compiling
By the way, how about replacing the many lines with something like this:

SRC = $(wildcard *.cpp)
↑  ↓

#4 Nov 26, 2008 5:37 am
shaktazuki Offline
Mitglied
Registered since: Apr 30, 2008
Posts: 123


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.
This post has been edited 1 times. Last edit on Nov 26, 2008 5:42 am by shaktazuki. ↑  ↓

#5 Nov 26, 2008 5:29 pm
beko beko Offline
Developer, Administrator
Registered since: Jun 04, 2004
Posts: 2,279


Subject: Re: problems compiling
yeah, that's your ide's fault. It didn't register the new files Undecided
Bernd Kosmahl
"Sir, we are surrounded!" - "Great - we can attack in any direction."
↑  ↓

#6 Nov 28, 2008 4:28 am
shaktazuki Offline
Mitglied
Registered since: Apr 30, 2008
Posts: 123


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.
This post has been edited 2 times. Last edit on Nov 28, 2008 4:34 am by shaktazuki. ↑  ↓

#7 Jan 09, 2009 2:54 pm
balthasar Offline
Mitglied
Registered since: Nov 15, 2008
Posts: 11


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:
File Type Information for: txt  Makefile.txt
Downloads: 932
Filesize: 1.20 KB

↑  ↓

Pages (1): 1


All times are GMT +01:00. Current time: 2:01 am.