Menu

building with nocygwin?

Help
2004-04-26
2004-05-02
  • Greg Silverman

    Greg Silverman - 2004-04-26

    Hi,

    I want to build commoncpp in the cygwin environment, but, I want to build for the mingw32 target. Is this possible? I tried several approaches

    1. used "--target=i686-pc-mingw32".
    2. set CXX="g++ -mno-cygwin", CC="gcc -mno-cygwin" before running configure.

    In both cases I could not link the test programs because of

    1. The config files failed to make snprintf a macro for _snprintf.

    2. There were references to pthread functions.

    3. There was an unresolved reference to an instantion of basic_stream::seekpos.

    Anyway, has anyone tried to cross-compile like this? Do you think it could work?

    Greg Silverman
    Northrop Grumman
    San Jose, CA

     
    • Greg Silverman

      Greg Silverman - 2004-04-27

      I was able to cross-build for the mingw environment by

      1. Setting CC=gcc -mno-cygwin, CXX=g++ -mno-cgwin,
          THREAD_FLAGS= -mthreads
      2. Removing -L/usr/lib and -L/lib from the make files. These ld library path values were forcing the linker to use the cygwin libraries.

       
    • Sebastian

      Sebastian - 2004-05-02

      So, what about threading, poll.h, and the likes? I have been trying to get this to work for some hours now, whithout success.

      I have tried compiling commonc++ under cygwin, worked without any problems. Then I copied the libs and includes into the appropriate folders in my Dev-CPP folder. When trying to use the libs, I get errors on missing poll.h, socket.h, errors in config.h on the defines of int-types, missing pthreads, etc.

      So, I can hardly imagine that the above works instantly. Giving it a shot anyway ;-) Maybe I'll get lucky this time...

       
    • Sebastian

      Sebastian - 2004-05-02

      Hmmm, not sure what to do now. I have been lookin into the boost library as well, but have a preference for the GNU common c++ when it comes to usage. Besides that, Boost does not have an integrated socket handling system, which CC++ does have.

      Anyway, I wish there was an easy way to get this to work.

      - I will be running most developed applications on linux, but develop most on windows machines, so I need to be able to compile on windows.
      - For some new projects, I am looking into dev-c++ in combination with MinGW32 as a testing platform.
      - I'd like to be able to (easily) compile apps using CC++ in dev-cpp.

      So, is this possible?

       
    • Sebastian

      Sebastian - 2004-05-02

      Ok, some more work, and finally I have the lib compiled, wow.

      It was indeed as simple as mentioned somewhere else on the board:

      - Import project ccgnu2 into Dev-CPP
      - Add -I../include and -I../w32
      - Fix config.h (#include <stdio.h>, #undef HAVE_OLD_IOSTREAM)

      I then copied the ccgnu2.a file into dev-cpp\lib, all the headers (including the one in w32\cc++) into dev-cpp\include\cc++.

      It finally works.

      I did get some errors when trying to use it in a test-app, which was easy to fix: the compiler complained about redefined types in config.h (commented them out, and now it works): (Line 110)

      //typedef char int8;
      //typedef short int16;
      //typedef long int32;
      //typedef long long int64;

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.