Обсуждение: Re: C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP) - additional
Hello. Thank you very much for your answer. I found an option "Configuration Properties\C/C++/General/Detect 64-bit Portability Issues". It was set to 'Yes'. I madeit 'No'. Now I don't get these warnings about 'type cast'. The result: 1>Compiling... 1>getstring.c 1>d:\pgsql83\getstring\c_getstring.c(10) : warning C4273: 'Pg_magic_func' : inconsistent dll linkage 1> d:\pgsql83\getstring\c_getstring.c(10) : see previous definition of 'Pg_magic_func' 1>d:\pgsql83\getstring\c_getstring.c(24) : warning C4273: 'pg_finfo_getTimeFromApplication' : inconsistent dll linkage 1> d:\pgsql83\getstring\c_getstring.c(24) : see previous definition of 'pg_finfo_getTimeFromApplication' 1>Compiling manifest to resources... 1>Linking... 1>LINK : D:\pgsql83\c_getstring\Debug\getstring.dll not found or not built by the last incremental link; performing fulllink 1> Creating library D:\pgsql83\getstring\Debug\getstring.lib and object D:\pgsql83\getstring\Debug\getstring.exp 1>Embedding manifest... 1>Build log was saved at "file://d:\pgsql83\getstring\getstring\Debug\BuildLog.htm" 1>c_synctime - 0 error(s), 2 warning(s) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== But the function doesn't work as well.... :( ERROR: invalid memory alloc request size 4294967293
el dorado wrote: > > Hello. > Thank you very much for your answer. > 1>d:\pgsql83\getstring\c_getstring.c(10) : warning C4273: 'Pg_magic_func' : inconsistent dll linkage > 1> d:\pgsql83\getstring\c_getstring.c(10) : see previous definition of 'Pg_magic_func' This should be a big red flag to you. It suggests that you have issues with __declspec(dllimport) and __declspec(dllexport) annotations. It looks like you are using a Microsoft Visual Studio compiler. If you are using Visual Studio 2005 Express Edition you must modify the project's preprocessor definitions to set the WIN32 macro, as 2005 Express Edition does not do so by default. See earlier discussion in the archives from a few months ago. Alternately, modify the definition of the default win32 project to set the right macros, then create a new project. This issue does NOT affect the full version, only the Express edition. It also does not affect 2008 Express Edition. I've just reproduced it on a clean install of Windows and the Express Edition. -- Craig Ringer