袖雾南茶 2020-10-05 21:19 采纳率: 0%
浏览 400

使用acllib库时编译为何错误?

图片说明

错误图片:图片说明

附acllib.h

/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////
//  ACLLib - Advanced C Lab Library
//    Ver 2014-07
//For students' Lab at Zhejiang University
//Created 2008 by Gao Yuan
//Modified 2009 by Cui Liwei
//    2010 by Lan Huidong
//Revised2012 by Li Rui
//  Modified  2014 by Weng Kai for MOOC
////////////////////////////////////////////////////////////////
/*
For Dev C++, these lib files need to be added into linker options. 
Be sure to change the leading folders as your installation.
"C:/Program Files/Dev-Cpp/MinGW32/lib/libwinmm.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libmsimg32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libkernel32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libuser32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libgdi32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libole32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/liboleaut32.a"
"C:/Program Files/Dev-Cpp/MinGW32/lib/libuuid.a" 
*/

#ifndef __ACLLIB_H__
#define __ACLLIB_H__
#ifdef _UNICODE
#undef _UNICODE
#endif
#ifdef UNICODE
#undef UNICODE
#endif
#include <Windows.h>
#define BLACKRGB(0, 0, 0)
#define REDRGB(255, 0, 0)
#define GREENRGB(0, 255, 0)
#define BLUERGB(0, 0, 255)
#define CYANRGB(0, 255, 255)
#define MAGENTARGB(255, 0, 255)
#define YELLOWRGB(255, 255, 0)
#define WHITERGB(255, 255, 255)
#define EMPTY0xffffffff
#define DEFAULT-1
typedef enum
{ 
PEN_STYLE_SOLID,
PEN_STYLE_DASH,/* -------  */
PEN_STYLE_DOT,/* .......  */
PEN_STYLE_DASHDOT,/* _._._._  */
PEN_STYLE_DASHDOTDOT,/* _.._.._  */
PEN_STYLE_NULL
} ACL_Pen_Style;
typedef enum
{
BRUSH_STYLE_SOLID = -1,
BRUSH_STYLE_HORIZONTAL,/* ----- */
BRUSH_STYLE_VERTICAL,/* ||||| */
BRUSH_STYLE_FDIAGONAL,/* \\\\\ */
BRUSH_STYLE_BDIAGONAL,/* ///// */
BRUSH_STYLE_CROSS,/* +++++ */
BRUSH_STYLE_DIAGCROSS,/* xxxxx */
BRUSH_STYLE_NULL
} ACL_Brush_Style;
typedef enum
{
    NO_BUTTON = 0,
    LEFT_BUTTON,
    MIDDLE_BUTTON,
    RIGHT_BUTTON
} ACL_Mouse_Button;
typedef enum 
{
    BUTTON_DOWN,
    BUTTON_DOUBLECLICK,
    BUTTON_UP,
    ROLL_UP,
    ROLL_DOWN,
    MOUSEMOVE
} ACL_Mouse_Event;
typedef enum 
{
KEY_DOWN,
KEY_UP
} ACL_Keyboard_Event;
typedef struct
{
HBITMAP hbitmap;
int width;
int height;
} ACL_Image;
//typedef enum
//{
//TM_NO = 0x00,
//TM_COLOR = 0x01,
//TM_ALPHA = 0x02
//} ACL_TransparentMode;
typedef COLORREF ACL_Color;
typedef int ACL_Sound;
typedef void (*KeyboardEventCallback) (int key,int event);
typedef void (*CharEventCallback) (char c);
typedef void (*MouseEventCallback) (int x, int y, int button, int event);
typedef void (*TimerEventCallback) (int timerID);
// 
int Setup();
void initWindow(const char title[], int left, int top, int width, int height);
void msgBox(const char title[],const char text[],int flag);
void registerKeyboardEvent(KeyboardEventCallback callback);
void registerCharEvent(CharEventCallback callback);
void registerMouseEvent(MouseEventCallback callback);
void registerTimerEvent(TimerEventCallback callback);
void startTimer(int timerID, int timeinterval);
void cancelTimer(int timerID);
// Sound
void loadSound(const char *fileName,ACL_Sound *pSound);
void playSound(ACL_Sound soundID,int repeat);
void stopSound(ACL_Sound soundID);
// Paint
void beginPaint();
void endPaint();
void clearDevice(void);
int getWidth();
int getHeight();
// Pen
void setPenColor(ACL_Color color);
void setPenWidth(int width);
void setPenStyle(ACL_Pen_Style style);
// Brush
void setBrushColor(ACL_Color color);
void setBrushStyle(ACL_Brush_Style style);
// Text
void setTextColor(ACL_Color color);
void setTextBkColor(ACL_Color color);
void setTextSize(int size);
void setTextFont(const char *pFontName);
void paintText(int x, int y, const char *pStr);
void setCaretSize(int w,int h);
void setCaretPos(int x,int y);
void showCaret();
void hideCaret();
// Pixel
void putPixel(int x, int y, ACL_Color color);
ACL_Color getPixel(int x, int y);
// the Point
int getX(void);
int getY(void);
void moveTo(int x, int y);
void moveRel(int dx,int dy);
// Lines and Curves
void arc(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, \
int nXStartArc, int nYStartArc, int nXEndArc, int nYEndArc);
void line(int x0, int y0, int x1, int y1);
void lineTo(int nXEnd, int nYEnd);
void lineRel(int dx, int dy);
void polyBezier(const POINT *lppt,int cPoints);
void polyLine(const POINT *lppt, int cPoints);
// Filled Shapes
void chrod(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, \
int nXRadial1, int nYRadial1, int nXRadial2, int nYRadial2);
void ellipse( int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
void pie(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, \
int nXRadial1, int nYRadial1, int nXRadial2, int nYRadial2);
void polygon(const POINT *lpPoints, int nCount);
void rectangle(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
void roundrect(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, \
int nWidth, int nHeight);
// Image
void loadImage(const char *pImageFileName, ACL_Image *pImage);
void freeImage(ACL_Image *pImage);
void putImage(ACL_Image *pImage, int x, int y);
void putImageScale(ACL_Image *pImage,int x,int y,int width,int height);
void putImageTransparent(ACL_Image *pImage,int x,int y,int width,int height,ACL_Color bkColor);
//void putImageEx(ACL_Image *pImage,int dx,int dy,int dw,int dh, \
//int sx,int sy,int sw,int sh);
//void setTransparentMode(ACL_TransparenetMode);
//void setTransparentColor(ACL_Color);
//void setTransparetnAlpha(int alpha);
void initConsole(void);
#endif

  • 写回答

2条回答 默认 最新

  • threenewbee 2020-10-05 22:07
    关注
    #define BLACKRGB(0, 0, 0)
    #define REDRGB(255, 0, 0)
    #define GREENRGB(0, 255, 0)
    #define BLUERGB(0, 0, 255)
    #define CYANRGB(0, 255, 255)
    #define MAGENTARGB(255, 0, 255)
    #define YELLOWRGB(255, 255, 0)
    #define WHITERGB(255, 255, 255)
    把这里的前后括号全部删除看看
    
    评论

报告相同问题?

悬赏问题

  • ¥15 clousx6整点报时指令怎么写
  • ¥30 远程帮我安装软件及库文件
  • ¥15 关于#自动化#的问题:如何通过电脑控制多相机同步拍照或摄影(相机或者摄影模组数量大于60),并将所有采集的照片或视频以一定编码规则存放至规定电脑文件夹内
  • ¥20 深信服vpn-2050这台设备如何配置才能成功联网?
  • ¥15 Arduino的wifi连接,如何关闭低功耗模式?
  • ¥15 Android studio 无法定位adb是什么问题?
  • ¥15 C#连接不上服务器,
  • ¥15 angular项目错误
  • ¥20 需要帮我远程操控一下,运行一下我的那个代码,我觉得我无能为力了
  • ¥20 有偿:在ubuntu上安装arduino以及其常用库文件。