Pelles C forum

C language => User contributions => Topic started by: arbv on February 11, 2014, 06:39:46 PM

Title: PDCurses native static Pelles C build
Post by: arbv on February 11, 2014, 06:39:46 PM
I have fully functional static native Pelles C build of PDCurses library for both x86 and x64. The Makefile for the build is in src/poccwin32.mak and largely based on that one for Visual C++.
I've tried to build dynamic libraries too, but build for x64 version is failed. I can't remember message, but it seems like a bug in compiler itself (it was something related to assembly - library does not contain any assembler source).
Static and dynamic builds for VisualStudio included too.

Sometimes call to scanw() can crash your program. In this case switch to the multihreaded runtime in the project options.

Enjoy!

P. S.
PDCurses is a  terminal control library, enabling the construction of text user interface (TUI) applications.
Title: Re: PDCurses native static Pelles C build
Post by: Bitbeisser on February 11, 2014, 09:21:10 PM
Thanks, that looks interesting. Will see that I find some time to take a closer look the coming weekend...

Ralf
Title: Re: PDCurses native static Pelles C build
Post by: TimoVJL on February 12, 2014, 11:43:19 AM
I've tried to build dynamic libraries too, but build for x64 version is failed. I can't remember message, but it seems like a bug in compiler itself (it was something related to assembly - library does not contain any assembler source).
Code: [Select]
../pdcurses/addch.c(353): error #3101: [asm] Invalid argument to 'EXTERN'.
../pdcurses/addch.c(353): error #3152: [asm] Expected ']'.
../pdcurses/addch.c(353): error #3151: [asm] Syntax error.
when C source lines removed
Code: [Select]
addch.asm(531): error #3101: [asm] Invalid argument to 'EXTERN'.
addch.asm(531): error #3152: [asm] Expected ']'.
addch.asm(531): error #3151: [asm] Syntax error.
[extern SP]
variable SP in curses.h line 342 -> [extern SP] reserved internal assembler word ? -> bug ?
Title: Re: PDCurses native static Pelles C build
Post by: arbv on February 12, 2014, 05:38:12 PM
variable SP in curses.h line 342 -> [extern SP] reserved internal assembler word ? -> bug ?

Well, I have working static builds for both architectures and working dll for x86, but got this error when tried to build dll for x64.
SP (stack pointer) is a reserved internal word for x86 too, but dll was built without any problems for it.
Well, maybe "bug" is too strong word, but such behavior is at least strange, especially for this extremely portable library, which was tested with many compilers on many architectures (six (!) compilers only for windows).
So, compiler is a tool. I can't get working (x64) build of dll with this compiler.

Anyway, my main aim was to get native Pelles C working static builds of this library to write self contained small programs and share this builds it with everyone who interested.
I've tried to get native dll's just like a bonus and failed on x64. This is not problem, because dynamic libraries built by Visual Studio can be used with Pelles C too.
Title: Re: PDCurses native static Pelles C build
Post by: baba11 on November 10, 2014, 10:34:11 AM
Thanks for this example. It is very generous of you to present such functionality with simple and clear comments. I am sure it will be of great help to those studying C, windows SDK and SQlite database development.  You have also covered printing from the ListView.  A great example.