[PD-dev] comport does not compile on Windows using MSVC or MinGW

Hans-Christoph Steiner hans at eds.org
Tue Nov 22 01:18:36 CET 2005


Almost, but not quite.  There is a minor typo on line 332, (#elif 
instead of #else):


------------------------------------------
#ifdef WIN2000
		   0,
#elif
		   FILE_FLAG_OVERLAPPED,
#endif
------------------------------------------


It should be:

------------------------------------------
#ifdef WIN2000
		   0,
#else
		   FILE_FLAG_OVERLAPPED,
#endif
------------------------------------------

Also, the pragmas are only needed for MSVC, not MinGW, so this change 
helps that:


------------------------------------------
#ifdef NT
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
#include <windows.h>
#include <commctrl.h>
#else
------------------------------------------

becomes:

------------------------------------------
#ifdef _MSC_VER
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
#endif

#ifdef NT
#include <windows.h>
#include <commctrl.h>
#else
------------------------------------------



There are still some warnings, don't know if they are important:

------------------------------------------
$ make
gcc -mms-bitfields -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused 
-Wno-parentheses -Wno-switch -O3 -march=i686 -mfpmath=sse -msse -DPD 
-DNT -D'drand48()=((double)rand()/RAND_MAX)' -D'srand48(n)=srand((n))' 
-D'O_NONBLOCK=1'  -I. -I.. -I../../../pd/src -I/usr/local/include \
  -o "comport.o" -c "../src/comport.c"
In file included from ../src/comport.c:1:
../src/../../iem/comport/comport/comport.c:13: warning: ignoring #pragma 
warning
../src/../../iem/comport/comport/comport.c:14: warning: ignoring #pragma 
warning
In file included from ../src/comport.c:1:
../src/../../iem/comport/comport/comport.c: In function `write_serial':
../src/../../iem/comport/comport/comport.c:447: warning: missing initializer
../src/../../iem/comport/comport/comport.c:447: warning: (near 
initialization for `osWrite.InternalHigh')
gcc -shared -L/usr/local/lib -L../../../pd/bin -lpd -o "comport.dll" 
"comport.o" \
         `test -f comport.libs && cat comport.libs` \
         `test -f ../src/comport.libs && cat ../src/comport.libs`
strip --strip-unneeded -R .note -R .comment "comport.dll"
rm "comport.o"




.hc


aoUniv.Prof. DI Winfried Ritsch wrote:
> Hello,
> 
> corrected one wrong bracket, one variable declaration on wrong position
> and changed to C- style comments, 
> 
> and commited to cvs.
> 
> I dont have a Windows now to test the compilation
> but maybe it works now.
> 
> mfg winfried
> 
> 
> Am Dienstag, 15. November 2005 05:45 schrieb Hans-Christoph Steiner:
> 
>>Here's using the included makefile:
>>
>>C:\msys\1.0\home\hans\cvs\pure-data\externals\iem\comport\comport>nmake
>>pd_nt
>>
>>Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
>>Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>>
>>          cl /W3 /WX /DNT /DPD /nologo /DWIN2000 /I.
>>/I"..\..\..\..\pd"\tcl\include /I"..\..\..\..\pd"\src /I"C:\Program
>>Files\Microsoft Visual Studio\Vc98"\include /c comport.c
>>comport.c
>>comport.c(745) : error C2143: syntax error : missing ';' before 'type'
>>comport.c(938) : error C2143: syntax error : missing ';' before 'type'
>>comport.c(939) : error C2065: 'pch' : undeclared identifier
>>comport.c(939) : error C2100: illegal indirection
>>comport.c(940) : error C2100: illegal indirection
>>comport.c(958) : error C2065: 'comport_float' : undeclared identifier
>>NMAKE : fatal error U1077: 'cl' : return code '0x2'
>>Stop.
>>
>>
>>
>>Here's how it looks with MinGW:
>>
>>../iem/comport/comport/comport.c:672: warning: shadowed declaration is
>>here
>>../src/../../iem/comport/comport/comport.c: In function `comport_new':
>>../src/../../iem/comport/comport/comport.c:754: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:756: warning: declaration of
>>'fd' shadows a previous local
>>../src/../../iem/comport/comport/comport.c:674: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c: In function `comport_tick':
>>../src/../../iem/comport/comport/comport.c:804: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:815: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:833: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:847: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:860: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:873: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:886: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:899: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:906: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:922: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/../../iem/comport/comport/comport.c:929: warning: declaration of
>>'x' shadows a parameter
>>../src/../../iem/comport/comport/comport.c:670: warning: shadowed
>>declaration is here
>>../src/comport.c:2: error: syntax error at end of input
>>make: *** [comport.dll] Error 1
>>
>>
>>
>>
>>________________________________________________________________________
>>____
>>
>>"Terrorism is not an enemy.  It cannot be defeated.  It's a tactic.
>>It's about as sensible to say we declare war on night attacks and
>>expect we're going to win that war.  We're not going to win the war on
>>terrorism."
>>                                                                   -
>>retired U.S. Army general, William Odom
>>
>>
>>_______________________________________________
>>PD-dev mailing list
>>PD-dev at iem.at
>>http://lists.puredata.info/listinfo/pd-dev
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev





More information about the Pd-dev mailing list