websocket发起链接时找不到方法! 求大神搭救!!! 2C

使用springmvc+spring+websocket搭建环境.
启动Tomcat时运行正常, 使用WebSocket创建链接时报异常.
在Myeclipse 下使用Ctrl+Shift+T 查找到 ReflectionUtils 类
进入里面发现并没有 doWithLocalFields()方法!

严重: StandardWrapper.Throwable
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.doWithLocalFields(Ljava/lang/Class;Lorg/springframework/util/ReflectionUtils$FieldCallback;)V
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.buildPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:418)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:397)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:924)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:220)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1235)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:830)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:137)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:75)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:494)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:632)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1550)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

0

2个回答

1

tomcat不是自带了实例么,,,直接用它的不就好了

 package com.Socket;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import net.sf.json.JSONObject;

@ServerEndpoint("/websocket/{username}/{_files}/{_img}")
public class WebSocket {

    private static int onlineCount = 0;
    private static Map<String, WebSocket> clients = new ConcurrentHashMap<String, WebSocket>();
    private static List<JSONObject> list = new ArrayList<JSONObject>();
    private Session session;
    private JSONObject json;
    private String username;
    private String path;
    private JSONObject listJSON;

    @OnOpen
    public void onOpen(@PathParam("username") String username,@PathParam("_files")String _path,@PathParam("_img")String img, Session session) throws IOException {

        this.username = username;
        this.session = session;
        this.path=_path+"/"+img;

        listJSON=new JSONObject();
        listJSON.element("src", path);
        listJSON.element("username", username);
        addOnlineCount();
        list.add(listJSON);

        json = new JSONObject();
        json.element("onlineCount", getOnlineCount());
        json.element("img", path);
        json.element("onstatus", 1);
        json.element("list", list);
        json.element("username", username);
        json.element("To", "All");
        clients.put(username, this);
        sendMessageAll(json.toString());
        json.element("onstatus", 0);
    }

    @OnClose
    public void onClose() throws IOException {
        json.element("onstatus", -1);
        list.remove(listJSON);
        clients.remove(username);
        subOnlineCount();
        json.element("onlineCount", getOnlineCount());
        json.element("list", list);
        json.element("To", "All");
        sendMessageAll(json.toString());
    }

    @OnMessage
    public void onMessage(String message) throws IOException {

        JSONObject jsonTo = JSONObject.fromObject(message);
        json.element("message", jsonTo.get("message"));

        if (!jsonTo.get("To").equals("All")){
            json.element("To", "One");
            sendMessageTo(json.toString(), jsonTo.get("To").toString());
        }else{
            json.element("To", "All");
            sendMessageAll(json.toString());
        }
    }

    @OnError
    public void onError(Session session, Throwable error) {
        error.printStackTrace();
    }

    public void sendMessageTo(String message, String To) throws IOException {
        // session.getBasicRemote().sendText(message);
        //session.getAsyncRemote().sendText(message);
        for (WebSocket item : clients.values()) {
            if (item.username.equals(To) )
                item.session.getAsyncRemote().sendText(message);
        }
    }

    public void sendMessageAll(String message) throws IOException {
        for (WebSocket item : clients.values()) {
            item.session.getAsyncRemote().sendText(message);
        }
    }



    public static synchronized int getOnlineCount() {
        return onlineCount;
    }

    public static synchronized void addOnlineCount() {
        WebSocket.onlineCount++;
    }

    public static synchronized void subOnlineCount() {
        WebSocket.onlineCount--;
    }

    public static synchronized Map<String, WebSocket> getClients() {
        return clients;
    }
}

前阵子弄得,,挺乱的,,不过大概就是这么用
https://git.oschina.net/zzhao114/WebChat_websocket.git 这是我用websocket写的聊天器

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
类成员在链接时找不到
首先是一个singleton模板基类,有个类成员装有实例的地址:rn[code=C/C++]rn#ifndef SINGLETON_Hrn#define SINGLETON_Hrnrntemplate class Singleton rnpublic:rn rn static T* instance;rn rn static T& getInstance()rn rn return *instance;rn rn rn static T* getInstancePtr()rn rn return instance;rn rnrn Singleton()rn rn instance = static_cast (this);rn rn rnprotected:rn Singleton(const Singleton&);rn Singleton& operator=(const Singleton &);rn rn rn;rnrn#endif // SINGLETON_Hrn[/code]rnrn然后一个简单的FooBar类rn[code=C/C++]rn#include "singleton.h"rnrnclass FooBar: public Singletonrnrnpublic:rn FooBar():foo(1),bar(2) rn int foo;rn int bar;rn;rnrnFooBar obj();rnrnint main() rn FooBar::getInstance();rnrn[/code]rn主程序的代码编译可以过,但链接时提示找不到“Singleton::instance”这个东西。我应当怎样做?
easyui大神求搭救
[img=https://img-bbs.csdn.net/upload/201606/10/1465567830_842256.png][/img]rn当我点击Add后会新增一个tabsrn[img=https://img-bbs.csdn.net/upload/201606/10/1465567902_196972.png][/img]rn但是当我新增的这个tabs的js中有如下代码时rn[img=https://img-bbs.csdn.net/upload/201606/10/1465567969_631679.png][/img]rn一新增这个tabs就会马上选中前一个tabs而不是当前新增的tabs rn如果没有图三的代码就不会这样rn但是关键是 我要给最后这个新增的tas添加一个关闭事件
EVC4.0找不到头文件,求搭救~
上午在用EVC4.0调试wince程序的时候电脑死机了,重启之后,evc打不开,提示Failed to connect to Drop-in CPU database, 不得已重新安装了evc和evc4sp4,问题出现了:rnfatal error C1083: Cannot open include file: 'math.h': No such file or directoryrnrnmath.h、string.h这些头文件都找不到了,再重装还是一样,纠结了,过路大神求搭救啊!!rn
函数模版bug 求大神搭救
using namespace std;rnrntemplaternrnvoid bubbleSort(T a[],int size);rnrnint main()rn int k;rn int array[]=34,65,12,43,67,5,78,10,3,70;rn float array[]=1.2,1.4,7.9,4.7,7.8,9.2,3.6,1.7,2.8,9.5;rnrn rn int len=sizeof(array)/sizeof(int);rn cout<<"The orginal int array are:"<rnvoid bubbleSort(T a[],int size)rnrn T temp;rn for(int pass=1;passa[k+1])rn rn temp=a[k];rn a[k]=a[k+1];rn a[k+1]=temp; rn rn cout<<"NO."<
VC链接时提示找不到动态库的函数.
情况是这样的:rn 1-我创建了一个动态库按照 extern "C" + __cdecl的组合通过export方式导出,目的是使导出接口名没有任何改编.达到目的.rn 2-但是在使用的时候遇到问题,使用时通过extern "C" + __cdecl的方式导入,链接是提示error LNK2001: unresolved external symbol _AddCounter.rn 查阅资料证实,这种情况是正确的.在c编译和c调用约定下就是在函数名前加个下划线.但是这样与导出的接口名就不一致了.不知道我查的资料对不对,这样的话不合理啊.rn请问这个该如何解决?rnrnrnrnrnrn
函数指针的数组在链接时找不到函数实现
我有一个类成员,它是一个函数指针的数组,里面存储若干个函数的地址:rn头文件:rn[code=C/C++]rntypedef unsigned char (*support_point_func)(const Shape& shape, const VectorF& n, VectorF& result);rnrnunsigned char support_sphere (const Shape& shape, const VectorF& n, VectorF& result);rnunsigned char support_box (const Shape& shape, const VectorF& n, VectorF& result);rnunsigned char support_cylinder (const Shape& shape, const VectorF& n, VectorF& result);rnunsigned char support_capsule (const Shape& shape, const VectorF& n, VectorF& result);rnunsigned char support_convex_hull(const Shape& shape, const VectorF& n, VectorF& result);rnunsigned char support_complex (const Shape& shape, const VectorF& n, VectorF& result);rnrnclass Shapernrn static support_point_func support_point_func_table[];rnrnrn[/code]rnrn实现文件:rn[code=C/C++]rnunsigned char support_sphere(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnunsigned char support_box(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnunsigned char support_cylinder(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnunsigned char support_capsule(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnunsigned char support_convex_hull(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnunsigned char support_complex(const Shape& shape, const VectorF& n, VectorF& result)rnrnrnrnsupport_point_func Shape::support_point_func_table[] = rnrn &support_sphere,rn &support_box,rn &support_cylinder,rn &support_capsule,rn &support_convex_hull,rn &support_complexrn;rnrn[/code]rn最终会在链接时,声称找不到那些函数。这是为什么?
客户端发起websocket长连接
项目将应用python、mysql、redis、tornado、sqlalchemy、sockjs、dplayer、wtforms、werkzeug等技术打造一个完整弹幕视频+多人在线聊天室。我将实战过程中带大家快速掌握python mtv的设计模式、基于线程池的异步io非阻塞、websocket实时长连接的技术原理。rn
Linux下链接时找不到系统动态库
起因:在一个项目上使用mkfs.jffs2工具时,报了错误提示找不到liblzo2.so.2库 开始在网上找解决方式,遇到了一个大坑,网上很多说执行sudo apt-get install liblzo2-dev:i386 这个命令来弄这个系统库就行了,当时也没多想,就执行了,而且是在公司大家都在使用的一个系统编译服务器上。。然后执行过程中居然autoremove了几个系统工具,包括gcc。。而且...
EDB函数可以使用 链接时出错 求大神指导
error LNK2019: 无法解析的外部符号 CeCreateDatabaseWithProps,该符号在函数 "public: int __cdecl CeDataBase::Create(unsigned long,wchar_t * *)" (?Create@CeDataBase@@QAAHKPAPA_W@Z) 中被引用rn已经在工程属性C++链接器中定义了EDBrnCEDB和EDB这两者是太纠缠不清了,什么乱七八糟的,啊,好烦啊
新手安装eclipse出问题,求大神搭救
[img=O)1%M8JW~X]3QTYWQ75446X][/img]。。。。。。。。。。。。jdk 有安装,下载eclipse不知道为什么出问题了。。。。出现 Failed to load the JDA share library“D:\eclipse\jre\bin\client\jvm.dll”rn
急求各路大神搭救啊!!!!!!
应老师要求做一个信息管理的简单web系统,但在链接数据库的时候出现了这样的问题,[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img],由于道行不够,怎么都解决不了。rn问题如下:rn我用了一个login控件,[img=https://img-bbs.csdn.net/upload/201412/16/1418718814_100533.png][/img]rn获取两个文本框的值,rn以下是我用来测试链接的,获取数据库中的值,设了断点,看读取的是什么值rn //获取用户名控件rn TextBox txtUserName = (TextBox)Login1.FindControl("UserName");rn string userName = txtUserName.Text.Trim();rnrn //获取密码控件rn TextBox txtPsw = (TextBox)Login1.FindControl("Password");rn string psw = txtPsw.Text;rnrn //错误显示控件rnrn //查询语句rn string sql = "select * from DL where uId=@userName and passWord=@passWord";rnrn //为参数赋值rn SqlParameter[] pms = new SqlParameter[] new SqlParameter("@userName", userName), new SqlParameter("@password", psw) ;rn string constr = "Data Source=GG;Initial Catalog=LianXiDB;User ID=sa;Password=123";rn //判断用户名与密码是否正确rn using (SqlConnection con = new SqlConnection(constr))rn rn using (SqlCommand scd = new SqlCommand(sql,con))rn rn scd.Parameters.AddRange(pms);rn con.Open();rn using (SqlDataReader read = scd.ExecuteReader())rn rn if (read.HasRows)rn rn rn string id = read.GetString(0);rn string psww = read.GetString(1);rn rn rn rn rn rn rnrn结果就成这样子了rn[img=https://img-bbs.csdn.net/upload/201412/16/1418718993_726112.png][/img]rn请大哥们指点一下迷津,小弟不胜感激!!谢谢[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img]
IE无法打开链接时的修复方法
当在IE页面点击链接时,却打开空白新选项卡,也无法通过新建窗口打开链接,可以采用这个文件进行修复
linux进程间通信之消息队列
未完待续!
MFC程序链接时的问题
在一个单文档应用程序中,有一个检查编辑框中输入的是否是数字的函数bool IsValidNumber(CString strNum),因为在程序中要多次调用,我就把它放在一个头文件中,然后链接时有错误:rnLinking...rnPointNNQueryDlg.obj : error LNK2005: "bool __cdecl IsValidNumber(class CString)" (?IsValidNumber@@YA_NVCString@@@Z) already defined in DynamicBuildIdxDlg.objrnRecordFileQueryDlg.obj : error LNK2005: "bool __cdecl IsValidNumber(class CString)" (?IsValidNumber@@YA_NVCString@@@Z) already defined in DynamicBuildIdxDlg.objrn¿Õ¼ä¾ÛÀàºÍÒì³£µã¼ì²â×Óϵͳ.exe : fatal error LNK1169: one or more multiply defined symbols foundrnError executing link.exe.rnrn如果我不换成类来实现IsValidNumber,还继续用函数,改怎么解决或者设置???
proc链接时报错
proc链接时报错:rnc++ -o rtmain rtmain.o -L/export/home/guotao/sms/lib -L/opt/sfw/lib -L/usr/lib -L/u01/app/oracle/product/8.1.7/lib librtoracle.a -L-lm -lsocket -ldl -lnsl -lxml8 -lcore8 -lnls8 -lclient8rnUndefined first referencedrn symbol in filernsqlnul librtoracle.a(query.o)rnsqlald librtoracle.a(query.o)rnsqlprc librtoracle.a(query.o)rnsqlclu librtoracle.a(query.o)rnsqlcxt librtoracle.a(query.o)rnld: fatal: Symbol referencing errors. No output written to rtmainrncollect2: ld returned 1 exit statusrn*** Error code 1rnmake: Fatal error: Command failed for target `rtmain'rn其中librtoracle.a是我写的库文件。rnrn环境变量rnLD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/ccs/lib:/opt/sfw/lib:/u01/app/oracle/product/8.1.7/lib:/u01/app/oracle/product/8.1.7/precomp/lib:/u01/app/oracle/product/8.1.7/network/lib:/u01/app/oracle/product/8.1.7/rdbms/librnrn为什么还会出此错误?
linux 链接时coreDump
单独编译so的时候正常,但是在ld的时候出现coreDump信息,如下:rncollect2: error: ld terminated with signal 6 [Aborted], core dumpedrn** Error in `/opt/sdk/toolchain/arm-2014.11/arm-linux-gnueabihf/bin/ld': free(): invalid size: 0x000000004c1b1d70 ***rnrn求助各位。rn
在与mysql链接时出错!
Warning: MySQL Connection Failed: Can't create TCP/IP socket (10041) in E:\weisi\yy\head.php on line 190rnrn什么意思?rn
链接时的一个错误!
错误信息:rnUnable open file "coc.obj"rn请问,一般这是由什么造成的?如何解决?
为什么链接时报错?
源程序如下:rn------------------------------------------------------------rn.alpharnextern PntMsg: farrnzseg segment word public 'data' rn szErr db 'This a called function', '$'rnzseg endsrnrnsseg segment dword stack rn db 100h DUP(?) rnsseg endsrnrnzseg segment word public 'data'rn szMsg db 'Hellow Worldfgsdgsxvgd!',13, 10, '$'rnzseg ends rn rncseg segment rn assume cs:cseg, ds:zseg, ss:ssegrnstart:rn mov ax, zsegrn mov ds, axrn rn lea dx, szMsgrn mov ah, 9rn int 21hrn rn call PntMsgrn rn mov ah, 1rn int 21hrn mov ax, 4C00hrn int 21hrncseg endsrn end startrnrn;.alpharnpublic PntMsgrnsseg segment dword stack ;'stack' rn db 100h DUP(?) rnsseg endsrnzseg segment word private 'dqata' rn szErr db 'This a called function', '$'rnzseg ends rnccseg segment rn assume cs:ccseg, ds:zsegrnPntMsg proc farrn mov ax, zsegrn mov ds, axrn rn lea dx, szErrrn mov ah, 9rn int 21hrn retfrnPntMsg endprnccseg endsrn end PntMsgrn---------------------------------------------------rn链接时报错:error L2029: 'PNTMSG' : unresolved external。rn这是怎么回事?
Mysql8链接时时区
jdbc:mysql://root:password@127.0.0.1:3306/leopard?useUnicode=true&amp;amp;characterEncoding=UTF8&amp;amp;useSSL=false&amp;amp;serverTimezone=Asia/Shanghai
c++链接时的问题??
我用win32 application编写的程序,关闭又打开出现了问题,链接时出现:rnLinking...rnLIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _mainrnDebug/6.exe : fatal error LNK1120: 1 unresolved externalsrnError executing link.exe.
链接时的问题(谢谢)
就是把web页的滚动条拉到最下边,点击一个链接,又自动返回到页面顶端,我不想让它自动返回,怎么解决这个问题^_^
MFC 链接时出现问题
链接时,程序会卡在linking...一直不动,出现得很频繁。rn程序没有错误,重新打开后再Build也没有问题,这是怎么回事啊?
dll链接时出错
我自己做了一个dll 但在链接的时候出错:rn我是用project->references中的browse去找到这个dll但是rn他会报can't add a reference to the specified file rn请问这是什么问题?rn是dll的问题rn还程序的问题???rn我把dll去注册的时候也注册不了rn我的dll只是提供两个函数布局其它都不做(用到wsock32.lib)rn谢谢了!
简单程序链接时报错
rnrn很奇怪,我写了一个Hello world!程序链接时老是报错。我也不知道是为什么!还请指教一下!呵呵!rnrnLinking...rnLINK : fatal error LNK1168: cannot open Debug/TEST.exe for writingrn执行 link.exe 时出错.rnrnTEST.exe - 1 error(s), 0 warning(s)rnrn
小菜鸟跪求大神搭救
本人刚学php,下载了一个appserver软件,不过出了一些问题,一直不能解决rn我在进入http://localhost/phpmyadmin/时输入用户名,密码,但最后出现了这个页面rnrnrnhttp://localhost/phpmyadmin/error.php?lang=zh&dir=ltr&type=%B4%ED%CE%F3&error=Invalid+authentication+method+set+in+configuration%3A+&phpMyAdmin=31ntng1saf13naeh6o64nhov87rnrnrn[img=https://img-bbs.csdn.net/upload/201503/13/1426261763_179550.jpg][/img]rn除了上面的红色部分,然后就没有其他的东西了rn不知道怎么修改rn望大神指点一番,小弟不甚感激
svn链接时报错
昨天eclipse  svn插件还是好好的,今天突然间不好使了。各种更改eclipse  工作空间等等。就是一直搞不明白问题所在。后来灵光一闪,想到可能跟无线有线有关。以前都是链接的有线,昨天换了无线。果断抱着电脑链接上有线,问题解决了。后来请教小伙伴们,小伙伴又提供了一个方案。 方案一:  找个网线  用有线链接 方案二:C:\WINDOWS\system32\drivers\etc找到 H
链接时的问题
链接时编译器报出如下的错误:rn"[Linker Error] Unresolved external '__linkproc__ intover' referenced from D:\LDDEMO\MAIN\FORMMAIN.OBJ"rn这是什么错误,什么原因造成的,如何解决?rn请大家帮忙!
为什么链接时出错?
我在一个项目里面创建了两个project.rn一个是Win32 static library(project1)rn一个是Win32 Application(.exe)(project2)rn现在我在project2中调用了project1中定义的类A,只是在调用的文件中把定义类A的头文件包含进来了。rn结果编译project2时链接出错,LNK2001。大致是说我调用类A的成员函数没有定义。rn这该怎么解决?谢谢!!rn
关于链接时的-lCstd
为什么workshop6.0所带的CC,编译动态库时,如果动态库使用了iostream,就需要在链接时加入-lCstd,否则别人调这个动态库就会报无法找到函数(但是动态库本身编译链接都没问题)rnrn但是编译成可执行文件,使用iostream就不用加-lCstdrnrnrnrn而Sun Studio 11所带的CC,不管是动态库和可执行文件,都不用加-lCstd
链接时出现的问题
链接时出现的问题:smsDemo.obj : error LNK2001: unresolved external symbol "public: __thiscall CsmsInterface::~CsmsInterface(void)" (??1CsmsInterface@@QAE@XZ)rn请问是怎么回事?rn
链接时如何传递参数?
在用C或Delphi等编程语言编程时,参数传递是一个很重要的问题,都会详细介绍的。rn但在介绍网页设计语言时,如何在链接跳转网页的同时时,传递一些参数?rn这应该是一个基本问题,我想。但好像讲链接时从不提这个,很怪。rn希望有人能详细谈谈这个问题。
求搭救~~取值问题
两个表,A表跟B表 rnA表的Bm跟b表的ypHH相对于,rnA表的GG跟B表的YPGG相对应,rn这两个表要关联起来rn现在要过滤掉A表列名memo没值得行然后从B表取对应的ypcd,并且是取相对应B表列名为PC最大值那个ypcd,取值后填到A表里面rnrn也就是过滤掉没的,从B取对应PC最大的ypcd值填到A
小菜鸟求搭救
为神马我插入的信息不是按代码的顺序呢??rn是哪里需要设置么??还是代码不对么??rn望各位指点迷津rn[img=https://img-bbs.csdn.net/upload/201408/29/1409322271_342132.png][/img]
makefile链接时找不到指定指定函数,请教
在Linux环境下的/home/pang/WorkSpace/UnixTest路径下有以下目录,功能分别为:rnbin:可执行文件 rninclude:头文件rnlog:日志 rnpublic:公共代码 rnulib:编写好的动态库和静态库 rnusrc:代码目录rnrn在usrc下面有rnlibAddFun.c libCommon.c libDivFun.c libMultiFun.c libSubFun.c makefilern功能函数,分别是加减乘除功能,通过makefile分别编写为动态库和静态库放到 ulib路径下:rn此时的makefile文件为:rn[code=text]AR = arrnCC = gcc -grngg = g++ -grnDEBUGFLAGS = -DDEBUGrnSO_FLAGS = -fPIC -sharedrnCFLAGS = -Wall -O3 -BdynamicrnCPPSTD = -std=c++0xrnINC = -I$(UNIX_DIR)/includernEXE = -I$(UNIX_DIR)/librnTARGET =*.sornrn.SUFFIXES: .c .o .so .arnrnall:libSubFun.so libAddFun.so libMultiFun.so libDivFun.so libCommon.so libAddFun.a libSubFun.a libMultiFun.a libDivFun.a libCommon.arn.c.so:rn $(CC) $(INC)/ -c $*.crn $(CC) $(SO_FLAGS) $(CFLAGS) $(INC) -o $(UNIX_DIR)/ulib/$*.so $*.o rnrn.c.a:rn $(CC) $(INC)/ -c $*.crn $(AR) r $(UNIX_DIR)/ulib/$*.a $*.o rnclean:rn rm -f *.orn rm -f $(UNIX_DIR)/ulib/*.sorn rm -f $(UNIX_DIR)/ulib/*.arn[/code]rnrn在include路径下有两个头文件文件分别存放,加减乘除方法和公共函数方法,分别为:rncommon.h usrHead.hrncommon.h的内容为:rn[code=c]rn#include rn#include rn#include rn#include rn#include rnrnint Log(char *);rnchar* CurrTime(char *);rn[/code]rnrnusrHead.h的内容为:rn[code=c]rn#include rnrnint AddFun(int , int );rnint SubFun(int x, int y);rnint multiFun(int x, int y);rnint divFun(int x, int y);rn[/code]rnrn在public路径下有calc.c文件和makefile,准备使用编写好的库函数rncalc.c为内容为:rn[code=c]rn#include "common.h"rn#include "usrHead.h"rnrnint main(int argc, char **agrv)rnrn char logFile[128];rn memset(logFile, 0x00, sizeof(logFile));rn int num = 0;rn num = addFun(3,5);rn sprintf(logFile ,"add fun's result is %d", num);rn Log(logFile);rnrnrn return 0;rnrn[/code]rnmakefile文件内容为:[code=text]rnAR = arrnCC = gcc -grngg = g++ -grnDEBUGFLAGS = -DDEBUGrnSO_FLAGS = -fPIC -sharedrnCFLAGS = -Wall -O3 -BdynamicrnCPPSTD = -std=c++0xrnINC = -I$(UNIX_DIR)/includernEXE = $(UNIX_DIR)/binrn#SYSLIBS = -ldlrnUSRLIBS = -L$(UNIX_DIR)/ulib -lCommon -lAddFun -ldlrnrncalc:calc.orn $(CC) $(INC) $(USRLIBS) -o $(EXE)/calc calc.ornrncalc.o:calc.crn $(CC) $(INC) -c calc.crnrnclean:rn rm -f *.o *.sornrn[/code]rn在make后编译的时候没有报错生成了calc.o为目标文件,但是链接的时候报错,错误如下:[code=text]rngcc -g -I/home/dang/WorkSpace/UnixTest/include -c calc.crngcc -g -I/home/dang/WorkSpace/UnixTest/include -L/home/dang/WorkSpace/UnixTest/ulib -lCommon -lAddFun -ldl -o /home/dang/WorkSpace/UnixTest/bin/calc calc.orncalc.o: In function `main':rn/home/dang/WorkSpace/UnixTest/public/CalcSrv/calc.c:28: undefined reference to `addFun'rn/home/dang/WorkSpace/UnixTest/public/CalcSrv/calc.c:30: undefined reference to `Log'rncollect2: error: ld returned 1 exit statusrnmake: *** [calc] Error 1rn[/code]rnrn报错原因为找不到库里面的函数,请问下大神,是我代码的问题还是makefile写的有问题?rnrnrnrnrnrnrnrn
已经包含了"winsock.h",在链接时为什么还是找不到?
Linking...rnappl.obj : error LNK2001: unresolved external symbol _WSACleanup@0rnappl.obj : error LNK2001: unresolved external symbol _WSAStartup@8rnappl.obj : error LNK2001: unresolved external symbol ___WSAFDIsSet@8rnappl.obj : error LNK2001: unresolved external symbol _select@20rnmarshal.obj : error LNK2001: unresolved external symbol _htons@4rnnet.obj : error LNK2001: unresolved external symbol _htons@4rnpsrm.obj : error LNK2001: unresolved external symbol _htons@4rnsockaddr.obj : error LNK2001: unresolved external symbol _htons@4rnmarshal.obj : error LNK2001: unresolved external symbol _htonl@4rnnet.obj : error LNK2001: unresolved external symbol _htonl@4rnmarshal.obj : error LNK2001: unresolved external symbol _ntohs@4rnsockaddr.obj : error LNK2001: unresolved external symbol _ntohs@4rnmarshal.obj : error LNK2001: unresolved external symbol _ntohl@4rnnet.obj : error LNK2001: unresolved external symbol _socket@12rnnet.obj : error LNK2001: unresolved external symbol _WSAGetLastError@0rnnet.obj : error LNK2001: unresolved external symbol _bind@12rnnet.obj : error LNK2001: unresolved external symbol _gethostbyname@4rnnet.obj : error LNK2001: unresolved external symbol _gethostname@8rnnet.obj : error LNK2001: unresolved external symbol _sendto@24rnnet.obj : error LNK2001: unresolved external symbol _recvfrom@24rnnet.obj : error LNK2001: unresolved external symbol _accept@12rnnet.obj : error LNK2001: unresolved external symbol _setsockopt@20rnnet.obj : error LNK2001: unresolved external symbol _connect@12rnpsrm.obj : error LNK2001: unresolved external symbol _lrintrnsockaddr.obj : error LNK2001: unresolved external symbol _getsockname@12rnsockaddr.obj : error LNK2001: unresolved external symbol _inet_addr@4rnsockaddr.obj : error LNK2001: unresolved external symbol _inet_ntoa@4rntimes.obj : error LNK2001: unresolved external symbol _gettimeofdayrnutil.obj : error LNK2001: unresolved external symbol _gettimeofdayrnDebug/psrm.exe : fatal error LNK1120: 23 unresolved externalsrnError executing link.exe.rnrn还需要加其它库吗?还是我建立程序方法不对?rn步骤如下:rn1、建立win32 console application,empty project~rn2、把编好的.c.h添加进来,rn3、编译、链接rnrn请高人指教~rn
Fabric SSH链接时关于找不到主机的问题
Fabric SSH链接时关于找不到主机的问题 先上一段简单的fabric代码:from __future__ import with_statementfrom fabric.api import *env.user = 'zhangsan'env.hosts = ['192.168.1.1']env.password = '123456'wit...
vm vsphere client链接时找不到指定模块
[img=https://img-bbs.csdn.net/upload/201511/09/1447058901_511552.png][/img]rn如图
神龙V代解压卡 : 为什么链接时找不到IID_ITvVgaOutput
已经做了如下事情:rn#include rn// 34860D40-488F-11d3-9E5F-0090272CFCC9rnDEFINE_GUID(IID_ITvVgaOutput, rn0x34860d40, 0x488f, 0x11d3, 0x9e, 0x5f, 0x0, 0x90, 0x27, 0x2c, 0xfc, 0xc9);rnITvVgaOutput *m_pTvVgaOutput = NULL;rnpGraphBuilder->FindFilterByName(L"Sigma Designs MPEG-2 hardware decoder", &m_pHardDecoder);rnrn但链接错误如下:rnMyPlayView.obj : error LNK2001: unresolved external symbol _IID_ITvVgaOutputrnDebug/MyPlay.exe : fatal error LNK1120: 1 unresolved externals
链接时出现问题,大神帮忙看一下,一直没找到问题,谢谢!
#includern#includernvoid main()rnrnvoid exchange(int *q1,int *q2,int *q3); //使用该函数前必须声明rnint a=9;rnint b=0;rnint c=10;rnint *p1,*p2,*p3;rnp1=&a;rnp2=&b;rnp3=&c;rnexchange(p1,p2,p3);rnprintf("\n%d,%d,%d\n",a,b,c);rnrnrnvoid exchange(int *q1,int *q2,int *q3) //该函数用来交换q1,q2,q3的值,使得三者的值由大到小的顺序排序rnrnvoid swap(int *pt1,int *pt2);rnif(*q1<*q2) swap(q1,q2);rnif(*q1<*q3) swap(q1,q3);rnif(*q2<*q3) swap(q2,q3);rnrnrnvoid swap(int *pt1,int *pt2) //该函数用来交换pt1和pt2的值rnrnint temp;rntemp=*pt1;rn*pt1=*pt2;rn*pt2=temp;rn
相关热词 c# 线程顺序 c#昨天当前时间 c# 多进程 锁 c#mysql图片存取 c# ocx 委托事件 c# 读取类的属性和值 c# out 使用限制 c#获取url的id c#怎么进行分页查询 c# update 集合