Hello, I'm trying to get gambc40b15 running under Visual Studio 2003. I haven't found Visual studio project files that work with any of the versions of gambit that I have (12-15), so I'm trying to role my own.
I've gotten it to compile and link with no errors, but when I run the executable, I get repeated errors like these:
(peek-char '#<input-output-port #2 (console)>) > *** ERROR -- Error code 11
Has anyone seen this before?
I believe code 11 here is EAGAIN which is the value that a non-blocking socket read should return when there's no data. I think think is and should be happening here, but I don't understand why it's treated as an error.
It appears to me to be a problem with my preprocessor directives s.t. the USE_PUMPS code isn't working.
Here are the preprocessor definitions I'm using (the full build log is at the end).
HAVE_STDIO_H;HAVE_ERRNO_H;_DEBUG;WIN32;_CONSOLE;___SINGLE_HOST
I don't know whether other HAVE+xxx declarations are needed.
I've inserted pragmas that print messages which show that USE_PUMPS is getting defined. (I focused on that because I'm guessing they're relative to the peek.)
I also had to insert the extern "C" declaration in this code from os_tty.c so that GetConsoleWindow would link:
#ifdef USE_WIN32
// Shirley - kludge here to make this work. I don't understand why we're using C++ extern "C" {
HWND WINAPI GetConsoleWindow(void);
} ___HIDDEN BOOL WINAPI console_event_handler ___P((DWORD dwCtrlType), ());
#endif
The the build log is below. I'd very much appreciate any suggestions or directions to try. Thanks, Mark Shirley
----------------------------------------
------- Build started: Project: msc_gsi, Configuration: Debug|Win32 -------
Command Lines
Creating temporary file "c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\Debug\RSP000003.rsp" with contents [ /Od /I ".\lib" /I ".\include" /D "HAVE_STDIO_H" /D "HAVE_ERRNO_H" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "___SINGLE_HOST" /D "_MBCS" /Gm /EHsc /MLd /Fp".\Debug/MSC_GSI.pch" /Fo".\Debug/" /Fd".\Debug/" /W1 /c /ZI /TP ".\lib\setup.c" ".\lib\os_tty.c" ".\lib\os_time.c" ".\lib\os_shell.c" ".\lib\os_io.c" ".\lib\os_files.c" ".\lib\os_dyn.c" ".\lib\os_base.c" ".\lib\os.c" ".\lib\mem.c" ".\lib\main.c" ".\lib\c_intf.c" ".\lib_thread.c" ".\lib_system.c" ".\lib_std.c" ".\lib_repl.c" ".\lib_num.c" ".\lib_nonstd.c" ".\lib_kernel.c" ".\lib_io.c" ".\gsi_gsi_.c" ".\gsi_gsi.c" ".\lib_gambc.c" ".\lib_eval.c" ] Creating command line "cl.exe @"c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\Debug\RSP000003.rsp" /nologo" Creating temporary file "c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\Debug\RSP000004.rsp" with contents [ /OUT:".\Debug/GSI.exe" /INCREMENTAL:NO /DEBUG /PDB:".\Debug/GSI.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ".\Debug_eval.obj" ".\Debug_gambc.obj" ".\Debug_gsi.obj" ".\Debug_gsi_.obj" ".\Debug_io.obj" ".\Debug_kernel.obj" ".\Debug_nonstd.obj" ".\Debug_num.obj" ".\Debug_repl.obj" ".\Debug_std.obj" ".\Debug_system.obj" ".\Debug_thread.obj" ".\Debug\c_intf.obj" ".\Debug\main.obj" ".\Debug\mem.obj" ".\Debug\os.obj" ".\Debug\os_base.obj" ".\Debug\os_dyn.obj" ".\Debug\os_files.obj" ".\Debug\os_io.obj" ".\Debug\os_shell.obj" ".\Debug\os_time.obj" ".\Debug\os_tty.obj" ".\Debug\setup.obj" ] Creating command line "link.exe @"c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\Debug\RSP000004.rsp""
Output Window
Compiling... setup.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_tty.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_time.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_shell.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_io.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_files.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_dyn.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_base.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h mem.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h main.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h c_intf.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h _thread.c _WIN32 is defined! _system.c _WIN32 is defined! _std.c _WIN32 is defined! _repl.c _WIN32 is defined! _num.c _WIN32 is defined! _nonstd.c _WIN32 is defined! _kernel.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h _io.c _WIN32 is defined! c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\lib_io.c(65536) : warning C4049: compiler limit : terminating line number emission Compiler limit for line number is 65535 Generating Code... Compiling... _gsi_.c _WIN32 is defined! _gsi.c _WIN32 is defined! _gambc.c _WIN32 is defined! _eval.c _WIN32 is defined! Generating Code... Linking... Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. "/OUT:.\Debug/GSI.exe" /INCREMENTAL:NO /DEBUG "/PDB:.\Debug/GSI.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ".\Debug_eval.obj" ".\Debug_gambc.obj" ".\Debug_gsi.obj" ".\Debug_gsi_.obj" ".\Debug_io.obj" ".\Debug_kernel.obj" ".\Debug_nonstd.obj" ".\Debug_num.obj" ".\Debug_repl.obj" ".\Debug_std.obj" ".\Debug_system.obj" ".\Debug_thread.obj" ".\Debug\c_intf.obj" ".\Debug\main.obj" ".\Debug\mem.obj" ".\Debug\os.obj" ".\Debug\os_base.obj" ".\Debug\os_dyn.obj" ".\Debug\os_files.obj" ".\Debug\os_io.obj" ".\Debug\os_shell.obj" ".\Debug\os_time.obj" ".\Debug\os_tty.obj" ".\Debug\setup.obj" LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
Results
Build log was saved at "file://c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\Debug\BuildLog.htm" msc_gsi - 0 error(s), 2 warning(s)
Dr. Mark Shirley NASA Ames Research Center MS 269-2 Moffett Field, CA 94035 650 604 3389 Mark.H.Shirley@nasa.gov
Afficher les réponses par date
At 14:18 Uhr -0800 20.12.2005, Mark H. Shirley wrote:
I've gotten it to compile and link with no errors, but when I run the executable, I get repeated errors like these:
(peek-char '#<input-output-port #2 (console)>) > *** ERROR -- Error code 11
a) syntax: what about (peek-char #2) ?
b) would peek-char with an output port work? Maybe you rather wanted (peek-char (current-input-port)).
Christian.
At 02:44 PM 12/20/2005, Christian wrote:
At 14:18 Uhr -0800 20.12.2005, Mark H. Shirley wrote:
I've gotten it to compile and link with no errors, but when I run the executable, I get repeated errors like these:
(peek-char '#<input-output-port #2 (console)>) > *** ERROR -- Error code 11
a) syntax: what about (peek-char #2) ?
b) would peek-char with an output port work? Maybe you rather wanted (peek-char (current-input-port)).
Christian.
Christian, Thank you very much for replying. Sorry for being unclear. Once my gambit executable starts, it opens a console window and then prints the two lines above over and over again. I haven't typed anything. Therefore, I think the peek-char line is part of the error message (e.g., it's showing the current form). Also, it's not my code, but part of, I think, the read-eval-print loop that gsc is running. Thanks, Mark Dr. Mark Shirley NASA Ames Research Center MS 269-2 Moffett Field, CA 94035 650 604 3389 Mark.H.Shirley@nasa.gov
Well I don't know what's the problem with beta 15 compiled with Visual Studio 2003. I just compiled beta 16 with Visual Studio 2003 without any problems. Here are the project files I used.
Just unzip in the main Gambit directory, and then open gambc.sln with Visual Studio 2003.
The problem may be with beta 15 however. I have recently changed quite a few things in the Windows I/O subsystem. Beta 16 should be out soon anyhow.
Marc
On 20-Dec-05, at 5:18 PM, Mark H. Shirley wrote:
Hello, I'm trying to get gambc40b15 running under Visual Studio 2003. I haven't found Visual studio project files that work with any of the versions of gambit that I have (12-15), so I'm trying to role my own.
I've gotten it to compile and link with no errors, but when I run the executable, I get repeated errors like these:
(peek-char '#<input-output-port #2 (console)>) > *** ERROR -- Error code 11
Has anyone seen this before?
I believe code 11 here is EAGAIN which is the value that a non-blocking socket read should return when there's no data. I think think is and should be happening here, but I don't understand why it's treated as an error.
It appears to me to be a problem with my preprocessor directives s.t. the USE_PUMPS code isn't working.
Here are the preprocessor definitions I'm using (the full build log is at the end).
HAVE_STDIO_H;HAVE_ERRNO_H;_DEBUG;WIN32;_CONSOLE;___SINGLE_HOST
I don't know whether other HAVE+xxx declarations are needed.
I've inserted pragmas that print messages which show that USE_PUMPS is getting defined. (I focused on that because I'm guessing they're relative to the peek.)
I also had to insert the extern "C" declaration in this code from os_tty.c so that GetConsoleWindow would link:
#ifdef USE_WIN32 // Shirley - kludge here to make this work. I don't understand
why we're using C++ extern "C" {
HWND WINAPI GetConsoleWindow(void); } ___HIDDEN BOOL WINAPI console_event_handler ___P((DWORD dwCtrlType), ()); #endif
The the build log is below. I'd very much appreciate any suggestions or directions to try. Thanks, Mark Shirley
------- Build started: Project: msc_gsi, Configuration: Debug|Win32
Command Lines
Creating temporary file "c:\Documents and Settings\Mark Sh\Desktop \gambc40b15\Debug\RSP000003.rsp" with contents [ /Od /I ".\lib" /I ".\include" /D "HAVE_STDIO_H" /D "HAVE_ERRNO_H" / D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "___SINGLE_HOST" /D "_MBCS" / Gm /EHsc /MLd /Fp".\Debug/MSC_GSI.pch" /Fo".\Debug/" /Fd".\Debug/" / W1 /c /ZI /TP ".\lib\setup.c" ".\lib\os_tty.c" ".\lib\os_time.c" ".\lib\os_shell.c" ".\lib\os_io.c" ".\lib\os_files.c" ".\lib\os_dyn.c" ".\lib\os_base.c" ".\lib\os.c" ".\lib\mem.c" ".\lib\main.c" ".\lib\c_intf.c" ".\lib_thread.c" ".\lib_system.c" ".\lib_std.c" ".\lib_repl.c" ".\lib_num.c" ".\lib_nonstd.c" ".\lib_kernel.c" ".\lib_io.c" ".\gsi_gsi_.c" ".\gsi_gsi.c" ".\lib_gambc.c" ".\lib_eval.c" ] Creating command line "cl.exe @"c:\Documents and Settings\Mark Sh \Desktop\gambc40b15\Debug\RSP000003.rsp" /nologo" Creating temporary file "c:\Documents and Settings\Mark Sh\Desktop \gambc40b15\Debug\RSP000004.rsp" with contents [ /OUT:".\Debug/GSI.exe" /INCREMENTAL:NO /DEBUG /PDB:".\Debug/ GSI.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ".\Debug_eval.obj" ".\Debug_gambc.obj" ".\Debug_gsi.obj" ".\Debug_gsi_.obj" ".\Debug_io.obj" ".\Debug_kernel.obj" ".\Debug_nonstd.obj" ".\Debug_num.obj" ".\Debug_repl.obj" ".\Debug_std.obj" ".\Debug_system.obj" ".\Debug_thread.obj" ".\Debug\c_intf.obj" ".\Debug\main.obj" ".\Debug\mem.obj" ".\Debug\os.obj" ".\Debug\os_base.obj" ".\Debug\os_dyn.obj" ".\Debug\os_files.obj" ".\Debug\os_io.obj" ".\Debug\os_shell.obj" ".\Debug\os_time.obj" ".\Debug\os_tty.obj" ".\Debug\setup.obj" ] Creating command line "link.exe @"c:\Documents and Settings\Mark Sh \Desktop\gambc40b15\Debug\RSP000004.rsp""
Output Window
Compiling... setup.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_tty.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_time.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_shell.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_io.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_files.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_dyn.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os_base.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h os.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h mem.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h main.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h c_intf.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h _thread.c _WIN32 is defined! _system.c _WIN32 is defined! _std.c _WIN32 is defined! _repl.c _WIN32 is defined! _num.c _WIN32 is defined! _nonstd.c _WIN32 is defined! _kernel.c _WIN32 is defined! defining USE_PUMPS! INCLUDE_errno_h is defined! including errno.h _io.c _WIN32 is defined! c:\Documents and Settings\Mark Sh\Desktop\gambc40b15\lib_io.c (65536) : warning C4049: compiler limit : terminating line number emission Compiler limit for line number is 65535 Generating Code... Compiling... _gsi_.c _WIN32 is defined! _gsi.c _WIN32 is defined! _gambc.c _WIN32 is defined! _eval.c _WIN32 is defined! Generating Code... Linking... Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. "/OUT:.\Debug/GSI.exe" /INCREMENTAL:NO /DEBUG "/PDB:.\Debug/ GSI.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ".\Debug_eval.obj" ".\Debug_gambc.obj" ".\Debug_gsi.obj" ".\Debug_gsi_.obj" ".\Debug_io.obj" ".\Debug_kernel.obj" ".\Debug_nonstd.obj" ".\Debug_num.obj" ".\Debug_repl.obj" ".\Debug_std.obj" ".\Debug_system.obj" ".\Debug_thread.obj" ".\Debug\c_intf.obj" ".\Debug\main.obj" ".\Debug\mem.obj" ".\Debug\os.obj" ".\Debug\os_base.obj" ".\Debug\os_dyn.obj" ".\Debug\os_files.obj" ".\Debug\os_io.obj" ".\Debug\os_shell.obj" ".\Debug\os_time.obj" ".\Debug\os_tty.obj" ".\Debug\setup.obj" LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/ INCREMENTAL:NO' specification
Results
Build log was saved at "file://c:\Documents and Settings\Mark Sh \Desktop\gambc40b15\Debug\BuildLog.htm" msc_gsi - 0 error(s), 2 warning(s)
Dr. Mark Shirley NASA Ames Research Center MS 269-2 Moffett Field, CA 94035 650 604 3389 Mark.H.Shirley@nasa.gov
Gambit-list mailing list Gambit-list@iro.umontreal.ca http://mailman.iro.umontreal.ca/mailman/listinfo/gambit-list
Marc, The sln files didn't work as is, but adding HAVE_STDIO_H;HAVE_ERRNO_H to the preprocessor definitions for the lib project was all that was needed.
I ran through the tests. They basically work. There were minor problems, e.g., the file sizes of error.scm and newdir2/bbb changed, and there's something odd going on with the r4rstest.scm. (I can't get the test to work using the commandline as in tests/makefile.in, but running it by hand works fine.)
Thank you very much to all who sent suggestions. If anyone wants the sln files, let me know, although they're exactly what Marc just sent plus the two preprocessor definitions above added to the lib project.
A final question: has anyone used Gambit as an extension language for another program? Is there an example of building it as a dll or .so and making the call to initialize scheme? (I remember that being pretty easy in version 3, but so much has changed.) - Mark