Thanks, That worked for me, althoug I had to do it like this:
#ifdef _LINUX #undef min #undef max #endif or my Windows build wouldn't compile. Well thats one problem solved. Now I have a big error with memoverride.cpp but I belive thats already logged in bugzilla. - Jed On 30/12/06, Bombela <[EMAIL PROTECTED]> wrote:
This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] Hello, The problem is a conflit with valve definition of min/max in public/minmax.h and the definition in stdc++ (file "limits"). Tank for your tip Garry. For resolve it's simple. In file public/stdstring.h of your Source SDK, you can add : #undef min #undef max before : #include <string> The include <string> use <limits> and others files when use stdc++ min/max definition. The compilation with gcc 3.4.6 is now possible. $ gcc-3.4 -dumpversion 3.4.6 $ du -h server_i486.so du: cannot access `server_i486.so': No such file or directory $ time make -j5 -f Makefile [...] ccache g++-3.4 -w -I../dlls/. -I../dlls/../utils... [...] /usr/local/lib/libstdc++.so.6.0.1 /usr/local/lib/gcc/i486-linux-gnu/3.4.1/libgcc_eh.a make[1]: Leaving directory `/media/fast/pdark/code/src/linux_sdk' real 1m23.312s user 2m45.022s sys 0m27.522s $ du -h server_i486.so 14M server_i486.so Coool ;) Bombela (Pssst' : Sorry for my bad english !) Garry Newman a écrit : > -- > [ Picked text/plain from multipart/alternative ] > I came across this about a year ago too. It was a pretty common problem - > not sure why there isn't more info on it (there was back then). > > >From what I remember it's something in stdstring.h. It includes some file > that re-defines min and max in linux. The fix was to just #undef min and > #undef max and then include another file (I think). Wish I could find where > I found out how to fix it. > > garry > > On 12/23/06, Jed <[EMAIL PROTECTED]> wrote: > >> Well after solving all the other problems I've managed to get the >> current HL2MP SDK to start compiling but I've hit an error regarding >> min/max. >> >> I've searched the archives and found mention to it but no definate >> answer on how to fix it. I've looked at the KI list for Linux on the >> SDK but it's really confusing as to what issues are from the old SDK, >> which are just with the new or what remain from both. >> >> So, in short - I'm compiling the current 31st Oct 2006 HL2MP codebase >> with GCC 3.4.6. >> >> Everything is set-up and running as far as a build environment is >> concerned and the compile begins before stopping with this: >> >> /usr/bin/g++34 -w -I../dlls/../game_shared/hl2 -I../dlls/. >> -I../dlls/../public -I../dlls/../public/tier1 -I../dlls/../game_shared >> -I../dlls/../utils/common -I../dlls/../dlls -I../dlls/../../dlls >> -I../dlls/../dlls/hl2_dll -I../dlls/../dlls/hl2mp_dll >> -I../dlls/../game_shared/hl2mp -I../dlls/./episodic -DHL2_EPISODIC >> -DHL2MP -DHL2_DLL -DUSES_SAVERESTORE -DNDEBUG -DGAME_DLL >> -Dsprintf=use_Q_snprintf_instead_of_sprintf -DVECTOR >> -Dstrncpy=use_Q_strncpy_instead -D_snprintf=use_Q_snprintf_instead >> -DPROTECTED_THINGS_ENABLE -mtune=i686 -march=pentium3 -mmmx -O3 >> -fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp >> -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp >> -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca >> -Dstrcmpi=strcasecmp -Usprintf=use_Q_snprintf_instead_of_sprintf >> -Ustrncpy=use_Q_strncpy_instead -UPROTECTED_THINGS_ENABLE -o >> obj/server_i486/dlls/npc_talker.o -c ../dlls/npc_talker.cpp >> In file included from >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory:61, >> >> from >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string:48, >> from ../dlls/../public/stdstring.h:26, >> from ../dlls/ai_playerally.h:18, >> from ../dlls/npc_talker.h:42, >> from ../dlls/npc_talker.cpp:10: >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:292:22: >> macro "max" requires 2 arguments, but only 1 given >> In file included from >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory:61, >> from >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string:48, >> from ../dlls/../public/stdstring.h:26, >> from ../dlls/ai_playerally.h:18, >> from ../dlls/npc_talker.h:42, >> from ../dlls/npc_talker.cpp:10: >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:292: >> >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:295: >> error: expected `;' before "static" >> /usr/lib/gcc/i386-redhat-linux >> /3.4.6/../../../../include/c++/3.4.6/limits:320:23: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:320: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:323: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:373:23: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:373: >> error: expected `;' before "throw" >> /usr/lib/gcc/i386-redhat- >> linux/3.4.6/../../../../include/c++/3.4.6/limits:376: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:423:30: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:423: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:426: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:473:32: >> macro "max" requires 2 arguments, but only 1 given >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:473: >> >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:476: >> error: expected `;' before "static" >> /usr/lib/gcc/i386-redhat-linux >> /3.4.6/../../../../include/c++/3.4.6/limits:523:26: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:523: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:526: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:573:24: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:573: >> error: expected `;' before "throw" >> /usr/lib/gcc/i386-redhat- >> linux/3.4.6/../../../../include/c++/3.4.6/limits:576: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:623:33: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:623: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:626: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:673:22: >> macro "max" requires 2 arguments, but only 1 given >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:673: >> >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:676: >> error: expected `;' before "static" >> /usr/lib/gcc/i386-redhat-linux >> /3.4.6/../../../../include/c++/3.4.6/limits:723:31: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:723: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:726: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:773:23: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:773: >> error: expected `;' before "throw" >> /usr/lib/gcc/i386-redhat- >> linux/3.4.6/../../../../include/c++/3.4.6/limits:776: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:823:32: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:823: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:826: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:873:28: >> macro "max" requires 2 arguments, but only 1 given >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:873: >> >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:876: >> error: expected `;' before "static" >> /usr/lib/gcc/i386-redhat-linux >> /3.4.6/../../../../include/c++/3.4.6/limits:923:37: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:923: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:926: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:973:24: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:973: >> error: expected `;' before "throw" >> /usr/lib/gcc/i386-redhat- >> linux/3.4.6/../../../../include/c++/3.4.6/limits:976: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:1029:25: >> macro "max" requires 2 arguments, but only 1 given >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:1029: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:1032: >> error: expected `;' before "static" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:1085:30: >> macro "max" requires 2 arguments, but only 1 given >> /usr/lib/gcc/i386-redhat- >> linux/3.4.6/../../../../include/c++/3.4.6/limits:1085: >> error: expected `;' before "throw" >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/limits:1088: >> error: expected `;' before "static" >> In file included from >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string:48, >> from ../dlls/../public/stdstring.h:26, >> from ../dlls/ai_playerally.h:18, >> from ../dlls/npc_talker.h:42, >> from ../dlls/npc_talker.cpp:10: >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory:77:62: >> macro "max" requires 2 arguments, but only 1 given >> In file included from >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/string:48, >> from ../dlls/../public/stdstring.h:26, >> from ../dlls/ai_playerally.h:18, >> from ../dlls/npc_talker.h:42, >> from ../dlls/npc_talker.cpp:10: >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory: >> In function `std::pair<_Tp*, ptrdiff_t> >> std::__get_temporary_buffer(ptrdiff_t, _Tp*)': >> >> /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/memory:77: >> error: `max' is not a member of `std::numeric_limits<int>' >> make[1]: *** [obj/server_i486/dlls/npc_talker.o] Error 1 >> make[1]: Leaving directory `/usr/local/src/Source SDK/linux_sdk' >> make: *** [mod] Error 2 >> >> >> I'm sure I can't be the only one with this problem and googling for >> the error message didn't reveal any insights of how to solve it. >> >> Little help? >> >> - Jed >> >> _______________________________________________ >> To unsubscribe, edit your list preferences, or view the list archives, >> please visit: >> http://list.valvesoftware.com/mailman/listinfo/hlcoders >> >> >> > -- > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > -- _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

