[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Cons and Mingw32
From: |
Marcello Pietrobon |
Subject: |
Re: Using Cons and Mingw32 |
Date: |
Thu, 30 Nov 2000 12:31:19 -0600 |
Thank you,
I could get easily to the problem.
The PATH of the gcc/g++ bins was not correct in the Conscript.
By the way, with Mingw32 it is generally better NOT to have GCC_EXEC_PREFIX
set , because it creates interferences with Cygwin.
(see for example
http://www.geocrawler.com/lists/3/SourceForge/6013/0/4741305/).
Thank you
Marcello
Alex Jacques wrote:
> Perhaps your mingw32 g++ installation relies on one of the numerous
> environment variables that can affect it's operation, such as
> GCC_EXEC_PREFIX, COMPILER_PATH, LIBRARY_PATH, C_INCLUDE_PATH or
> CPLUS_INCLUDE_PATH (see gcc manual). I know that I've had problems like
> that with gcc and g++ (more the latter).
>
> One quick trick to see if it's a user environment var problem like that
> (I'm assuming g++ works ok if you invoke it directly from a "DOS Window"
> command line) is to do this:
>
> $CONS = new cons(ENV => {%ENV},
> # all those other cons vars
> );
>
> This drags your entire user environment into the cons environment. Hence
> it's probably not a good long term solution, but is a helpful test. If
> it works then you can narrow down the environment vars you need.
>
> -----Original Message-----
> From: address@hidden [mailto:address@hidden
> Behalf Of Marcello Pietrobon
> Sent: Wednesday, November 29, 2000 7:53 PM
> To: address@hidden
> Subject: Using Cons and Mingw32
>
> Hi,
> I am trying to use cons to compile with g++ of mingw32.
> >From a Dos Box without Cons everything is working fine.
>
> If I use Cons with 'cl' (i.e. Microsoft Visual C++) everything is
> working fine.
> I use something like:
> CCCOM => '%CC %CFLAGS %_IFLAGS /c %< /FR%>:d\\ /Fo%>:d\\ /Fp%>:b.pch
> /Fd%>:d\\
> ',
> LINKCOM => '%LINK %LDFLAGS /pdb:%<:b.pdb %IMPLIB /out:%> %< %_LDIRS
> %LIBS ',
>
> But if I use g++ Cons with g++:
> CCCOM => '%CC %CFLAGS %_IFLAGS -c %<',
> CXXCOM => '%CXX %CXXFLAGS %_IFLAGS -c %<',
> then I have the following interpretation error:
> =================
> g++: installation problem, cannot exec `cpp': No such file or directory
> cons.pl: *** [build\hello.o] Error 1
> cons.pl: errors constructing build\hello.o
> =================
>
> >From a Perl shell I can easily do (once the file build\hello.cpp
> exists):
> system('g++ -c build\hello.cpp');
> without any errors.
>
> The cons file is cons-2.2.0 without any changes.
> I append the construct and conscript files.
> As you see, under Win32 (I use WIndows 2000) I have to override all the
> defaults.
> Is the first time I am using g++ with cons. If by chance you can see
> any other
> errors, please tell me.
>
> Thank you
>
> Marcello
>
> ==============================================
> Construct file:
>
> Export qw(CONS BUILD EXPORT);
>
> ##with Microsoft Visual C++
> # $CONS = new cons(
> # ENV => {
> # PATH =>
> "C:\\GNU\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\system32\
> \WBEM;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\PROGRA
> ~1\\MICROS~3\\Common\\msdev98\\BIN;C:\\PROGRA~1\\MICROS~3\\VC98\\BIN;C:\
> \PROGRA~1\\MICROS~3\\Common\\TOOLS\\WINNT;C:\\PROGRA~1\\MICROS~3\\Common
> \\TOOLS",
>
> # INCLUDE =>
> "C:\\PROGRA~1\\MICROS~3\\VC98\\ATL\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98
> \\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\INCLUDE",
>
> # LIB =>
> "C:\\PROGRA~1\\MICROS~3\\VC98\\LIB;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\LI
> B;",
> # },
> # CCCOM => '%CC %CFLAGS %_IFLAGS /c %< /FR%>:d\\ /Fo%>:d\\
> /Fp%>:b.pch
> /Fd%>:d\\ ',
> # LINKCOM => '%LINK %LDFLAGS /pdb:%<:b.pdb %IMPLIB /out:%> %<
> %_LDIRS %LIBS ',
>
> # CC => 'cl',
> # );
>
> ##with Mingw32
> $CONS = new cons(
> CC => 'g++',
> CFLAGS => '',
> #CCCOM => '%CC %CFLAGS %_IFLAGS -c %< -o %>',
> INCDIRPREFIX => '-I',
> CXX => '%CC',
> CXXFLAGS => '%CFLAGS',
> #CXXCOM => '%CXX %CXXFLAGS %_IFLAGS -c %< -o %>',
> LINK => '%CXX',
> LINKCOM => '%LINK %LDFLAGS -o %> %< %_LDIRS %LIBS',
> LINKMODULECOM => '%LD -r -o %> %<',
> LIBDIRPREFIX => '-L',
> AR => 'ar',
> ARFLAGS => 'r',
> ARCOM => "%AR %ARFLAGS %> %<\n%RANLIB %>",
> RANLIB => 'ranlib',
> AS => 'as',
> ASFLAGS => '',
> ASCOM => '%AS %ASFLAGS %< -o %>',
> LD => 'ld',
> LDFLAGS => '',
> PREFLIB => 'lib',
> SUFEXE => '.exe',
> SUFLIB => '.a',
> SUFLIBS => '.so:.a',
> SUFOBJ => '.o',
> #$ENV => { 'PATH' => '/bin:/usr/bin' },
>
> #these are some necessary changes
> #(because g++ doesn't seems to accept -c and -o together, but I will
> check
> better after the main problem has been resolved)
> CCCOM => '%CC %CFLAGS %_IFLAGS -c %<',
> CXXCOM => '%CXX %CXXFLAGS %_IFLAGS -c %<',
>
> ENV => {
> PATH => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\bin',
> INCLUDE => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\include',
> LIB => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\lib',
> },
> );
>
> $BUILD = "build";
> $EXPORT = "export";
> Link $BUILD => ".";
> Build ("$BUILD/Conscript");
> ==========================================================
>
> Conscript file:
>
> #Install $CONS qq(exp), qq(hello.c); # (###)
> Import qw(CONS BUILD EXPORT);
>
> $src = 'hello.cpp';
> $tgt = 'hello.exe';
> Program $CONS $tgt, $src;
> $EXPORT = $BUILD;
> if ($EXPORT ne $BUILD) {
> Install $CONS "#$EXPORT", $tgt;
> }
> $path = "$EXPORT\\$tgt";
> ==========================================================
>
> _______________________________________________
> address@hidden
> http://mail.gnu.org/mailman/listinfo/cons-discuss
> Cons URL: http://www.dsmit.com/cons/
>
> _______________________________________________
> address@hidden
> http://mail.gnu.org/mailman/listinfo/cons-discuss
> Cons URL: http://www.dsmit.com/cons/