NO

Author Topic: PDCurses native static Pelles C build  (Read 3010 times)

arbv

  • Guest
PDCurses native static Pelles C build
« 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.
« Last Edit: February 18, 2014, 05:41:40 pm by arbv »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 761
Re: PDCurses native static Pelles C build
« Reply #1 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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1890
Re: PDCurses native static Pelles C build
« Reply #2 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 ?
May the source be with you

arbv

  • Guest
Re: PDCurses native static Pelles C build
« Reply #3 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.
« Last Edit: February 12, 2014, 05:47:20 pm by arbv »

baba11

  • Guest
Re: PDCurses native static Pelles C build
« Reply #4 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.