프로그래밍/C
Visual C++ 2010 과 pdcurses 를 이용한 helloworld 예제
Scripter
2014. 1. 15. 08:47
pdcurses 를 컴파일하여 Visual C++ 용 라이브러리 만들기
프롬프트> nmake -f vcwin32.mak
* 테스트용 소스 파일: helloworld.c (http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/helloworld.html 에 있는 ncurses 용 소스에서 인클루드 문의 ncurses.h 를 curses.h 로 변경한 것 뿐임)
/*
* Filename: helloworld.c
*
* Compile: cl /c helloworld.c /I .
* Link: link -nologo helloworld.obj pdcurses.lib user32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib
* Or
* Compile & Link: cl helloworld.c -I . pdcurses.lib user32.lib gdi32.lib shell32.lib comdlg32.lib
*
* Execute: helloworld
*
* Date: 2014. 1. 15.
*/
* Filename: helloworld.c
*
* Compile: cl /c helloworld.c /I .
* Link: link -nologo helloworld.obj pdcurses.lib user32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib
* Or
* Compile & Link: cl helloworld.c -I . pdcurses.lib user32.lib gdi32.lib shell32.lib comdlg32.lib
*
* Execute: helloworld
*
* Date: 2014. 1. 15.
*/
#include <curses.h> /* changed from <ncurses.h> */
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(); /* End curses mode */
return 0;
}
* 실행 결과: