从别的电脑上面拷贝过来的AS项目编译不过去

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/wb175208/article/details/52741081

从别的电脑上拷贝过来的项目,编译不过去。

出现以下错误:

Error:No cached version of com.android.tools.build:gradle:2.1.3 available for offline mode.
Disable Gradle 'offline mode' and sync project

调用cmd->gradle clean 出现以下问题:

 > Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.1.3.


解决办法:

build.gradle ->

                      

dependencies {
    classpath 'com.android.tools.build:gradle:2.1.3' 改为 classpath 'com.android.tools.build:gradle:2.1.+'

}



展开阅读全文

编译不过去????????

08-02

import java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class ImageTestrn rn public static void main (String[] args)rn rn ImageFrame frame = new ImageFrame();rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn frame.show();rn rn rn //创建一个带图象面板的框架rn class ImageFrame extends JFramern rn public ImageFrame()rn rn setTitle("ImageTest");rn setSize(WIDTH,HEIGHT);rn rn //把面板加到框架上rn ImagePanel panel = new ImagePanel();rn Container contentPane = getContentPanel;rn contentPane.add(panel);rn rn public static final int WIDTH = 300;rn public static final int HEIGHT = 200;rn rn //显示图片的面板rn class ImagePanel extends JPanelrn rn image = Toolkit.getDefaultToolkit().getImage("b.jpg");rn MediaTracker tracker = new MediaTracker(this);rn tracker.addImage(image,0);rn try tracker.waitForID (0); rn catch (InterruptedException exception) rn rn public void paintComponent(Graphics g)rn rn super.paintComponent(g);rn rn int imageWidth = image.getWidth(this);rn int imageHeight = image.getHeight(this);rn rn //rn g.drawImage(image,0,0,null);rn rn //rn for (int i=0;i*imageWidth <= getWidth();i++) rn for (int j=0;j*imageHeight <= getHeight();j++)rn if (i+j>0)rn g.copyArea(0,0,imageWidth,imageHeight,i*imageWidth,j*imageHeight);rn rn private Image image;rnrnrnrn这是《最新Java2核心技术(原理)》中的一个例子,例7-7的问题rnrn编译不过去,请各位高手和大虾看一看,哪里出了毛病??rnrnrn十分感谢!!!!!!!!! 论坛

电脑从移动硬盘拷贝很慢

04-14

最近遇到了一个很棘手的问题,折腾了好多天了都没有解决,希望高手帮忙看看.rn情况如下:从移动硬盘里面向我机子拷贝数据的时候很慢,比如我拷贝照片半天才拷贝了几个,而且没有提示剩余多少时间.rn我解决过程如下:rn1,刚开始我怀疑驱动的问题,重装驱动之后还是不行,检查主板是否支持USB2.0,主板为磐石EP-8KRAI-A支持USB2.0,还是不行之后,网上下载USB2.0万能驱动,还是不行.rn2,怀疑中毒,安全模式用卡巴扫毒没有发现任何病毒.rn3,怀疑移动硬盘有问题,在别人机子上面实验很快很正常,重新拿来一个移动硬盘还是出现上面的问题.在使用过程中,两个都出现了windows延缓写入失败.rn4,怀疑硬盘有问题,用HDTune-v2.55H检查了一下硬盘,没有发现问题,最高传输速度也可以达到50m/s,也没有发现坏道.rn5,怀疑IED通道传输模式有问题,检查了一下也没有发现问题,具体如下:rnIDE ATA/ATAPI控制器rn VIA Bus Master IDE Controllerrn 次要IDE通道rn 主要IED通道rn主要IED通道里面属性里面rn设备0rn设备类型 自动检测rn传送模式 DMA(若可用)rn当前传送模式 不适用rnrn设备1rn设备类型 自动检测 (灰色的不可选)rn传送模式 DMA(若可用)rn当前传送模式 Ultra DMA Mode 2rnrn通用串行总线控制器rn4个USB Root HubrnVIA USB Enhanced Host Controllerrn6,怀疑系统有问题,重装系统问题还是没有得到解决rn7,很郁闷,不知道该怎么办.rnrn希望高手能够帮忙看看,"写论文"(大量拷贝别出理论的)的不要回答.rn 论坛

创建空项目怎么编译不过去

08-21

创建空项目,添加个类文件,怎么编译不过去rn[code=csharp]using System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnrnnamespace Project1rnrn class Class1rn rn public void main(string[] arg)rn rn rn rnrn[/code]rn[code=text]------ 已启动生成: 项目: Project1, 配置: Debug x86 ------rn错误 CS5001: 程序“C:\Users\Administrator\Desktop\Project1\Project1\obj\x86\Debug\Project1.exe”不包含适合于入口点的静态“Main”方法rnrn编译完成 -- 1 个错误,0 个警告rn生成启动时间为 2016/8/21 14:34:52。rnResolveAssemblyReferences:rn 将生成 TargetFramework 配置文件排除列表。rnGenerateTargetFrameworkMonikerAttribute:rn正在跳过目标“GenerateTargetFrameworkMonikerAttribute”,因为所有输出文件相对于输入文件而言都是最新的。rnCoreCompile:rn C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\x86\Debug\Project1.exe /target:exe Class1.cs "C:\Users\Administrator\AppData\Local\Temp\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.cs"rnrn生成失败。rnrn已用时间 00:00:00.65rn========== 生成: 成功或最新 0 个,失败 1 个,跳过 0 个 ==========rn[/code] 论坛

简单的程序编译不过去

02-26

利用向导产生dll文件(Mfc dll),选择mfc extension dll,然后在project中增加一个.h文件,在.cpp文件中包含增加的文件,编译无法通过。rn增加的.h文件如下rn#ifndef _KEYDLL_Hrn#define _KEYDLL_Hrn//文件名称ActiveKey.hrnclass AFX_EXT_CLASS CKeyHook : public CObjectrn//class AFX_EXT_CLASS CKeyHook:public CObjectrnrnpublic:rn CKeyHook();rn ~CKeyHook();rn HHOOK Start(); //安装钩子rn BOOL Stop(); //卸载钩子rnrnrnrn#endifrnrnrn.cpp文件如下:rn#include "stdafx.h"rn#include "ActiveKey.h"rn#include rnrnrn#ifdef _DEBUGrn#define new DEBUG_NEWrn#undef THIS_FILErnstatic char THIS_FILE[] = __FILE__;rn#endifrnrnrnstatic AFX_EXTENSION_MODULE ActiveKey1DLL = NULL, NULL ;rnrnCKeyHook::CKeyHook()rnrnrnrnextern "C" int APIENTRYrnDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)rnrn // Remove this if you use lpReservedrn UNREFERENCED_PARAMETER(lpReserved);rnrn if (dwReason == DLL_PROCESS_ATTACH)rn rn TRACE0("ACTIVEKEY1.DLL Initializing!\n");rn rn // Extension DLL one-time initializationrn if (!AfxInitExtensionModule(ActiveKey1DLL, hInstance))rn return 0;rnrn // Insert this DLL into the resource chainrn // NOTE: If this Extension DLL is being implicitly linked to byrn // an MFC Regular DLL (such as an ActiveX Control)rn // instead of an MFC application, then you will want torn // remove this line from DllMain and put it in a separatern // function exported from this Extension DLL. The Regular DLLrn // that uses this Extension DLL should then explicitly call thatrn // function to initialize this Extension DLL. Otherwise,rn // the CDynLinkLibrary object will not be attached to thern // Regular DLL's resource chain, and serious problems willrn // result.rnrn new CDynLinkLibrary(ActiveKey1DLL);rn rn else if (dwReason == DLL_PROCESS_DETACH)rn rn TRACE0("ACTIVEKEY1.DLL Terminating!\n");rn // Terminate the library before destructors are calledrn AfxTermExtensionModule(ActiveKey1DLL);rn rn return 1; // okrnrnrnrnrn提示的错误如下:rnc:\program files\microsoft visual studio\vc98\mfc\include\afxdllx.h(35) : error C2143: syntax error : missing ';' before 'string'rnc:\program files\microsoft visual studio\vc98\mfc\include\afxdllx.h(35) : fatal error C1004: unexpected end of file foundrnError executing cl.exe.rnrn 论坛

i2c设备驱动程序编译不过去

04-03

各位大哥:rn 最近在做i2c的设备驱动程序。在网上找了些资料。针对自己的设备写了一个驱动程序。但编译不过去。rn 提示variable 'ds2746_driver' has initializer but incomplete type.rn unknow field 'ower' specified in initializer.结构体ds2746_driver中的所有域都不认识。rn 还提示ds2746_attach函数中new_client->name=ds2746_driver.name位置 dereferencing pointer to incomplete typernrnrn下面是全部的代码,请各位大哥指点。rnrn谢谢。rn rn#include rn#include rn#include rn#include rn#include rn#include rn#include rnrn#include "ds2746.h"rnrn#define BUFFER_SIZE 100 * 1024rnstatic unsigned char ds2746_MAJOR = 127;rnstatic char INNODEV_NAME[] = "ds2746";rnrnstruct i2c_adapter;rnrn#ifndef u8rn#define u8 unsigned charrn#endifrnrn#ifndef u16rn#define u16 unsigned intrn#endifrnrnrnstruct ds2746_data rn struct i2c_client *client;rn u16 ctrl;rn;rnrnstatic int ds2746_attach(struct i2c_adapter *adap, int addr, int kind)rnrn int ret, res;rn struct i2c_client *new_client;rn u8 sendbuf[2];rn new_client->name = ds2746_driver.name;rn new_client->id = ds2746_driver.id;rn new_client->addr = DS2746_SLAVE_ADDR;rn new_client->flags = I2C_CLIENT_ALLOW_USE | I2C_DF_NOTIFY;rn new_client->adapter = adap;rn new_client->driver = &ds2746_driver;rn ret = i2c_attach_client(new_client);rn if(ret < 0)rn rn printk("cant init ds2746\n");rn return 1;rn rn sendbuf[0] = DS2746_REG_CONFIG;rn sendbuf[1] = DS2746_CON_INITDATA;rn res = ds2746_write_value(new_client, sendbuf, 2);rn if(res < 0)rn rn printk("cant init status/config reg\n");rn return 2;rn rn return res;rnrnstatic int ds2746_write_value(struct i2c_client *client,u8 reg,u16 value)rnrn if (reg == DS2746_REG_CONFIG)rn return i2c_smbus_write_byte_data(client,reg,value);rn elsern return i2c_smbus_write_word_data(client,reg,swab16(value));rnrnstatic int ds2746_read_value(struct i2c_client *client,u8 reg)rnrn if (reg == DS2746_REG_CONFIG)rn return i2c_smbus_read_byte_data(client,reg);rn elsern return swab16(i2c_smbus_read_word_data(client,reg));rnrnstatic int ds2746_probe(struct i2c_adapter *adap)rnrn return i2c_probe(adap, &addr_data, ds2746_attach);rnrnstatic int ds2746_detach(struct i2c_client *client)rnrn return i2c_detach_client(client);rnrnstatic struct file_operations ds2746_fops = rn .owner = THIS_MODULE,rn .read = ds2746_read_value,rn .write = ds2746_write_value,rn;rnstatic struct i2c_driver ds2746_driver = rnrn .name = DS2746,rn .id = I2C_DRIVERID_DS2746,rn .flags = I2C_DF_NOTIFY,rn .attach_adapter = ds2746_probe,rn .detach_client = ds2746_detach,rn .command = ds2746_command,rn;rnstatic int __init ds2746_init(void)rnrn int ret, res;rn res = i2c_add_driver(&ds2746_driver);rn if(res < 0)rn rn printk("Cant add ds2746 driver\n");rn return 1;rn rn ret = register_chrdev(ds2746_MAJOR, INNODEV_NAME, &ds2746_fops);rn if(ret < 0)rn rn printk("Cant register ds2746 device\n");rn return 1;rn rn return 0;rn rnrnstatic void __exit ds2746_exit(void)rnrn i2c_del_driver(&ds2746_driver);rn unregister_chrdev(ds2746_MAJOR,"ds2746");rnrnrnmodule_init(ds2746_init);rnmodule_init(ds2746_exit);rnrnMODULE_LICENSE("GPL"); 论坛

没有更多推荐了,返回首页