Reputation: 389
I have some troubles in installing this lib. My settings is:
Eclipse Version: Neon.3 Release (4.6.3)
MinGW-w64 - for 32 and 64 bit Windows
I download pdc34dllw.zip and I extracted all into a new Eclipse C/C++ project. So in my project I have:
main.cpp
panel.c
curses.h
pdcurses.dll
pdcurses.lib
Setting Eclipse Project:
GCC C++ Compiler -> Includes -> "${workspace_loc:/${ProjName}}"
GCC C Compiler -> Includes -> "${workspace_loc:/${ProjName}}"
MinGW C++ Linker -> Libraries (-l) -> pdcurses
MinGW C++ Linker -> Libraries search Path (-L) -> "${workspace_loc:/${ProjName}}"
main.cpp content:
#include <iostream>
#include "curses.h"
using namespace std;
int main() {
initscr();
wclear(stdscr);
printw("hello world\n");
wrefresh(stdscr);
system("pause");
endwin();
return(0);
}
Error when i try to compile:
Cannot find -pdcurses
Any suggestions?
Upvotes: 1
Views: 725
Reputation: 389
Ok, after a day I found a solution to my problem. Here we are:
Setting:
Eclipse Version: Neon.3 Release (4.6.3)
MinGW-w64
Solution:
C:\
(or somewhere)cd C:\Pdcurs34
(if you put the extracted dir in C:)cd win32
If you use MinGW write
mingw32-make -f mingwin32.mak WIDE=Y UTF8=Y DLL=Y
Go to Eclipse and create new project
Right click on the project and go to properties
Go to C/C++ Build
on the left menu
Go to Settings
and select Tool Settings
tab
In GCC C++ Compiler
-> Includes
-> Include paths (-l)
put "C:\pdcurs34"
In GCC C Compiler
-> Includes
-> Include paths (-l)
put "C:\pdcurs34"
In MinGW C++ Linker
-> Libraries (-l)
put pdcurses
In MinGW C++ Linker
-> Library search path (-L)
put C:\pdcurs34\win32
Click ok and close project properties
Create main.cpp
Paste the code I write below this list
Build project
You can't use the Eclipse console to see pdcurses output (you can't run your program from Eclipse), so open again Windows Prompt and go into your project directory, then write cd Debug
write cp C:\pdcurs34\win32\pdcurses.dll your_project_directory\Debug
run from the Prompt (or click the project .exe
) your project_name.exe
Everything should be fine. Remember always to have a pdcurses.dll
file inside the Debug
directory of your project.
For me this worked, I hope it will be the same for you.
Sample code for test:
#include <iostream>
#include <curses.h>
using namespace std;
int main(){
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin();
return 0;
}
Upvotes: 1