LINUX

Help
2007-02-11
2013-04-08
  • I cant compile this for linux!!!

    can sendme the library (jwsmtp.a) by mail??

    Tiago_caza@hotmail.com

    thanks

     
    • John Wiggins
      John Wiggins
      2007-02-12

      Can you be more explicit about the difficulties you are having?

       
    • i try compile with your makefile but cygwin say have bugs

      i only need libjwsmtp.a library please can compileit and send me??

      Tiago_caza@hotmail.com

      thanks

       
    • John Wiggins
      John Wiggins
      2007-02-16

      if you did a:
      ./configure
      make
      at the command line and get errors chances are the demo programs are not linking against winsock.
      The static library will probably be already created in <jwsmtp main directory>/jwsmtp/jwsmtp/.libs/libjwsmtp.a

      to get the code to link without errors there are three ways to fix this.
      1. after configure is run edit Makefile in <jwsmtp main directory>/jwsmtp directory
      find line:
      LIBS =
      add -lwsock32 -lws2_32 , e.g.
      LIBS = -lwsock32 -lws2_32
      make again.

      2. or compile all by hand.
      g++ -c jwsmtp/demo1.cpp
      g++ -c jwsmtp/jwsmtp/base64.cpp
      g++ -c jwsmtp/jwsmtp/compat.cpp
      g++ -c jwsmtp/jwsmtp/mailer.cpp
      g++ -o demo1.exe demo1.o compat.o mailer.o base64.o -lwsock32

      3. compile by hand make a library and link against it.
      g++ -c jwsmtp/jwsmtp/base64.cpp
      g++ -c jwsmtp/jwsmtp/compat.cpp
      g++ -c jwsmtp/jwsmtp/mailer.cpp
      ar rcs libjwsmtp.a mailer.o compat.o base64.o
      g++ -o demo1.exe jwsmtp/demo1.cpp libjwsmtp.a -lwsock32

      This presupposes that you are using the command line inside the top level jwstp directory.
      This works for me using MSYS, don't know about cygwin however!

       
    • John Wiggins
      John Wiggins
      2007-02-16

      Much better way:

      LDFLAGS=-lwsock32 ./configure
      make

      This will add the library for networking and should compile the library correctly.

       
    • Please sendme your lib.a i cant compile this!!!!!

      i use -lwsock32 but dont work!

      make[3]: Entering directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsm
      tp/jwsmtp/jwsmtp'
      if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I
      ../..     -g -O2 -MT mailer.lo -MD -MP -MF ".deps/mailer.Tpo" -c -o mailer.lo ma
      iler.cpp; \         then mv -f ".deps/mailer.Tpo" ".deps/mailer.Plo"; else rm -f ".deps/mail
      er.Tpo"; exit 1; fi
      mkdir .libs
      g++ -DHAVE_CONFIG_H -I. -I. -I../.. -g -O2 -MT mailer.lo -MD -MP -MF .deps/mail
      er.Tpo -c mailer.cpp  -DPIC -o .libs/mailer.o
      mailer.cpp: In member function `std::vector<char, std::allocator<char> > jwsmtp:
      :mailer::makesmtpmessage() const':
      mailer.cpp:795: error: 'struct tm' has no member named 'tm_gmtoff'
      make[3]: *** [mailer.lo] Error 1
      make[3]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p/jwsmtp/jwsmtp'
      make[2]: *** [all-recursive] Error 1
      make[2]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p/jwsmtp'
      make[1]: *** [all-recursive] Error 1
      make[1]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p'
      make: *** [all] Error 2

       
    • John Wiggins
      John Wiggins
      2007-02-21

      Look for this in mailer.cpp:

      #ifdef WIN32

              // doesn't allow for daylight savings, too bad I ain't fixin' it.

              // this is the most I will do.

              const int offset(timezone / 60 / 60 * -1); // is in seconds, make hours

      #else

              const int offset( ptm->tm_gmtoff / 60 / 60); // is in seconds, make hours

      #endif

      do this instead:

      //#ifdef WIN32
      //        // doesn't allow for daylight savings, too bad I ain't fixin' it.
      //        // this is the most I will do.
              const int offset(timezone / 60 / 60 * -1); // is in seconds, make hours
      //#else
      //        const int offset( ptm->tm_gmtoff / 60 / 60); // is in seconds, make hours
      //#endif

       
    • sn4k3
      sn4k3
      2007-02-21

      more 1 erro!

      er.Tpo"; exit 1; fi
      g++ -DHAVE_CONFIG_H -I. -I. -I../.. -g -O2 -MT mailer.lo -MD -MP -MF .deps/mail
      er.Tpo -c mailer.cpp  -DPIC -o .libs/mailer.o
      mailer.cpp: In member function `std::vector<char, std::allocator<char> > jwsmtp:
      :mailer::makesmtpmessage() const':
      mailer.cpp:793: error: invalid operands of types `char*()()' and `int' to binary
      `operator/'
      make[3]: *** [mailer.lo] Error 1
      make[3]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p/jwsmtp/jwsmtp'
      make[2]: *** [all-recursive] Error 1
      make[2]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p/jwsmtp'
      make[1]: *** [all-recursive] Error 1
      make[1]: Leaving directory `/cygdrive/e/caza/hl2mod/src/utils/Source_Utils/jwsmt
      p'
      make: *** [all] Error 2

      Line 793 = const int offset(timezone / 60 / 60 * -1); // is in seconds, make hours

       
    • John Wiggins
      John Wiggins
      2007-02-22

      just comment out the whole daylight savings code. from line 793 of mailer.cpp

      //      tzset();

      //#ifdef WIN32

      //        // doesn't allow for daylight savings, too bad I ain't fixin' it.

      //        // this is the most I will do.

      //        const int offset(timezone / 60 / 60 * -1); // is in seconds, make hours

      //#else

      //        const int offset( ptm->tm_gmtoff / 60 / 60); // is in seconds, make hours

      //#endif

      //        if(abs(offset) < 10) {

      //         if(offset < 0)

      //            str << " -0" << abs(offset) << "00" << "\r\n";

      //         else

      //            str << " 0" << abs(offset) << "00" << "\r\n";

      //      }

      //      else {

      //         if(offset < 0)

      //            str << " -" << abs(offset) << "00" << "\r\n";

      //         else

      //            str << " " << abs(offset) << "00" << "\r\n";

      //      }

       
      • sn4k3
        sn4k3
        2007-02-22

        now compiles great ty

        and

              headerline += str.str(); // add the date to the headers
              ret.insert(ret.end(), headerline.begin(), headerline.end());

        is for remove too or for stay?

        i think you can get time using that function i use in my CSS plugin:

        void GetTime(const char *timeformat, const char *var)
        {
            ConVar *plugin_convar = (ConVar *)cvar->FindVar(var);
            if( plugin_convar )
            {
                char date[50];
                time_t td; time(&td);
                strftime(date, 49, timeformat, localtime(&td));
                //timeformat = %d/%m/%Y %H:%M:%S (%Z)
                plugin_convar->SetValue(date);
            }
            else
            {
                Msg("SU: Cvar '%s' Not Exists!\n",var);
            }
        }