Hi, I would really like to get involved in this project but I keep having trouble compiling the code. Maybe its just my stupidity but please help!
I downloaded "dunelegacy-0.94.tar.gz" extracted, and compiled it under Visual C++ 6.0 and then I got the folowing error messages
--------------------Configuration: Dune Legacy - Win32 Debug--------------------
Compiling...
MapClass.cpp
c:\tocompile\dunelegacy-0.94\mapclass.cpp(22) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(22) : error C2065: 'max' : undeclared identifier
c:\tocompile\dunelegacy-0.94\mapclass.cpp(23) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(32) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(54) : error C2039: 'max' : is not a member of 'std'
and the list goes on........
Am I doing something wrong? I cannot seem to find the std::max() or std::min() functions under the C++ annotations either...... is it a library that I must add or something?
thx
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't use VC6 anymore, since VC7.1 (found in VS.Net 2003) has many advantages and takes cleaner c++ code.
In VC6 you have to do workarounds for common things like templates so I would encourage you to upgrade if you can.
std::min and std::max are defined in the <algorithm> header, but <windows.h> also introduced min and max functions, which can be disabled by setting the
NOMINMAX preprocessor-flag. I don't know if this helps, at least it's worth a try.
hope this helps,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
unfortuantly I cannot afford to download the 94Mb of VC express...........
I live in south africa and I have a 3Gb cap on my ADSL line......pathetic, I know.....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, thanx, but I'm stll having trouble. First I tried to include <algorithm> that didn't work, and <windows.h> didn't work either.
Then I got fed up and installed VS.NET 2003, I checked the version and it was VC7.1, like yours. And suddenly everything seems to be compiling perfectly.
Then with the linking I get the following :
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
DataFile.obj : error LNK2019: unresolved external symbol _IMG_Load_RW referenced in function "void __cdecl loadDataFile(void)" (?loadDataFile@@YAXXZ)
DataFile.obj : error LNK2019: unresolved external symbol _IMG_Load referenced in function "void __cdecl fixDisplayFormat(void)" (?fixDisplayFormat@@YAXXZ)
PlayerClass.obj : error LNK2019: unresolved external symbol "public: static class CommViewClass * __cdecl CommViewClass::getCommViewClass(enum CommViewType)" (?getCommViewClass@CommViewClass@@SAPAV1@W4CommViewType@@@Z) referenced in function "public: void __thiscall PlayerClass::changeRadar(bool)" (?changeRadar@PlayerClass@@QAEX_N@Z)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::draw(void)" (?draw@MessageBox@@QAEXXZ) referenced in function "void __cdecl drawScreen(void)" (?drawScreen@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall CommViewClass::draw(void)" (?draw@CommViewClass@@QAEXXZ) referenced in function "void __cdecl drawScreen(void)" (?drawScreen@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::initialize(void)" (?initialize@MessageBox@@QAEXXZ) referenced in function "void __cdecl do_game(void)" (?do_game@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: __thiscall MessageBox::MessageBox(void)" (??0MessageBox@@QAE@XZ) referenced in function _$E98
StarPortClass.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::addUrgentMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?addUrgentMessage@MessageBox@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __thiscall StarPortClass::doSpecificStuff(void)" (?doSpecificStuff@StarPortClass@@UAEXXZ)
Graphics.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::addMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?addMessage@MessageBox@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "void __cdecl showMessage(char *)" (?showMessage@@YAXPAD@Z)
.\Debug/Dune Legacy.exe : fatal error LNK1120: 9 unresolved externals
Build log was saved at "file://c:\toCompile\dunelegacy-0.94\Debug\BuildLog.htm"
Dune Legacy - 10 error(s), 6 warning(s)
You don't have to download VC express, VC7.1 is sufficient.
As mentioned in the other thread, you're right, the linking step doesn't work at the moment in VC. Perhaps I can fix this until tomorrow, probably there are only missing some files in the project..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I would really like to get involved in this project but I keep having trouble compiling the code. Maybe its just my stupidity but please help!
I downloaded "dunelegacy-0.94.tar.gz" extracted, and compiled it under Visual C++ 6.0 and then I got the folowing error messages
--------------------Configuration: Dune Legacy - Win32 Debug--------------------
Compiling...
MapClass.cpp
c:\tocompile\dunelegacy-0.94\mapclass.cpp(22) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(22) : error C2065: 'max' : undeclared identifier
c:\tocompile\dunelegacy-0.94\mapclass.cpp(23) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(32) : error C2039: 'max' : is not a member of 'std'
c:\tocompile\dunelegacy-0.94\mapclass.cpp(54) : error C2039: 'max' : is not a member of 'std'
and the list goes on........
Am I doing something wrong? I cannot seem to find the std::max() or std::min() functions under the C++ annotations either...... is it a library that I must add or something?
thx
I don't use VC6 anymore, since VC7.1 (found in VS.Net 2003) has many advantages and takes cleaner c++ code.
In VC6 you have to do workarounds for common things like templates so I would encourage you to upgrade if you can.
std::min and std::max are defined in the <algorithm> header, but <windows.h> also introduced min and max functions, which can be disabled by setting the
NOMINMAX preprocessor-flag. I don't know if this helps, at least it's worth a try.
hope this helps,
Martin
Visual Studio 2005 Express Edition (C++) is available for free: http://msdn.microsoft.com/vstudio/express/visualc/
unfortuantly I cannot afford to download the 94Mb of VC express...........
I live in south africa and I have a 3Gb cap on my ADSL line......pathetic, I know.....
Ok, thanx, but I'm stll having trouble. First I tried to include <algorithm> that didn't work, and <windows.h> didn't work either.
Then I got fed up and installed VS.NET 2003, I checked the version and it was VC7.1, like yours. And suddenly everything seems to be compiling perfectly.
Then with the linking I get the following :
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
DataFile.obj : error LNK2019: unresolved external symbol _IMG_Load_RW referenced in function "void __cdecl loadDataFile(void)" (?loadDataFile@@YAXXZ)
DataFile.obj : error LNK2019: unresolved external symbol _IMG_Load referenced in function "void __cdecl fixDisplayFormat(void)" (?fixDisplayFormat@@YAXXZ)
PlayerClass.obj : error LNK2019: unresolved external symbol "public: static class CommViewClass * __cdecl CommViewClass::getCommViewClass(enum CommViewType)" (?getCommViewClass@CommViewClass@@SAPAV1@W4CommViewType@@@Z) referenced in function "public: void __thiscall PlayerClass::changeRadar(bool)" (?changeRadar@PlayerClass@@QAEX_N@Z)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::draw(void)" (?draw@MessageBox@@QAEXXZ) referenced in function "void __cdecl drawScreen(void)" (?drawScreen@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall CommViewClass::draw(void)" (?draw@CommViewClass@@QAEXXZ) referenced in function "void __cdecl drawScreen(void)" (?drawScreen@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::initialize(void)" (?initialize@MessageBox@@QAEXXZ) referenced in function "void __cdecl do_game(void)" (?do_game@@YAXXZ)
sand.obj : error LNK2019: unresolved external symbol "public: __thiscall MessageBox::MessageBox(void)" (??0MessageBox@@QAE@XZ) referenced in function _$E98
StarPortClass.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::addUrgentMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?addUrgentMessage@MessageBox@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __thiscall StarPortClass::doSpecificStuff(void)" (?doSpecificStuff@StarPortClass@@UAEXXZ)
Graphics.obj : error LNK2019: unresolved external symbol "public: void __thiscall MessageBox::addMessage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?addMessage@MessageBox@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "void __cdecl showMessage(char *)" (?showMessage@@YAXPAD@Z)
.\Debug/Dune Legacy.exe : fatal error LNK1120: 9 unresolved externals
Build log was saved at "file://c:\toCompile\dunelegacy-0.94\Debug\BuildLog.htm"
Dune Legacy - 10 error(s), 6 warning(s)
---------------------- Done ----------------------
Rebuild All: 0 succeeded, 1 failed, 0 skipped
Like I said, I would really like to get involved, so please help......
thnx
You don't have to download VC express, VC7.1 is sufficient.
As mentioned in the other thread, you're right, the linking step doesn't work at the moment in VC. Perhaps I can fix this until tomorrow, probably there are only missing some files in the project..
Ok, linking now works. Some files weren't in the project and SDL_image.lib was missing in the linker input.
Just redownload the .tar.gz. and it should work.
I also sent the new project file to dabatla@sourceforge.net-
hth,
Martin
That's awesome of you, Martin! Finally had time to test it again today and it compiles perfectly. :)