关于代码无法通过编译的提问

这个代码在DEV C++平台上可以成功编译并运行,为什么我提交给一些oj平台后,告诉我无法通过编译,请大佬看下错误提示,看下怎么修改

图片说明
图片说明

3个回答

OJ中,main函数的写法应遵循如下规范:

int main()
{
  ...............     //其它代码  
  return 0;   //返回
}

如果对您有帮助,请点击采纳答案好吗,谢谢~~

稍微严格一点的oj要求有return 0;不然肯定错

return 0问题,平台的差异

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
此代码无法通过编译此代码无法通过编译
此代码无法通过编译此代码无法通过编译此代码无法通过编译此代码无法通过编译此代码无法通过编译此代码无法通过编译
为什么这段代码无法通过编译?
long m_Color;rnchar p1[15];rnCColorDialog ColorDlgBox(0,0,this);rnif(ColorDlgBox.DoModal()==IDOK)rnrn m_Color=ColorDlgBox.GetColor();rn sprintf(p1,"%ld",m_Color);rn SetDlgItemText(IDC_EDIT1,p1);rnrn用GetDlgItem->SetWindowText(p1);试了,也不行,rn原因就是:rncannot convert parameter 2 from 'char [15]' to 'const unsigned short *'rn可是我查了,SetDlgItemText和SetWindowText明明要的是LPCTSTR型参数,而而我在其它工程中用从来没出错,不同的是我这次做的是ActivX控件而已。rn请问为什么?
下面的代码为什么无法通过编译?
dim word(userpws.text.Length) as byternword = System.Text.Encoding.Default.GetBytes(userpws.text)rndim pass() as byte = System.Security.Cryptography.MD5.ComputeHash(word)rn
代码求助 bool函数编译无法通过
/* Note:Your choice is C IDE */rn#include "stdio.h"rn#include "malloc.h"rn#include "stdlib.h"rnrnstruct Arrrn int * pBase;rn int len;rn int cnt;rn;rnrnvoid init_arr(struct Arr *pArr);rnrnvoid show(struct Arr *pArr);rnrnbool is_Empty(struct Arr * pArr);rnrnvoid main()rnrn struct Arr arr;rn // printf("%d\n",arr.len);rn init_arr(&arr,6);rn // printf("%d\n",arr.len);rn show(&arr);rnrnrnvoid init_arr(struct Arr *pArr,int len)rn //pArr->len=99;rn pArr->pBase=(int *)malloc(sizeof(int)*len);rn if(NULL==pArr->pBase)rn printf("动态分配内存失败!");rn exit(-1);rn elsern pArr->cnt=0;rn pArr->len=len;rn rn return;rnrnrnbool is_Empty(struct Arr *pArr)rn if(pArr->cnt==0)rn return true;rn elsern return false;rn rnrnrnrnvoid show(struct Arr *pArr)rn int i;rn rn if(is_Empty(pArr))rn printf("数组为空");rn rn elsern for(i=0;icnt;i++)rn printf("%d ",pArr->pBase[i]);rn printf("\n");rn rn rn return;rn
求救!一段代码无法通过编译……
template rnclass A rn public:rn struct ASrn int x;rn ;rn AS f();rn;rnrntemplate rnA::AS A::f() rn rnrnint main() rnrnrn
一个windows下无法编译通过的多线程代码
本人在windows下写多线程程序时遇到编译无法通过问题,但又找不到问题所在,敬请各位指教!rnrn源代码:rn#include "winsock2.h"rn#include rn#include rn#include rn#include rnrnusing namespace std;rnrnrnclass ThreadInfornrnpublic:rn //typedef int (__stdcall *THREAD_FUNC)(ThreadInfo *);rn typedef int (*THREAD_FUNC)(ThreadInfo *);rnrn ThreadInfo()rn rn active = false;rn id = 0;rn func = NULL;rn data = NULL;rn rnrn// void lock() threadLock.on();rn// void unlock() threadLock.off();rn bool active;rn int id;rn THREAD_FUNC func;rn void *data;rn// WLock threadLock;rn;rnrnbool startThread(ThreadInfo *info)rnrn info->active = true;rnrnrn //typedef unsigned int (__stdcall *THREAD_FUNC)(void *);rn typedef void (*THREAD_FUNC)(void *);rnrn unsigned long h = _beginthread((THREAD_FUNC)info->func,0,info);rn //unsigned long h = _beginthreadex(NULL,0,(THREAD_FUNC)info->func,info,0,NULL);rn//unsigned long _beginthreadex( void *security, unsigned stack_size, unsigned ( __stdcall *start_address )( void * ), void *arglist, unsigned initflag, unsigned *thrdaddr );rnrn //if (h == 0)rn if (h == (unsigned long)-1)rn return false;rn elsern return true;rnrnrnrnrnvoid print1()rnrn cout<<"111111"<
简单的事件、委托代码无法编译通过
public delegate void NotifyEventHandler(NotifyQuery sender);rnrn public abstract class NotifyQueryrn rn public event NotifyEventHandler NotifyVerifyFaildrn rn [MethodImpl(MethodImplOptions.Synchronized)]rn addrn rn this.NotifyVerifyFaild = (NotifyEventHandler)Delegate.Combine(this.NotifyVerifyFaild, value);rn rn [MethodImpl(MethodImplOptions.Synchronized)]rn removern rn this.NotifyVerifyFaild -= (NotifyEventHandler)Delegate.Remove(this.NotifyVerifyFaild, value);rn rn rn public event NotifyEventHandler PaidToIntermediaryrn rn [MethodImpl(MethodImplOptions.Synchronized)]rn addrn rn this.PaidToIntermediary = (NotifyEventHandler)Delegate.Combine(this.PaidToIntermediary, value);rn rn [MethodImpl(MethodImplOptions.Synchronized)]rn removern rn this.PaidToIntermediary = (NotifyEventHandler)Delegate.Remove(this.PaidToIntermediary, value);rn rn rnrnrn提示错误 9 事件“NotifyQuery.NotifyVerifyFaild”只能出现在 += 或 -= 的左边 rn
驱动编译无法通过
哪位高手赐教一下阿rn我编译了我的VIA驱动的源代码,但是无法通过,找不到makefilernrn./configurernchecking for a BSD-compatible install... /usr/bin/install -crnchecking whether build environment is sane... yesrnchecking for a thread-safe mkdir -p... /bin/mkdir -prnchecking for gawk... gawkrnchecking whether make sets $(MAKE)... yesrnchecking whether to enable maintainer-specific portions of Makefiles... nornchecking build system type... i686-pc-linux-gnurnchecking host system type... i686-pc-linux-gnurnchecking for style of include used by make... GNUrnchecking for gcc... gccrnchecking for C compiler default output file name... a.outrnchecking whether the C compiler works... yesrnchecking whether we are cross compiling... nornchecking for suffix of executables... rnchecking for suffix of object files... ornchecking whether we are using the GNU C compiler... yesrnchecking whether gcc accepts -g... yesrnchecking for gcc option to accept ISO C89... none neededrnchecking dependency style of gcc... gcc3rnchecking for a sed that does not truncate output... /bin/sedrnchecking for grep that handles long lines and -e... /bin/greprnchecking for egrep... /bin/grep -Ernchecking for ld used by gcc... /usr/bin/ldrnchecking if the linker (/usr/bin/ld) is GNU ld... yesrnchecking for /usr/bin/ld option to reload object files... -rrnchecking for BSD-compatible nm... /usr/bin/nm -Brnchecking whether ln -s works... yesrnchecking how to recognise dependent libraries... pass_allrnchecking how to run the C preprocessor... gcc -Ernchecking for ANSI C header files... yesrnchecking for sys/types.h... yesrnchecking for sys/stat.h... yesrnchecking for stdlib.h... yesrnchecking for string.h... yesrnchecking for memory.h... yesrnchecking for strings.h... yesrnchecking for inttypes.h... yesrnchecking for stdint.h... yesrnchecking for unistd.h... yesrnchecking dlfcn.h usability... yesrnchecking dlfcn.h presence... yesrnchecking for dlfcn.h... yesrnchecking for g++... g++rnchecking whether we are using the GNU C++ compiler... yesrnchecking whether g++ accepts -g... yesrnchecking dependency style of g++... gcc3rnchecking how to run the C++ preprocessor... g++ -Ernchecking for g77... g77rnchecking whether we are using the GNU Fortran 77 compiler... yesrnchecking whether g77 accepts -g... yesrnchecking the maximum length of command line arguments... 32768rnchecking command to parse /usr/bin/nm -B output from gcc object... okrnchecking for objdir... .libsrnchecking for ar... arrnchecking for ranlib... ranlibrnchecking for strip... striprnchecking if gcc supports -fno-rtti -fno-exceptions... nornchecking for gcc option to produce PIC... -fPICrnchecking if gcc PIC flag -fPIC works... yesrnchecking if gcc static flag -static works... yesrnchecking if gcc supports -c -o file.o... yesrnchecking whether the gcc linker (/usr/bin/ld) supports shared libraries... yesrnchecking whether -lc should be explicitly linked in... nornchecking dynamic linker characteristics... cat: /etc/ld.so.conf.d/*.conf: No such file or directoryrnGNU/Linux ld.sornchecking how to hardcode library paths into programs... immediaternchecking whether stripping libraries is possible... yesrnchecking if libtool supports shared libraries... yesrnchecking whether to build shared libraries... yesrnchecking whether to build static libraries... nornconfigure: creating libtoolrnappending configuration tag "CXX" to libtoolrnchecking for ld used by g++... /usr/bin/ldrnchecking if the linker (/usr/bin/ld) is GNU ld... yesrnchecking whether the g++ linker (/usr/bin/ld) supports shared libraries... yesrnchecking for g++ option to produce PIC... -fPICrnchecking if g++ PIC flag -fPIC works... yesrnchecking if g++ static flag -static works... yesrnchecking if g++ supports -c -o file.o... yesrnchecking whether the g++ linker (/usr/bin/ld) supports shared libraries... yesrnchecking dynamic linker characteristics... cat: /etc/ld.so.conf.d/*.conf: No such file or directoryrnGNU/Linux ld.sornchecking how to hardcode library paths into programs... immediaternappending configuration tag "F77" to libtoolrnchecking if libtool supports shared libraries... yesrnchecking whether to build shared libraries... yesrnchecking whether to build static libraries... nornchecking for g77 option to produce PIC... -fPICrnchecking if g77 PIC flag -fPIC works... yesrnchecking if g77 static flag -static works... yesrnchecking if g77 supports -c -o file.o... yesrnchecking whether the g77 linker (/usr/bin/ld) supports shared libraries... yesrnchecking dynamic linker characteristics... cat: /etc/ld.so.conf.d/*.conf: No such file or directoryrnGNU/Linux ld.sornchecking how to hardcode library paths into programs... immediaternchecking for gcc... (cached) gccrnchecking whether we are using the GNU C compiler... (cached) yesrnchecking whether gcc accepts -g... (cached) yesrnchecking for gcc option to accept ISO C89... (cached) none neededrnchecking dependency style of gcc... (cached) gcc3rnchecking if RANDR is defined... yesrnchecking if RENDER is defined... yesrnchecking if XF86DRI is defined... yesrnchecking if DPMSExtension is defined... yesrnchecking for pkg-config... /usr/bin/pkg-configrnchecking pkg-config is at least version 0.9.0... yesrnchecking for XORG... configure: error: Package requirements (xorg-server xproto fontsproto randrproto renderproto xextproto x11 xextproto) were not met:rnrnNo package 'fontsproto' foundrnNo package 'randrproto' foundrnNo package 'renderproto' foundrnrnConsider adjusting the PKG_CONFIG_PATH environment variable if yourninstalled software in a non-standard prefix.rnrnAlternatively, you may set the environment variables XORG_CFLAGSrnand XORG_LIBS to avoid the need to call pkg-config.rnSee the pkg-config man page for more details.rn那几个包没有,一直也找不到,我用的是UBUNTU LINUX
编译无法通过
Linking...rnCluster_RelativeGradeView.obj : error LNK2005: "double __cdecl lgam1(double)" (?lgam1@@YANN@Z) already defined in Cluster_RelativeGrade.objrnCluster_RelativeGradeView.obj : error LNK2005: "double __cdecl lgam2(double,double)" (?lgam2@@YANNN@Z) already defined in Cluster_RelativeGrade.objrnCluster_RelativeGradeView.obj : error LNK2005: "double __cdecl lerrf(double)" (?lerrf@@YANN@Z) already defined in Cluster_RelativeGrade.objrnCluster_RelativeGradeView.obj : error LNK2005: "double __cdecl lgass(double,double,double)" (?lgass@@YANNNN@Z) already defined in Cluster_RelativeGrade.objrnRelativeGrade.obj : error LNK2005: "double __cdecl lgam1(double)" (?lgam1@@YANN@Z) already defined in Cluster_RelativeGrade.objrnRelativeGrade.obj : error LNK2005: "double __cdecl lgam2(double,double)" (?lgam2@@YANNN@Z) already defined in Cluster_RelativeGrade.objrnRelativeGrade.obj : error LNK2005: "double __cdecl lerrf(double)" (?lerrf@@YANN@Z) already defined in Cluster_RelativeGrade.objrnRelativeGrade.obj : error LNK2005: "double __cdecl lgass(double,double,double)" (?lgass@@YANNNN@Z) already defined in Cluster_RelativeGrade.objrnDebug/Cluster_RelativeGrade.exe : fatal error LNK1169: one or more multiply defined symbols foundrnError executing link.exe.rn请大侠帮忙!
编译Android4.0无法通过
Ubuntu 10.04rngcc 4.4.3rn编译发现如下的错误:rnrnIn file included from external/zlib/zlib.h:34,rn from external/zlib/zutil.h:22,rn from external/zlib/adler32.c:8:rnexternal/zlib/zconf.h:365:44: error: sys/types.h: No such file or directoryrnIn file included from prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:32,rn from external/zlib/zconf.h:379,rn from external/zlib/zlib.h:34,rn from external/zlib/zutil.h:22,rn from external/zlib/adler32.c:8:rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/sys/cdefs.h:59:27: error: sys/cdefs_elf.h: No such file or directoryrnIn file included from external/zlib/zconf.h:379,rn from external/zlib/zlib.h:34,rn from external/zlib/zutil.h:22,rn from external/zlib/adler32.c:8:rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:34:24: error: sys/select.h: No such file or directoryrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:35:25: error: sys/sysconf.h: No such file or directoryrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:36:30: error: linux/capability.h: No such file or directoryrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:37:22: error: pathconf.h: No such file or directoryrnIn file included from external/zlib/zconf.h:379,rn from external/zlib/zlib.h:34,rn from external/zlib/zutil.h:22,rn from external/zlib/adler32.c:8:rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:54: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fork'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:55: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vfork'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:56: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getpid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gettid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getpgid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:60: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getppid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getpgrp'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:63: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'setsid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:71: error: expected ')' before 'hdrp'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:72: error: expected ')' before 'hdrp'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getuid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:81: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'geteuid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:83: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getgid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:85: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'getegid'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:86: error: expected declaration specifiers or '...' before 'gid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:87: error: expected ';', ',' or ')' before '*' tokenrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:92: error: expected ')' before '*' tokenrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:93: error: expected ')' before '*' tokenrnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:121: error: expected declaration specifiers or '...' before 'uid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:121: error: expected declaration specifiers or '...' before 'gid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:122: error: expected declaration specifiers or '...' before 'uid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:122: error: expected declaration specifiers or '...' before 'gid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:123: error: expected declaration specifiers or '...' before 'uid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:123: error: expected declaration specifiers or '...' before 'gid_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:124: error: expected declaration specifiers or '...' before 'off_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:130: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lseek'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:131: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lseek64'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:133: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'read'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:134: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'write'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:135: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pread'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:136: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pwrite'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:145: error: expected declaration specifiers or '...' before 'off_t'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:186: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tcgetpgrp'rnprebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/unistd.h:187: error: expected declaration specifiers or '...' before 'pid_t'rnIn file included from external/zlib/zutil.h:22,rn from external/zlib/adler32.c:8:rnexternal/zlib/zlib.h:1591: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gzseek'rnexternal/zlib/zlib.h:1592: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gztell'rnexternal/zlib/zlib.h:1593: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gzoffset'rnexternal/zlib/zlib.h:1594: error: expected declaration specifiers or '...' before 'off_t'rnexternal/zlib/zlib.h:1595: error: expected declaration specifiers or '...' before 'off_t'rnIn file included from external/zlib/adler32.c:8:rnexternal/zlib/zutil.h:28:22: error: string.h: No such file or directoryrn
编译无法通过!
我有dx的一小段程序,这段程序肯定是没有任何问题,但编译总是无法通过,请教大家!rnrnDepthComplexity error LNK2019: 无法解析的外部符号 "public: struct D3DXMATRIX __thiscall D3DXMATRIX::operator*(struct D3DXMATRIX const &)const " (??DD3DXMATRIX@@QBE?AU0@ABU0@@Z) ,该符号在函数 "public: virtual void __thiscall CModelViewerCamera::FrameMove(float)" (?FrameMove@CModelViewerCamera@@UAEXM@Z) 中被引用rnrnDepthComplexity fatal error LNK1120: 1 个无法解析的外部命令
虚函数编译无法通过
编译错误:extractsection”: 不是“sdttable”的成员rn请帮我看一下代码,是什么问题造成的。rnrn[code=c]rnclass sectionrnrnpublic:rn virtual void extractsection()rn rn cout<<"section fun"<extractsection();rn rn ;rn section* psection;rn;rnclass sdttable: public tablernrnpublic:rn sdttable()rn rn psection=new sdttable;rn ;rn void extracttable()rn rn psection->extractsection();rn rn ;rn sdttable* psection;rn;rnint _tmain(int argc, _TCHAR* argv[])rnrnrn sdttable* mytable=new sdttable;rn mytable->extracttable();rn return 0;rnrn[/code]
初学者无法通过编译
我是java初学者。今天早上刚装的j2sdk1.4.2,我用的win2000,也配置了系统变量,但编译时出现如下错误。rnjava.lang.NullPointerExceptionrn at java.util.Hashtable.put(compiled Code)rn at java.util.zip.ZipFile.ReadCEN(compiled Code)rn at java.util.zip.ZipFile.(ZipFile.java:61)rn at java.util.zip.ZipFile.(ZipFile.java:71)rn at sun.tools.java.ClassPath.(compiled Code)rn at sun.tools.javac.Main.Compile(compiled Code)rn at sun.tools.javac.Main.main(Main.java:465)rnrn请问是何原因。谢谢。
编译无法通过,为什么?
我用的是j2sdk1.4.2,编译以下代码通不过(javac HelloJava1.java):rn--------------------------------------------------------------rnimport javax.swing.*;rnimport java.awt.*;rnrnpublic class HelloJava1 extends JComponentrnrn public static void main(String[] args)rn rn JFrame f=new JFrame("HelloJava1");rn f.setSize(300,300);rn f.getContentPane().add(new HelloJava1());rn f.setVisible(true);rn rn rn public void paintComponent(Graphics g)rn rn g.drawString("Hello Java!",125,95);rn rnrn-----------------------------------------------------------------rn出错提示为:rnInvalid class file format: C:\j2sdk1.4.2\jre\lib\rt.jar(javax/swing/JComonent.class),wrong version:48,expected 45rnSuperclass javax.swing.JComponent of class HelloJava1 not found
PathFileExistsW无法通过编译
如下代码中,无法编译过关,请问各位大侠是什么原因?感谢各位亲们!rn// ---------------------------------------------------------------------------rnrn#include rn#pragma hdrstoprnrn#include "Unit1.h"rn// ---------------------------------------------------------------------------rn#pragma package(smart_init)rn#pragma resource "*.dfm"rnTForm1 *Form1;rnrn// ---------------------------------------------------------------------------rn__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) rnrnrnBOOL IsValidPEFile(TCHAR* strPathName) rn if (!PathFileExists(strPathName))rn return FALSE;rnrn // 根据 PE 签名判断当前文件是否合法的 PE 文件rn HANDLE hFile = CreateFile(strPathName, GENERIC_READ, FILE_SHARE_READ, NULL,rn OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);rn if (hFile == INVALID_HANDLE_VALUE) rn ShowMessage("Failed To Open File %s !\n" + AnsiString(strPathName));rn return FALSE;rn rnrn HANDLE hMMFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, NULL,rn NULL, NULL);rn if (hMMFile == INVALID_HANDLE_VALUE) rn CloseHandle(hFile);rn return FALSE;rn rnrn LPVOID pvMem = MapViewOfFile(hMMFile, FILE_MAP_READ, NULL, NULL, NULL);rn if (!pvMem) rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 DOS 签名rn if (*(USHORT*) pvMem != IMAGE_DOS_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 NT 签名rn if (*((DWORD*)((PBYTE) pvMem + ((PIMAGE_DOS_HEADER) pvMem)->e_lfanew))rn != IMAGE_NT_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rnrn return TRUE;rnrnrn// ---------------------------------------------------------------------------rnBOOL IsWindowsApp(TCHAR* strPathName) rn if (!PathFileExists(strPathName))rn return FALSE;rnrn // 根据 PE 签名判断当前文件是否合法的 PE 文件rn HANDLE hFile = CreateFile(strPathName, GENERIC_READ, FILE_SHARE_READ, NULL,rn OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);rn if (hFile == INVALID_HANDLE_VALUE) rn ShowMessage("Failed To Open File %s !\n" + AnsiString(strPathName));rn return FALSE;rn rnrn HANDLE hMMFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, NULL,rn NULL, NULL);rn if (hMMFile == INVALID_HANDLE_VALUE) rn CloseHandle(hFile);rn return FALSE;rn rnrn LPVOID pvMem = MapViewOfFile(hMMFile, FILE_MAP_READ, NULL, NULL, NULL);rn if (!pvMem) rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 DOS 签名rn if (*(USHORT*) pvMem != IMAGE_DOS_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 NT 签名rn if (*((DWORD*)((PBYTE) pvMem + ((PIMAGE_DOS_HEADER) pvMem)->e_lfanew))rn != IMAGE_NT_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn LPVOID pvOptionalHeader = (PBYTE) pvMem + ((PIMAGE_DOS_HEADER) pvMem)rn ->e_lfanew +sizeof(DWORD)+sizeof(IMAGE_FILE_HEADER);rnrn IMAGE_OPTIONAL_HEADER ioh;rn CopyMemory(& ioh, pvOptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER));rnrn if (ioh.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rnrn return TRUE;rn rnrn return FALSE;rnrnrnBOOL IsCosoleApp(TCHAR* strPathName) rn if (!PathFileExists(strPathName))rn return FALSE;rnrn // 根据 PE 签名判断当前文件是否合法的 PE 文件rn HANDLE hFile = CreateFile(strPathName, GENERIC_READ, FILE_SHARE_READ, NULL,rn OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);rn if (hFile == INVALID_HANDLE_VALUE) rn ShowMessage("Failed To Open File %s !\n" + AnsiString(strPathName));rn return FALSE;rn rnrn HANDLE hMMFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, NULL,rn NULL, NULL);rn if (hMMFile == INVALID_HANDLE_VALUE) rn CloseHandle(hFile);rn return FALSE;rn rnrn LPVOID pvMem = MapViewOfFile(hMMFile, FILE_MAP_READ, NULL, NULL, NULL);rn if (!pvMem) rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 DOS 签名rn if (*(USHORT*) pvMem != IMAGE_DOS_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn // 是否包含有 NT 签名rn if (*((DWORD*)((PBYTE) pvMem + ((PIMAGE_DOS_HEADER) pvMem)->e_lfanew))rn != IMAGE_NT_SIGNATURE) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rn return FALSE;rn rnrn LPVOID pvOptionalHeader = (PBYTE) pvMem + ((PIMAGE_DOS_HEADER) pvMem)rn ->e_lfanew +sizeof(DWORD)+sizeof(IMAGE_FILE_HEADER);rnrn IMAGE_OPTIONAL_HEADER ioh;rn CopyMemory(& ioh, pvOptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER));rnrn if (ioh.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) rn UnmapViewOfFile(pvMem);rn CloseHandle(hMMFile);rn CloseHandle(hFile);rnrn return TRUE;rn rnrn return FALSE;rnrnrnvoid __fastcall TForm1::Button1Click(TObject *Sender) rn TCHAR* path = L"d:\\abc.exe";rn if (IsWindowsApp(path))rn Label1->Caption = "true";rnrn// ---------------------------------------------------------------------------rnrn编译错误信息:[ilink32 Error] Error: Unresolved external 'PathFileExistsW' referenced from E:\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\UNIT1.OBJrn把最下面的一行if (IsWindowsApp(path)) Label1->Caption = "true";注释掉就可以编译通过,不知道这是什么原因?
vector > 无法通过编译
struct seed_regionrnrn seed_region(const unsigned int a,const unsigned int b):rn start(a),end(b)rnrn unsigned int start;rn unsigned int end; rn;rnrnvector > reads_unmapped;rnrn想要这样一个vector 但是编译不通过,该怎么实现了?
ADS1.2无法通过编译
ADS1.2开发环境下怎么无法编译下面的程序rnrn# include rnrnint main(void)rnrn printf( "hello world.\n ");rn return (0);rnrnrn显示第一行有错误.rn难道ADS1.2下的C和ANSIC不一样吗?rn请高手提示一下.
模板无法通过编译???
我想测试下我的编译器是否支持模板的包含编译,我将模板的声明与定义分开rn但是无法通过编译,下面是代码:rn//median.hrn//定义median函数模板的头文件rn//median函数模板在保存未知类型对象的vector中查找中间值rnrn#ifndef MEDIAN_Hrn#define MEDIAN_Hrnrn#includern#includernrnusing std::vector;rnrnrn//如果vector中有中间值,则返回true,并将中间值记录在第二个参数中rn//否则,返回falsernrntemplate< typename T>rn bool median(const vector&,T&);rnrnrn#include"median.cpp" //引入函数模板的实现文件rnrnrn#endifrnrnrnrn//median.cpprn//定义median函数模板的实现文件rnrntemplate< typename T >rn bool median(const vector& c,T& m) [color=#FF0000]//在‘<’前面缺少‘,’????[/color] rn //构造temp为c的副本rn vector temp(c);rnrn //如果容器中包含偶数个元素,则没有中间值,返回falsern if(temp.size()%2==0)rn return false;rnrn //将元素排序rn sort(temp.begin(),temp.end());rnrn //判断中间点元素是否为中间值,是则返回true,并用m记录中间值rn //否则返回falsern vector::size_type index=temp.size()/2;rn if(temp[index] > temp[index-1]rn && temp[index] < temp[index+1])rn rn m=temp[index];rn return true;rn rn else rn return false;rnrn rnrnrnrn//主程序rnrn#includern#include"Median.h"rnrnrnusing namespace std;rnrnrnint main()rnrn int ia1[]=1,2,3,4,5,6,7;rn int ia2[]=1,2,3,4;rn int ia3[]=1,2,2,3,4,5,6;rnrn vector ivec1(ia1,ia1+7);rn vector ivec2(ia2,ia2+4);rn vector ivec3(ia3,ia3+7);rnrn int m;rnrn if(median(ivec1,m))rn cout<<"median: "<f:\vc++\win32consoleapplication\templatemedian\templatemedian\median.cpp(7) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 intrn1>f:\vc++\win32consoleapplication\templatemedian\templatemedian\median.cpp(7) : error C2143: 语法错误 : 缺少“,”(在“<”的前面)
无法通过编译,帮帮忙
//Hello1.cpprn#define STRICTrn#include rn#include rn#include rnrnconst TCHAR sz_Operation[] = _T("open");rnconst TCHAR sz_Address[] = _T("www.163.com");rnrnint WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR lpCmd, int nShow)rnrn HINSTANCE hRslt = ShellExecute(NULL, sz_Operation, sz_Address, NULL, NULL, SW_SHOWNORMAL);rn assert(hRslt>(HINSTANCE) HINSTANCE_ERROR);rn return 0;rnrnrnrn--------------------Configuration: hello1 - Win32 Debug--------------------rnCompiling...rnhello1.cpprnLinking...rnLIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _mainrnDebug/hello1.exe : fatal error LNK1120: 1 unresolved externalsrnError executing link.exe.rnCreating browse info file...rnrnhello1.exe - 2 error(s), 0 warning(s)rnrn照着书上的例子,没有错啊!VC6.0中为什么编译通过不了?郁闷...看不懂编译信息.
FtpCommand无法通过编译
我使用了FtpCommand,但是编译的时候报错:error C2065: 'FtpCommand' : undeclared identifierrn请问该如何解决?谢谢!急!
编译无法通过?
问一下,程序是java how to program书中附带的,但是在jbuilder中编译无法通过,显示如下rnjava.lang.NoClassDefFoundError: craps/crapsrnrnException in thread "main"rn但是如果是最简单的:rnpublic class Welcome1 rn public static void main( String args[] )rn rn System.out.println( "Welcome to Java Programming!" );rn rn rn就可以通过?rn请问为什么啊?rn是不是环境配的不对?如果的话该怎么配?rnrnrn另外就是为什么每次我都是结帐给分的,我的信用却一直在下降?
编译无法通过问题
public Identity newMember() throws RemoteException rn int max = -1;rn boolean found = true;rn Enumerator enume;rn synchronized (idList) rn enume = idList.elements();rn rn while (enume.hasMoreElements()) rn Integer i = enume.nextElement();rn if (i.intValue() > max) rn max = i.intValue();rn rn rnrn上面这段程序1.5下面编译无法通过。rnEnumerator 这个是不是要改成Enumeration?rnInteger i = enume.nextElement(); 这里也无法通过。rn应该怎样改才能通过?rnrn另外,在1。5里面rnsynchronized (idList,clients)....?idList........clients........ 无法通过.好像synchronized无法有两个参数.怎样解决这个问题
关于JAVA编译代码的问题(菜鸟提问)
大家都知道JAVA文件可以被编译成class文件,但我的朋友不愿意安装兼容机还想运行我的程序.请问如何能把java文件编译成exe或其它语言的代码?rn还有就是,class文件是否能反编译成java文件?希望有人能详细解答.
提问关于编译
我在98下装了Framework ,可是不知道怎么用。我看装好后是在windows文件夹里多了个微软.net文件夹,里面有一些dos命令样的文件,好像有一个csc.exe,我照书上说的先建了个文本文件,然后在里面加了那个helloworld的代码,再在dos窗口中进入保存那个文件的文件夹,执行csc helloworld.cs命令,书上说就可以把其编译成.exe文件,可是我用了后不行说是错误的命令。搞不清这是怎么回事,那个文本文件的后缀是用.txt还是用.cs呀,不过我两样都试了还是不行,很着急,希望哪位大虾帮个忙,先多多谢了。rn 还有怎么给你分。
新手关于tag的问题,无法编译通过
学习tag中rn写了一个处理tag的类,代码如下rnimport java.io.*;rnimport javax.servlet.jsp.*;rnimport javax.servlet.jsp.tagext.*;rnimport java.util.Date;rnrnpublic class MyDateTag extends TagSupportrnrn public int doStartTag()rn rn try rn rn JspWriter out=pageContext.getOut();rn out.print("Now it is "+new Date());rn rn catch(IOException ioe)rn rn rn return (SKIP_BODY);rn rnrn编译通过后放在webapps/root/web-inf/classes下rnrn写了.tld文件如下rnrnrnrn 1.0rn 1.1rn MyDateTagrn rn MyDateTagTestrn MyDateTagrn EMPTYrn rn rnrn放在webapps/root/web-inf下rnrn写了一个test.jsp代码如下rnrnrn Current Datern<%@ taglib uri="/WEB-INF/MyDateTag.tld" prefix="Myjsp"%>rnrnrnrnrn放在webapps/root下rn运行后tomcat给出编译不通过,请高手指教rnException reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSPrnrnAn error occurred at line: -1 in the jsp file: nullrnrnGenerated servlet error:rn [javac] Compiling 1 source filernrnC:\Tomcat 4.1\work\Standalone\localhost\_\TagTest_jsp.java:76: cannot resolve symbolrnsymbol : class MyDateTag rnlocation: class org.apache.jsp.TagTest_jsprn MyDateTag _jspx_th_Myjsp_MyDateTagTest_0 = (MyDateTag) _jspx_tagPool_Myjsp_MyDateTagTest.get(MyDateTag.class);rn ^rnC:\Tomcat 4.1\work\Standalone\localhost\_\TagTest_jsp.java:76: cannot resolve symbolrnsymbol : class MyDateTag rnlocation: class org.apache.jsp.TagTest_jsprn MyDateTag _jspx_th_Myjsp_MyDateTagTest_0 = (MyDateTag) _jspx_tagPool_Myjsp_MyDateTagTest.get(MyDateTag.class);rn ^rnC:\Tomcat 4.1\work\Standalone\localhost\_\TagTest_jsp.java:76: cannot resolve symbolrnsymbol : class MyDateTag rnlocation: class org.apache.jsp.TagTest_jsprn MyDateTag _jspx_th_Myjsp_MyDateTagTest_0 = (MyDateTag。。。。rn
关于LINUX下编译无法通过的问题
不知道是否我的系统问题当我要输入双冒号的时候,要连续按两下键盘上的双冒号键才能出现一个的双冒号。举个例子如果我要用双冒号括住这一句话:我爱你。我就要按4下的双冒号键才可以括住。在VIM编写代码时也是一样,我的代码很规范的,可是编译老是不通过,例如我要编译这一段代码:rn#includernint main()rn printf(¨hillo wold¨);rnreturn 0;rnrn文件名为text.crn然后在终端编译输入命令:cc text.crn弹出错误信息为:rntext.c: 在函数‘main’中:rntext.c:4:5: 错误:程序中有游离的‘\302’rntext.c:4:5: 错误:程序中有游离的‘\250’rntext.c:4:14: 错误:‘hillo’未声明(在此函数内第一次使用)rntext.c:4:14: 附注:每个未声明的标识符在其出现的函数内只报告一次rntext.c:4:20: 错误:expected ‘)’ before ‘world’rntext.c:4:20: 错误:程序中有游离的‘\302’rntext.c:4:20: 错误:程序中有游离的‘\250rn我在WIN7下用任何的编译软件都可以通过这段代码,这真的把我给搞糊涂了,请高手解释!!!
一段C++代码,VC通过,MinGW无法通过编译
这是21世纪初的一本书,原来包含iostream.hrn我已经改成标准版了rn[code=C/C++]rn// =======================================================rn// Chapter 2, Example 5rn// Using values of template parameters.rn// =======================================================rn#include rn#include rnusing namespace std;rnrn// -------------------------------------------------------rn// Name: Arrayrn// Description: A simple static array classrn// -------------------------------------------------------rntemplate< class Datatype, int size, Datatype zero >rnclass Arrayrnrnpublic:rnrn // set function, sets an indexrn void Set( Datatype p_item, int p_index )rn rn m_array[p_index] = p_item;rn rnrn // get function, gets an indexrn Datatype Get( int p_index )rn rn return m_array[p_index];rn rnrnrn void Clear( int p_index )rn rn m_array[p_index] = zero;rn rnrn rnprivate:rnrn // the array.rn Datatype m_array[size];rn;rnrnrnint main()rnrn Array< int, 5, 0 > array1;rn Array< int, 10, 42 > array2;rn Array< float, 5, 0.5f > array3;rnrn array1.Clear( 0 );rn array2.Clear( 0 );rn array3.Clear( 0 );rnrn cout << "array1.Get( 0 ) = " << array1.Get( 0 ) << endl;rn cout << "array2.Get( 0 ) = " << array2.Get( 0 ) << endl;rn cout << "array3.Get( 0 ) = " << array3.Get( 0 ) << endl;rn system("pause");rnrnrn[/code]rnrnMinGW编译器错误信息如下rnIn function `int main()':rnerror: `float' is not a valid type for a template constant parameterrnerror: invalid type in declaration before ';' tokenrnerror: `Clear' has not been declaredrnerror: request for member of non-aggregate type before '(' tokenrnerror: `Get' has not been declaredrn error: request for member of non-aggregate type before '(' token
无法编译别人的代码?
我的同学给了我一个他开发的程序,是用netbeans写的,但是我打开后所有的类下面都有红线,表示错误。连最基本的string 和import java.io.* 都有错误,他跟我说是因为没装j2ee,但是装了后还是不行。请帮帮忙,我以前用eclipse。
gcc无法编译代码
之前有其他人在服务器上做过一些操作,具体不清楚,然后gcc就无法编译代码了,rn我写了一个hello,world的代码,然后gcc编译就打印出一下信息rnIn file included from /usr/local/include/features.h:4,rn from /usr/include/stdio.h:28,rn from a.c:1:rn/usr/local/include/forwards.h:6: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Json’rnIn file included from /usr/include/stdio.h:28,rn from a.c:1:rn/usr/local/include/features.h:6: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Json’rnIn file included from /usr/include/stdio.h:34,rn from a.c:1:rn/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h:211: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’rnIn file included from a.c:1:rn/usr/include/stdio.h:49: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’rn/usr/include/stdio.h:65: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’rn在包含自 /usr/include/libio.h:62 的文件中,rn 从 /usr/include/stdio.h:75,rn 从 a.c:1:rn/usr/include/sys/cdefs.h:46:44: 错误:标识符“(”前缺少二元运算符rn/usr/include/sys/cdefs.h:50:44: 错误:标识符“(”前缺少二元运算符rn/usr/include/sys/cdefs.h:135:19: 错误:标识符“(”前缺少二元运算符rn/usr/include/sys/cdefs.h:151:19: 错误:标识符“(”前缺少二元运算符rn/usr/include/sys/cdefs.h:209:19: 错误:标识符“(”前缺少二元运算符rnrnrnrn不知道是怎么回事啊,我卸载了再安装还是这个问题,希望大家帮助啊
一段无法编译的代码
include windows.incrnassume cs:codesgrncodesg segmentrnstart: mov ax,0123hrn mov bx,0456hrn add ax,bxrn add ax,axrn rn mov ax,4c00hrn int 21hrncodesg endsrnend rn请问这个为什么不能编译? 我用的IDE是辰灿 rn汇编语言集成开发环境 3.2 有人也用这个么?rn
VNC代码,编译通过
VNC代码,编译通过,好像是很早以前的版本的
无法发表有代码的提问
总是提示:rnrn请不要发表可能给我们带来伤害的言论,谢谢配合
关于编译代码-lippicv无法找到解决办法
方法 由于该错误是由于调用opencv库时报错,故解决办法为: 将opencv编译好的源目录中/3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64目录下的libippicv.a文件拷贝到/usr/lib/目录下即可 分析原因 由于ubuntu系统查找链接库的位置默认为/usr/lib目录,故该目录中没有相应的库,所以报错找不到,解决方法 1. 可以...
STL的const_iterator无法编译通过
大家帮忙看一下为什么我这句code死活编译不通过:rnrn[C++]rn//file:Scale.hrnrntemplate rn class Scalernrnpublic:rn explicit Scale(int dimension);rn ~Scale()rn void SetScaleValue(int dimension,...);rn int GetDimension();rn std::vector::const_iterator GetBeginPos(void);rn //就是这句,我换成rn //const ValueType* GetBeginPos(void);rn //就可以通过编译,但是这句不能rnprivate:rn std::vector scale;rn int dimension;rn Scale()rn;rnrn[/C++]rnrn[C++]rnvoid TestScale2()rnrn int dimension=3;rn Scale s(dimension);rn s.SetScaleValue(s.GetDimension(),0,1,2);rn std::vector_const_iterator begin=s.GetBeginPos();rn for(int i=0;i_const_iterator begin就没报错rnrn对Scale.h的报错语句rnerror:expected ";" before "GetBeginPos"rn
SDK编程问题(编译无法通过)
// Set WS_EX_LAYERED on this window rnSetWindowLong(hwnd, GWL_EXSTYLE,rnGetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);rn// Make this window 70% alpharnSetLayeredWindowAttributes(hwnd, 0, (255 * 70) / 100, LWA_ALPHA);rnrnrn
QT编译无法通过!???高分
在redhat 8.0.下用自带Kdeveloper生成了一个qt的空项目,可是却没法编译。rn好像说是没有makefile文件。rnrn请问该如何解决呢???rn谢谢
通过编译了但是无法运行
这是CStyleView文件内的代码rnrn#include "stdafx.h"rn#include "Style.h"rnrn#include "StyleDoc.h"rn#include "StyleView.h"rnrnrn#include "MainFrm.h"rnrn#ifdef _DEBUGrn#define new DEBUG_NEWrn#undef THIS_FILErnstatic char THIS_FILE[] = __FILE__;rn#endifrnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleViewrnrnIMPLEMENT_DYNCREATE(CStyleView, CView)rnrnBEGIN_MESSAGE_MAP(CStyleView, CView)rn //AFX_MSG_MAP(CStyleView)rn ON_WM_CREATE()rn ON_WM_CANCELMODE()rn ON_WM_MOUSEMOVE()rn //AFX_MSG_MAPrn // Standard printing commandsrn ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)rn ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)rn ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)rnEND_MESSAGE_MAP()rnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleView construction/destructionrnrnCStyleView::CStyleView()rnrn // TODO: add construction code herernrnrnrnCStyleView::~CStyleView()rnrnrnrnBOOL CStyleView::PreCreateWindow(CREATESTRUCT& cs)rnrn // TODO: Modify the Window class or styles here by modifyingrn // the CREATESTRUCT csrnrn //cs.lpszClass="sunxin.org";rn// cs.lpszClass=AfxRegisterWndClass(CS_HREDRAW | CS_HREDRAW,rn// LoadCursor(NULL,IDC_CROSS),(HBRUSH)GetStockObject(BLACK_BRUSH),0);rnrn cs.lpszClass=AfxRegisterWndClass(CS_HREDRAW | CS_HREDRAW);//缺省状态下rnrn rn return CView::PreCreateWindow(cs);rnrnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleView drawingrnrnvoid CStyleView::OnDraw(CDC* pDC)rnrn CStyleDoc* pDoc = GetDocument();rn ASSERT_VALID(pDoc);rn // TODO: add draw code for native data herernrnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleView printingrnrnBOOL CStyleView::OnPreparePrinting(CPrintInfo* pInfo)rnrn // default preparationrn return DoPreparePrinting(pInfo);rnrnrnvoid CStyleView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)rnrn // TODO: add extra initialization before printingrnrnrnvoid CStyleView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)rnrn // TODO: add cleanup after printingrnrnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleView diagnosticsrnrn#ifdef _DEBUGrnvoid CStyleView::AssertValid() constrnrn CView::AssertValid();rnrnrnvoid CStyleView::Dump(CDumpContext& dc) constrnrn CView::Dump(dc);rnrnrnCStyleDoc* CStyleView::GetDocument() // non-debug version is inlinernrn ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CStyleDoc)));rn return (CStyleDoc*)m_pDocument;rnrn#endif //_DEBUGrnrn/////////////////////////////////////////////////////////////////////////////rn// CStyleView message handlersrnrnint CStyleView::OnCreate(LPCREATESTRUCT lpCreateStruct) rnrn if (CView::OnCreate(lpCreateStruct) == -1)rn return -1;rn rn // TODO: Add your specialized creation code herern return 0;rnrnrnrnrnvoid CStyleView::OnMouseMove(UINT nFlags, CPoint point) //问题好像出现在这个函数里面,但是由于才学了没多久不知 道是缺什么造成的rnrn // TODO: Add your message handler code here and/or call defaultrn CString str;rn str.Format("x=%d,y=%d",point.x,point.y);rn ((CMainFrame* )GetParent()) -> m_wndStatusBar.SetWindowText(str);rnrn CView::OnMouseMove(nFlags, point);rnrn
为什么编译无法通过呢?
下面的程序是练习使用 sort 的, 使用deque作容器, 按从大到小进行排序,rn在VC下编译无法通过:rn#include rn#include rn#include rn#include rnusing namespace std;rnrninline bool greater1(int a, int b)rn return a>b;rnrnint main()rnrn int a[4]=8, 4, 6, 2;rn deque v(a, a+4); //出错在这一行rnrn ostream_iterator it(cout,",");rn copy(v.begin(), v.end(), it);rnrn sort(v.begin(), v.end(), greater1);rn copy(v.begin(), v.end(), it);rnrn cout<
用水晶报表编译无法通过
错误现象:rn异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。rn我的操作:当我直接把CrystalReportViewer放入WebForm中, 加Page_Load方法。rn相关:rn(1)rnrn rn(2)rnCrystalReportViewer1.ReportSource = Server.MapPath(".\\Income Statement.rpt");rn CrystalReportViewer1.DataBind(); rnrn
编译无法通过(附源码)
struct linkrnrnpublic:rn boost::weak_ptr point_object;rn boost::weak_ptr point_display;rn;rnclass graph_manage:public core_manage,public graph_manage_interfacernrnprivate:rn [color=#FF0000]std::list link_list;[/color]rn QSemaphore *guard_list;rnpublic:rn graph_manage(void);rn ~graph_manage(void);rn bool link(short,boost::shared_ptr); //使用系统中唯一的ID对两个对象进行互联,一旦互联,即会在上面进行显示rn bool link(QString&,boost::shared_ptr); //使用系统中唯一的名字对两个对象进行互联,一旦互联,即会在上面进行显示rn void delete_link(short,boost::shared_ptr);rn void delete_link(QString&,boost::shared_ptr);rn void run(); //通过下辖的连接,向图像显示器当中写数据,最终由图像显示器将其显示出来rn;rnrn为什么rnstd::list link_list;会报错:rnlink”不是参数“_Ty”的有效 模板 类型变量rn
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法