qt报错undefined reference to `vtable for btnStyle'

头文件中:
//错误:undefined reference to `vtable for btnStyle'
class btnStyle : public QProxyStyle
{
Q_OBJECT
public:
btnStyle();

};

构造函数如下:

//出错地方图片说明

图片说明
一直报错什么问题呢,我只是对qt的例子稍微改了下,但是主体框架都没改

c++

2个回答

问题
在一个类中添加了宏 Q_OBJECT 后,编译运行报错 undefined reference to vtable for ...
解决
重新运行qmake。Qt Creator 中,点击菜单栏 Build 中的 Run qmake,然后重新运行就会正常。......
答案就在这里:Qt编译报错 undefined reference to vtable for ...
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

函数返回类型?????

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
undefined reference to `vtable for jsonResolution'
请教一下这是什么错误啊?这是在qt的项目中遇到的,怎么解决?
quikfix库连接问题,求解
gcc -m64 -o test test.o -lstdc++ -ldl -pthread -L/home/quickfix-1.13.3/lib/libquickfix.a -Lquickfix 报错 test.o: In function `FIX::message_order::message_order(FIX::message_order const&)': /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../MessageSorters.h:121: undefined reference to `FIX::message_order::operator=(FIX::message_order const&)' test.o: In function `FIX::FieldMap::FieldMap(FIX::message_order const&)': /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../FieldMap.h:67: undefined reference to `vtable for FIX::FieldMap' test.o: In function `FIX::Message::Message(FIX::BeginString const&, FIX::MsgType const&)': /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:122: undefined reference to `FIX::FieldMap::~FieldMap()' /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:122: undefined reference to `FIX::FieldMap::~FieldMap()' /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:122: undefined reference to `FIX::FieldMap::~FieldMap()' test.o: In function `FIX::Message::~Message()': /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:57: undefined reference to `FIX::FieldMap::~FieldMap()' /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:57: undefined reference to `FIX::FieldMap::~FieldMap()' /home/ktgs/ktgs/src/ktgs/translate/src/third/quickfix/fix50sp2/../Message.h:57: undefined reference to `FIX::FieldMap::~FieldMap()' test.o:(.rodata._ZTIN3FIX7MessageE[_ZTIN3FIX7MessageE]+0x10): undefined reference to `typeinfo for FIX::FieldMap'
遇到问题qt报错:找不到符号
在写qt代码是遇到下面问题,恳请各位大神求解 09:08:54: 为项目test03执行步骤 ... 09:08:54: 正在启动 "/Users/lifei/Qt5.5.0/5.5/clang_64/bin/qmake" /Users/lifei/Qt_test/test03/test03.pro -r -spec macx-clang CONFIG+=debug CONFIG+=x86_64 09:08:54: 进程"/Users/lifei/Qt5.5.0/5.5/clang_64/bin/qmake"正常退出。 09:08:54: 正在启动 "/usr/bin/make" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wl,-rpath,/Users/lifei/Qt5.5.0/5.5/clang_64/lib -o test03.app/Contents/MacOS/test03 main.o mainwindow.o logindialog.o moc_mainwindow.o moc_logindialog.o -F/Users/lifei/Qt5.5.0/5.5/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL Undefined symbols for architecture x86_64: "LoginDialog::~LoginDialog()", referenced from: vtable for LoginDialog in moc_logindialog.o "LoginDialog::~LoginDialog()", referenced from: _main in main.o vtable for LoginDialog in moc_logindialog.o "non-virtual thunk to LoginDialog::~LoginDialog()", referenced from: vtable for LoginDialog in moc_logindialog.o "non-virtual thunk to LoginDialog::~LoginDialog()", referenced from: vtable for LoginDialog in moc_logindialog.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [test03.app/Contents/MacOS/test03] Error 1 09:08:55: 进程"/usr/bin/make"退出,退出代码 2 。 Error while building/deploying project test03 (kit: Desktop Qt 5.5.0 clang 64bit) When executing step "Make" 09:08:55: Elapsed time: 00:01.
C++初次使用虚函数出现报错不知如何处理
``` #include<iostream> using namespace std; class shape { public: virtual int area(); shape() { cout<<"调用shape构造函数"<<endl; } ~shape() { cout<<"调用shape析构函数"<<endl; } }; class rectangle: public shape { private: int x; int y; public: void in() { cout<<"请输入矩形长宽"<<endl; cin>>x>>y; } virtual int area(); rectangle() { cout<<"调用rectangle构造函数"<<endl; } ~rectangle() { cout<<"调用rectangle析构函数"<<endl; } }; class circle: public shape { private: float r; public: void in() { cout<<"请输入圆形的半径"<<endl; cin>>r; } virtual int area(); circle() { cout<<"调用circle构造函数"<<endl; } ~circle() { cout<<"调用circle析构函数"<<endl; } }; class square: public rectangle { private: int a; public: void in() { cout<<"请输入方形的边长"<<endl; cin>>a; } virtual int area(); square() { cout<<"调用square构造函数"<<endl; } ~square() { cout<<"调用square析构函数"<<endl; } }; int main(void) { circle c; rectangle r; square s; c.in(); r.in(); s.in(); cout<<"圆形面积"<<c.area()<<endl; cout<<"矩形面积"<<r.area()<<endl; cout<<"方形面积"<<s.area()<<endl; } int rectangle::area() { return x*y; } int circle::area() { return 3.14*r*r; } int square::area() { return a*a; } ``` 编译时报错信息为: C:\Users\Administrator\AppData\Local\Temp\ccLhjdDA.o In function `shape::shape()': 10 C:\Users\Administrator\Desktop\未命名2.cpp undefined reference to `vtable for shape' C:\Users\Administrator\AppData\Local\Temp\ccLhjdDA.o In function `shape::~shape()': 15 C:\Users\Administrator\Desktop\未命名2.cpp undefined reference to `vtable for shape' C:\Users\Administrator\Desktop\collect2.exe [Error] ld returned 1 exit status
#mysql mysql存储过程 表名作为变量的问题
大概意思是想要从TS_SCFZ表中的tabname字段来历遍所有表,从而查找是否有符合条件的记录 请大神帮帮忙 现在报错了 ``` drop procedure if exists deletecheck; delimiter // CREATE DEFINER = `root`@`%` PROCEDURE `deletecheck`(IN vahdm varchar(20)) BEGIN DECLARE done BOOLEAN DEFAULT FALSE; DECLARE vtable VARCHAR(24); DECLARE cur CURSOR FOR select tabname from TS_SCFZ where SFSC = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; read_loop: LOOP FETCH cur INTO vtable; IF done THEN LEAVE read_loop; END IF; START TRANSACTION; set @sqlcmd = concat("select (1) from ",vtable," where ahdm = vahdm"); prepare stmt from @sqlcmd; IF EXISTS(execute stmt) THEN select concat('table is ',vtable); ELSE select concat(vtable,' is clean'); deallocate prepare stmt; END IF; COMMIT; END LOOP read_loop; CLOSE cur; END ``` drop procedure if exists deletecheck; delimiter // CREATE DEFINER = `root`@`%` PROCEDURE `deletecheck`(IN vahdm varchar(20)) BEGIN DECLARE done BOOLEAN DEFAULT FALSE; DECLARE vtable VARCHAR(24); DECLARE cur CURSOR FOR select tabname from TS_SCFZ where SFSC = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; read_loop: LOOP FETCH cur INTO vtable; IF done THEN LEAVE read_loop; END IF; START TRANSACTION; set @sqlcmd = concat("select (1) from ",vtable," where ahdm = vahdm"); prepare stmt from @sqlcmd; IF EXISTS(execute stmt) THEN select concat('table is ',vtable); ELSE select concat(vtable,' is clean'); deallocate prepare stmt; END IF; COMMIT; END LOOP read_loop; CLOSE cur; END ``` [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'execute stmt) THEN select concat('table is ',vtable); ELSE sele' at line 16 ```
Ubuntu 16.04 编译 Ncurses 6.0 报错
### Ubuntu 16.04 LTS 编译 Ncurses 6.0 报错: ``` In file included from ./curses.priv.h:325:0, from ../ncurses/lib_gen.c:19: _24273.c:843:15: error: expected ‘)’ before ‘int’ ../include/curses.h:1631:56: note: in definition of macro ‘mouse_trafo’ #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) ^ Makefile:962: recipe for target '../objects/lib_gen.o' failed make[1]: *** [../objects/lib_gen.o] Error 1 make[1]: Leaving directory '/home/netsamir/Sofware/Tmux/ncurses-6.0/ncurses' Makefile:113: recipe for target 'all' failed make: *** [all] Error 2 ``` ### 系统配置 ``` $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) $ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ```
EventBus内存泄漏?解绑了,还有内存泄漏,什么原因
![图片说明](https://img-ask.csdn.net/upload/201908/23/1566545246_994834.jpg) ``` In com.aaa.aaa.aaa:1.1.6.1:20190823. * com.aaa.aaa.app.teamspace.activity.TeamSpaceCommunityActivity has leaked: * thread Thread.<Java Local> (named 'OkHttp https://starbucksuat.joywok.com/...') * ? TeamSpaceCommunityActivity.!(mBus)! * ? EventBus.!(typesBySubscriber)! * ? HashMap.!(table)! * ? array HashMap$Node[].!([6])! * ? HashMap$Node.!(key)! * ? SnsHelper.!(builderAdapter)! * ? BuilderAdapter.!(context)! * ? TeamSpaceCommunityActivity * Reference Key: 9ae9bd00-6db6-4efd-b114-150fddecf38e * Device: OPPO OPPO PBEM00 PBEM00 * Android Version: 8.1.0 API: 27 LeakCanary: 1.6.3 31007b4 * Durations: watch=17450ms, gc=524ms, heap dump=4298ms, analysis=27291ms * Details: * Instance of java.lang.Thread | static MAX_PRIORITY = 10 | static NANOS_PER_MILLI = 1000000 | static $class$iFields = 1891040404 | static EMPTY_STACK_TRACE = java.lang.StackTraceElement[0]@1890472248 (0x70ae5138) | static $class$sFields = 1891040240 | static $class$classFlags = 0 | static $class$classSize = 352 | static $class$virtualMethodsOffset = 39 | static $class$dexCache = java.lang.DexCache@1890209168 (0x70aa4d90) | static $class$clinitThreadId = 0 | static SUBCLASS_IMPLEMENTATION_PERMISSION = java.lang.RuntimePermission@1890472264 (0x70ae5148) | static $class$name = "java.lang.Thread" | static $class$numReferenceInstanceFields = 13 | static $class$shadow$_klass_ = java.lang.Class | static $class$dexTypeIndex = 362 | static $classOverhead = byte[184]@1890206153 (0x70aa41c9) | static $class$accessFlags = 524289 | static $class$dexClassDefIndex = 70 | static $class$vtable = null | static threadInitNumber = 36 | static $class$primitiveType = 131072 | static $class$status = 11 | static $class$shadow$_monitor_ = 536870912 | static threadSeqNumber = 5516 | static uncaughtExceptionPreHandler = com.android.internal.os.RuntimeInit$LoggingHandler@316825552 (0x12e25fd0) | static $class$classLoader = null | static $class$numReferenceStaticFields = 4 | static $class$objectSizeAllocFastPath = 136 | static NORM_PRIORITY = 5 | static $class$methods = 1891589704 | static MIN_PRIORITY = 1 | static $class$ifTable = java.lang.Object[2]@1890472224 (0x70ae5120) | static $class$objectSize = 132 | static defaultUncaughtExceptionHandler = com.loc.aj@316825528 (0x12e25fb8) | static $class$extData = null | static $class$componentType = null | static $class$copiedMethodsOffset = 75 | static $class$superClass = java.lang.Object | static $class$referenceInstanceOffsets = 8191 | blocker = null | blockerLock = java.lang.Object@316216056 (0x12d912f8) | contextClassLoader = dalvik.system.PathClassLoader@316953624 (0x12e45418) | daemon = false | eetop = 0 | group = java.lang.ThreadGroup@1890149224 (0x70a96368) | inheritableThreadLocals = java.lang.ThreadLocal$ThreadLocalMap@316216072 (0x12d91308) | inheritedAccessControlContext = java.security.AccessControlContext@316216064 (0x12d91300) | lock = j ``` mBus是EventBus.getDefault的一个实例,有解绑,这个页面没有使用stickyPost,但是还是有内存泄漏,各位有什么想法 mBus使用到的代码 ``` public EventBus mBus; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*** ***/ mBus = EventBus.getDefault(); mBus.register(this); } @Override protected void onPause() { super.onPause(); if (isFinishing()) { mBus.unregister(this); } } //接口调用处 @Override public void onCompleted() { super.onCompleted(); mBus.post(new TeamSpaceCommunityActivity.RefreshFinishEvent()); } ```
C#怎么读取oracle的long类型数据?
需要读取oracle视图sql语句,用PL/ Sql读取出来显示是Long类型,点击可以查看到sql,但是用C#程序怎么读取到呢?用OracleDataAdapter加载到DataTable显示是空字符串,用DataReader也显示是字符串类型且也是空字符串,明明查询结果应该是有数据的啊,服了Oracle,简单的结果读取都这么麻烦,望高手指教一下哦,以下附源码: OracleConnection conn = new OracleConnection(connString); string sql1 = string.Format("select text from user_views");//PL Sql中能查到数据,是大文本 //1.用OracleDataAdapter的方式 OracleDataAdapter vAdapter = new OracleDataAdapter(sql1, conn); DataTable vTable = new DataTable(); vAdapter.Fill(vTable); //行数与PL Sql读取的一样,但都是空字符串 this.dataGridView1.DataSource = vTable; //1.用DataReader的方式 var mCommand = new OracleCommand(); mCommand.Connection = conn; mCommand.CommandText = sql1; var tbResult = new DataTable("TB1"); try { conn.Open(); using (var reader = mCommand.ExecuteReader()) { var nFieldCount = reader.FieldCount; for (int intCounter = 0; intCounter < nFieldCount; ++intCounter) { tbResult.Columns.Add(reader.GetName(intCounter), reader.GetFieldType(intCounter)); } var objValues = new object[nFieldCount]; while (reader.Read()) { var t1 = reader.GetFieldType(0); //居然显示是String,但是却读不到字符串,PL/Sql显示是LONG类型 var arr1 = (byte[])reader[0]; //强制转换也不行,会报错:无法将类型为“System.String”的对象强制转换为类型“System.Byte[] var b1 = reader.GetOracleBlob(0); var s1 = reader.GetOracleString(0); var sr = reader.GetStream(0); } } } catch (Exception ex) { } finally { conn.Close(); }
编译llvm出现链接错误怎么办?
1,编译llvm,在编译进度100%时出现链接错误。 2,错误提示: ``` [100%] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/Indexing.cpp.o [100%] Linking CXX executable ../../../../bin/lldb-vscode [100%] Built target lldb-vscode [100%] Building CXX object tools/lldb/tools/driver/CMakeFiles/lldb.dir/Driver.cpp.o [100%] Linking CXX executable ../../../../bin/lldb [100%] Built target lldb [100%] Linking CXX shared library ../../../../lib/libclang.so ../../../../lib/libclangTidyAbseilModule.a(DurationAdditionCheck.cpp.o):在函数‘clang::tidy::abseil::DurationAdditionCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationAdditionCheck.cpp:(.text._ZN5clang4tidy6abseil21DurationAdditionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x362):对‘clang::tidy::abseil::getScaleForTimeInverse(llvm::StringRef)’未定义的引用 DurationAdditionCheck.cpp:(.text._ZN5clang4tidy6abseil21DurationAdditionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x37f):对‘clang::tidy::abseil::getTimeInverseForScale(clang::tidy::abseil::DurationScale)’未定义的引用 DurationAdditionCheck.cpp:(.text._ZN5clang4tidy6abseil21DurationAdditionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x485):对‘clang::tidy::abseil::rewriteExprFromNumberToDuration[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 DurationAdditionCheck.cpp:(.text._ZN5clang4tidy6abseil21DurationAdditionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xa91):对‘clang::tidy::abseil::rewriteExprFromNumberToDuration[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationComparisonCheck.cpp.o):在函数‘clang::tidy::abseil::DurationComparisonCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil23DurationComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1ab):对‘clang::tidy::abseil::getScaleForDurationInverse(llvm::StringRef)’未定义的引用 DurationComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil23DurationComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1bf):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 DurationComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil23DurationComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1cf):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 DurationComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil23DurationComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x2fd):对‘clang::tidy::abseil::rewriteExprFromNumberToDuration[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 DurationComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil23DurationComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x315):对‘clang::tidy::abseil::rewriteExprFromNumberToDuration[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationFactoryFloatCheck.cpp.o):在函数‘clang::tidy::abseil::DurationFactoryFloatCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationFactoryFloatCheck.cpp:(.text._ZN5clang4tidy6abseil25DurationFactoryFloatCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x157):对‘clang::tidy::abseil::stripFloatCast[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const&)’未定义的引用 DurationFactoryFloatCheck.cpp:(.text._ZN5clang4tidy6abseil25DurationFactoryFloatCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x4a7):对‘clang::tidy::abseil::stripFloatLiteralFraction[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const&)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationFactoryScaleCheck.cpp.o):在函数‘clang::tidy::abseil::DurationFactoryScaleCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationFactoryScaleCheck.cpp:(.text._ZN5clang4tidy6abseil25DurationFactoryScaleCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x10a):对‘clang::tidy::abseil::IsLiteralZero(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const&)’未定义的引用 DurationFactoryScaleCheck.cpp:(.text._ZN5clang4tidy6abseil25DurationFactoryScaleCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x497):对‘clang::tidy::abseil::getDurationFactoryForScale(clang::tidy::abseil::DurationScale)’未定义的引用 DurationFactoryScaleCheck.cpp:(.text._ZN5clang4tidy6abseil25DurationFactoryScaleCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xde5):对‘clang::tidy::abseil::getDurationFactoryForScale(clang::tidy::abseil::DurationScale)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(TimeComparisonCheck.cpp.o):在函数‘clang::tidy::abseil::TimeComparisonCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: TimeComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil19TimeComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1ab):对‘clang::tidy::abseil::getScaleForTimeInverse(llvm::StringRef)’未定义的引用 TimeComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil19TimeComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1bf):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 TimeComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil19TimeComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1cf):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 TimeComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil19TimeComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x2fd):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeComparisonCheck.cpp:(.text._ZN5clang4tidy6abseil19TimeComparisonCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x315):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 ../../../../lib/libclangTidyAndroidModule.a(AndroidTidyModule.cpp.o):在函数‘std::_Function_handler<clang::tidy::ClangTidyCheck* (llvm::StringRef, clang::tidy::ClangTidyContext*), void clang::tidy::ClangTidyCheckFactories::registerCheck<clang::tidy::android::CloexecOpenCheck>(llvm::StringRef)::{lambda(llvm::StringRef, clang::tidy::ClangTidyContext*)#1}>::_M_invoke(std::_Any_data const&, llvm::StringRef&&, clang::tidy::ClangTidyContext*&&)’中: AndroidTidyModule.cpp:(.text._ZNSt17_Function_handlerIFPN5clang4tidy14ClangTidyCheckEN4llvm9StringRefEPNS1_16ClangTidyContextEEZNS1_23ClangTidyCheckFactories13registerCheckINS1_7android16CloexecOpenCheckEEEvS5_EUlS5_S7_E_E9_M_invokeERKSt9_Any_dataOS5_OS7_[_ZNSt17_Function_handlerIFPN5clang4tidy14ClangTidyCheckEN4llvm9StringRefEPNS1_16ClangTidyContextEEZNS1_23ClangTidyCheckFactories13registerCheckINS1_7android16CloexecOpenCheckEEEvS5_EUlS5_S7_E_E9_M_invokeERKSt9_Any_dataOS5_OS7_]+0x36):对‘vtable for clang::tidy::android::CloexecOpenCheck’未定义的引用 ../../../../lib/libclangTidyBugproneModule.a(BugproneTidyModule.cpp.o):在函数‘std::_Function_handler<clang::tidy::ClangTidyCheck* (llvm::StringRef, clang::tidy::ClangTidyContext*), void clang::tidy::ClangTidyCheckFactories::registerCheck<clang::tidy::bugprone::BoolPointerImplicitConversionCheck>(llvm::StringRef)::{lambda(llvm::StringRef, clang::tidy::ClangTidyContext*)#1}>::_M_invoke(std::_Any_data const&, llvm::StringRef&&, clang::tidy::ClangTidyContext*&&)’中: BugproneTidyModule.cpp:(.text._ZNSt17_Function_handlerIFPN5clang4tidy14ClangTidyCheckEN4llvm9StringRefEPNS1_16ClangTidyContextEEZNS1_23ClangTidyCheckFactories13registerCheckINS1_8bugprone34BoolPointerImplicitConversionCheckEEEvS5_EUlS5_S7_E_E9_M_invokeERKSt9_Any_dataOS5_OS7_[_ZNSt17_Function_handlerIFPN5clang4tidy14ClangTidyCheckEN4llvm9StringRefEPNS1_16ClangTidyContextEEZNS1_23ClangTidyCheckFactories13registerCheckINS1_8bugprone34BoolPointerImplicitConversionCheckEEEvS5_EUlS5_S7_E_E9_M_invokeERKSt9_Any_dataOS5_OS7_]+0x36):对‘vtable for clang::tidy::bugprone::BoolPointerImplicitConversionCheck’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationConversionCastCheck.cpp.o):在函数‘clang::tidy::abseil::DurationConversionCastCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationConversionCastCheck.cpp:(.text._ZN5clang4tidy6abseil27DurationConversionCastCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xcf):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 DurationConversionCastCheck.cpp:(.text._ZN5clang4tidy6abseil27DurationConversionCastCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x279):对‘clang::tidy::abseil::getScaleForDurationInverse(llvm::StringRef)’未定义的引用 DurationConversionCastCheck.cpp:(.text._ZN5clang4tidy6abseil27DurationConversionCastCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x564):对‘clang::tidy::abseil::getDurationInverseForScale(clang::tidy::abseil::DurationScale)’未定义的引用 DurationConversionCastCheck.cpp:(.text._ZN5clang4tidy6abseil27DurationConversionCastCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x924):对‘clang::tidy::abseil::getDurationInverseForScale(clang::tidy::abseil::DurationScale)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationSubtractionCheck.cpp.o):在函数‘clang::tidy::abseil::DurationSubtractionCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil24DurationSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x191):对‘clang::tidy::abseil::getScaleForDurationInverse(llvm::StringRef)’未定义的引用 DurationSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil24DurationSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1c2):对‘clang::tidy::abseil::rewriteExprFromNumberToDuration[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(DurationUnnecessaryConversionCheck.cpp.o):在函数‘clang::tidy::abseil::DurationUnnecessaryConversionCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: DurationUnnecessaryConversionCheck.cpp:(.text._ZN5clang4tidy6abseil34DurationUnnecessaryConversionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1af):对‘clang::tidy::abseil::isInMacro(clang::ast_matchers::MatchFinder::MatchResult const&, clang::Expr const*)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(TimeSubtractionCheck.cpp.o):在函数‘clang::tidy::abseil::TimeSubtractionCheck::registerMatchers(clang::ast_matchers::MatchFinder*)’中: TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck16registerMatchersEPNS_12ast_matchers11MatchFinderE+0x208):对‘clang::tidy::abseil::getScaleForTimeInverse(llvm::StringRef)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck16registerMatchersEPNS_12ast_matchers11MatchFinderE+0x89c):对‘clang::tidy::abseil::getDurationFactoryForScale(clang::tidy::abseil::DurationScale)’未定义的引用 ../../../../lib/libclangTidyAbseilModule.a(TimeSubtractionCheck.cpp.o):在函数‘clang::tidy::abseil::TimeSubtractionCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&)’中: TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1a4):对‘clang::tidy::abseil::getScaleForTimeInverse(llvm::StringRef)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x26a):对‘clang::tidy::abseil::getDurationFactoryForScale(clang::tidy::abseil::DurationScale)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x732):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x782):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xd0a):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xd51):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0xd89):对‘clang::tidy::abseil::getDurationInverseForScale(clang::tidy::abseil::DurationScale)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x1061):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 TimeSubtractionCheck.cpp:(.text._ZN5clang4tidy6abseil20TimeSubtractionCheck5checkERKNS_12ast_matchers11MatchFinder11MatchResultE+0x10aa):对‘clang::tidy::abseil::rewriteExprFromNumberToTime[abi:cxx11](clang::ast_matchers::MatchFinder::MatchResult const&, clang::tidy::abseil::DurationScale, clang::Expr const*)’未定义的引用 collect2: 错误:ld 返回 1 make[2]: *** [lib/libclang.so.10] 错误 1 make[1]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/all] 错误 2 make: *** [all] 错误 2 ``` 求救
想使用linphone的BLF功能(检测其他用户的状态)
我再公司实习做一个linphone产品的技改,这次任务是要实现一个能检测其他用户状态的功能,我再网上搜了很久才找到linphone里面有一个示例程序buddy status.c文件,但是不知道怎么使用。请各位好汉帮忙,代码如下,也不是很长: [buddy_status.c(源代码网址,应该比我清晰)](http://www.linphone.org/docs/liblinphone/group__buddy__tutorials.html "") ```c++ /* buddy_status Copyright (C) 2010 Belledonne Communications SARL 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef IN_LINPHONE #include "linphonecore.h" #else #include "linphone/linphonecore.h" #endif #include <signal.h> static bool_t running=TRUE; static void stop(int signum){ running=FALSE; } static void notify_presence_recv_updated (LinphoneCore *lc, LinphoneFriend *friend) { const LinphonePresenceModel* model = linphone_friend_get_presence_model(friend); const LinphoneAddress* friend_address = linphone_friend_get_address(friend); LinphonePresenceActivity *activity = linphone_presence_model_get_activity(model); char *activity_str = linphone_presence_activity_to_string(activity); printf("New state state [%s] for user id [%s] \n" ,activity_str ,linphone_address_as_string (friend_address)); } static void new_subscription_requested (LinphoneCore *lc, LinphoneFriend *friend, const char* url) { const LinphoneAddress* friend_address = linphone_friend_get_address(friend); printf(" [%s] wants to see your status, accepting\n" ,linphone_address_as_string (friend_address)); linphone_friend_edit(friend); /* start editing friend */ linphone_friend_set_inc_subscribe_policy(friend,LinphoneSPAccept); /* Accept incoming subscription request for this friend*/ linphone_friend_done(friend); /*commit change*/ linphone_core_add_friend(lc,friend); /* add this new friend to the buddy list*/ } static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message){ printf("New registration state %s for user id [%s] at proxy [%s]" ,linphone_registration_state_to_string(cstate) ,linphone_proxy_config_get_identity(cfg) ,linphone_proxy_config_get_addr(cfg)); } LinphoneCore *lc; int main(int argc, char *argv[]){ LinphoneCoreVTable vtable={0}; char* dest_friend=NULL; char* identity=NULL; char* password=NULL; LinphoneFriend* my_friend=NULL; /* takes sip uri identity from the command line arguments */ if (argc>1){ dest_friend=argv[1]; } /* takes sip uri identity from the command line arguments */ if (argc>2){ identity=argv[2]; } /* takes password from the command line arguments */ if (argc>3){ password=argv[3]; } signal(SIGINT,stop); //#define DEBUG #ifdef DEBUG linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/ #endif /* Fill the LinphoneCoreVTable with application callbacks. All are optional. Here we only use the both notify_presence_received and new_subscription_requested callbacks in order to get notifications about friend status. */ vtable.notify_presence_received=notify_presence_recv_updated; vtable.new_subscription_requested=new_subscription_requested; vtable.registration_state_changed=registration_state_changed; /*just in case sip proxy is used*/ /* Instantiate a LinphoneCore object given the LinphoneCoreVTable */ lc=linphone_core_new(&vtable,NULL,NULL,NULL); /*sip proxy might be requested*/ if (identity != NULL) { /*create proxy config*/ LinphoneProxyConfig* proxy_cfg = linphone_proxy_config_new(); /*parse identity*/ LinphoneAddress *from = linphone_address_new(identity); LinphoneAuthInfo *info; if (from==NULL){ printf("%s not a valid sip uri, must be like sip:toto@sip.linphone.org \n",identity); goto end; } if (password!=NULL){ info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/ linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/ } // configure proxy entries linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/ linphone_proxy_config_set_server_addr(proxy_cfg,linphone_address_get_domain(from)); /* we assume domain = proxy server address*/ linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/ linphone_proxy_config_enable_publish(proxy_cfg,TRUE); /* enable presence satus publication for this proxy*/ linphone_address_destroy(from); /*release resource*/ linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/ linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/ /* Loop until registration status is available */ do { linphone_core_iterate(lc); /* first iterate initiates registration */ ms_usleep(100000); } while( running && linphone_proxy_config_get_state(proxy_cfg) == LinphoneRegistrationProgress); } if (dest_friend) { my_friend = linphone_friend_new_with_address(dest_friend); /*creates friend object from dest*/ if (my_friend == NULL) { printf("bad destination uri for friend [%s]\n",dest_friend); goto end; } linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/ linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* Accept incoming subscription request for this friend*/ linphone_core_add_friend(lc,my_friend); /* add my friend to the buddy list, initiate SUBSCRIBE message*/ } /*set my status to online*/ linphone_core_set_presence_model(lc, linphone_presence_model_new_with_activity(LinphonePresenceActivityOnline, NULL)); /* main loop for receiving notifications and doing background linphone core work: */ while(running){ linphone_core_iterate(lc); /* first iterate initiates subscription */ ms_usleep(50000); } /* change my presence status to offline*/ linphone_core_set_presence_model(lc, linphone_presence_model_new_with_activity(LinphonePresenceActivityOffline, NULL)); linphone_core_iterate(lc); /* just to make sure new status is initiate message is issued */ linphone_friend_edit(my_friend); /* start editing friend */ linphone_friend_enable_subscribes(my_friend,FALSE); /*disable subscription for this friend*/ linphone_friend_done(my_friend); /*commit changes triggering an UNSUBSCRIBE message*/ linphone_core_iterate(lc); /* just to make sure unsubscribe message is issued */ end: printf("Shutting down...\n"); linphone_core_destroy(lc); printf("Exited\n"); return 0; } ```
caffe安装过程中boost::未定义问题
各位大神,我在ubuntu16.04中安装caffe,进行到make all的时候报了如下错误: CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp .build_release/src/caffe/test/test_benchmark.o:在函数‘void boost::this_thread::sleep<boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000l> >(boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000l> const&)’中: test_benchmark.cpp:(.text._ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000EEEEEvRKT_[_ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000EEEEEvRKT_]+0x25a):对‘boost::this_thread::hidden::sleep_until(timespec const&)’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::start_thread_noexcept()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::detach()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::detail::thread_data_base::~thread_data_base()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::native_handle()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::interrupt()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::this_thread::interruption_point()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::detail::set_tss_data(void const*, boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::interruption_requested() const’未定义的引用 .build_release/lib/libcaffe.so:对‘vtable for boost::detail::thread_data_base’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::detail::get_current_thread_data()’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::joinable() const’未定义的引用 .build_release/lib/libcaffe.so:对‘typeinfo for boost::detail::thread_data_base’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::detail::get_tss_data(void const*)’未定义的引用 .build_release/lib/libcaffe.so:对‘boost::thread::join_noexcept()’未定义的引用 collect2: error: ld returned 1 exit status Makefile:603: recipe for target '.build_release/test/test_all.testbin' failed make: *** [.build_release/test/test_all.testbin] Error 1 一直没有找到有效的解决办法.麻烦遇到过的朋友指点迷津.定重谢!
ie bho 插件:如何获得浏览器滚动条变化事件
我已经写了一个简单的bho。 目的是知道浏览器的滚动条是否滚动。 DISPID_DOCUMENTCOMPLETE事件可以获取。 DISPID_HTMLWINDOWEVENTS2_ONSCROLL 事件不能获得。 class部分: class ATL_NO_VTABLE Chellobho : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<Chellobho, &CLSID_hellobho>, public IObjectWithSiteImpl<Chellobho>, public IDispatchImpl<Ihellobho, &IID_Ihellobho, &LIBID_flash_bhoLib, /*wMajor =*/ 1, /*wMinor =*/ 0>, public IDispEventImpl<1, Chellobho, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 1>, public IDispEventImpl<3, Chellobho, &DIID_HTMLWindowEvents2, &LIBID_MSHTML, 4, 0> 注册部分: BEGIN_SINK_MAP(Chellobho) SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOCUMENTCOMPLETE, OnDocumentComplete) SINK_ENTRY_EX(3, DIID_HTMLWindowEvents2, DISPID_HTMLWINDOWEVENTS2_ONSCROLL, OnScroll) END_SINK_MAP() SetSite函数: STDMETHODIMP Chellobho::SetSite(IUnknown* pUnkSite) { MessageBox( NULL, L"SetSite", L"SetSite", MB_OK ); IDispatch *pDisp2; CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML2; CComPtr<IHTMLWindow2> htmlWindow; if (pUnkSite != NULL) { // Cache the pointer to IWebBrowser2. HRESULT hr = pUnkSite->QueryInterface(IID_IWebBrowser2, (void **)&m_spWebBrowser); if (SUCCEEDED(hr)) { hr = IDispEventSimpleImpl<1,Chellobho,&DIID_DWebBrowserEvents2>::DispEventAdvise(m_spWebBrowser); hr = m_spWebBrowser->get_Document(&pDisp2); //test spHTML2 = pDisp2; if ( spHTML2 ) { spHTML2->get_parentWindow(&htmlWindow); hr = IDispEventSimpleImpl<3,Chellobho,&DIID_HTMLWindowEvents2>::DispEventAdvise(htmlWindow); if (SUCCEEDED(hr)) { m_fAdvised = TRUE; } } } } else { // Unregister event sink. if (m_fAdvised) { IDispEventSimpleImpl<1,Chellobho,&DIID_DWebBrowserEvents2>::DispEventUnadvise(m_spWebBrowser); IDispEventSimpleImpl<3,Chellobho,&DIID_HTMLWindowEvents2>::DispEventUnadvise(htmlWindow); m_fAdvised = FALSE; } // Release cached pointers and other resources here. m_spWebBrowser.Release(); } // Call base class implementation. return IObjectWithSiteImpl<Chellobho>::SetSite(pUnkSite); }
openstack云主机起不来,具体看下边问题和日志
``` 456 ID 77553db8-8258-4e53-b63c-1e79271ab089 状态 错误 可用域 nova 已创建 2019年4月11日 21:57 从创建以来 0 分钟 主机 - 故障 消息 No valid host was found. There are not enough hosts available. 编码 500 详情 File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 392, in build_instances context, request_spec, filter_properties) File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 436, in _schedule_instances hosts = self.scheduler_client.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/utils.py", line 372, in wrapped return func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 51, in select_destinations return self.queryclient.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/__init__.py", line 37, in __run_method return getattr(self.instance, __name)(*args, **kwargs) File "/usr/lib/python2.7/site-packages/nova/scheduler/client/query.py", line 32, in select_destinations return self.scheduler_rpcapi.select_destinations(context, spec_obj) File "/usr/lib/python2.7/site-packages/nova/scheduler/rpcapi.py", line 121, in select_destinations return cctxt.call(ctxt, 'select_destinations', **msg_args) File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/client.py", line 158, in call retry=self.retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/transport.py", line 90, in _send timeout=timeout, retry=retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 470, in send retry=retry) File "/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 461, in _send raise result 已创建 2019年4月11日 21:57 规格 云主机类型名称 云主机1型 云主机类型ID 8eda3b60-4832-4ab0-8f9a-3ef9604b9b8e 内存 2GB VCPU数量 3 VCPU 磁盘 20GB 临时磁盘 2GB IP地址 外网 10.0.0.109 Sharednet1 192.168.200.111 安全组 default 允许 IPv4 from default 允许 IPv4 icmp from default 允许 IPv4 icmp to 0.0.0.0/0 允许 IPv6 to ::/0 允许 IPv4 to 0.0.0.0/0 允许 IPv6 from default 元数据 密钥对名称 无 镜像名称 CentOS6.5 镜像ID 873a7d1e-16d2-49e3-85c1-60e880253dcc ``` ``` 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [req-4b1cd3d0-1b63-4f3d-a101-482dc9b7cdc2 73392af71b774eae8ec398adf423d560 b9670c01673c47fa8c24e854fdf9f737 - - -] [instance: 77553db8-8258-4e53-b63c-1e79271ab089] Instance failed to spawn 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] Traceback (most recent call last): 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2218, in _build_resources 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] yield resources 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2064, in _build_and_run_instance 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] block_device_info=block_device_info) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2780, in spawn 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] block_device_info=block_device_info) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4924, in _create_domain_and_network 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] xml, pause=pause, power_on=power_on) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4855, in _create_domain 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] guest.launch(pause=pause) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/guest.py", line 142, in launch 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] self._encoded_xml, errors='ignore') 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] self.force_reraise() 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] six.reraise(self.type_, self.value, self.tb) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/guest.py", line 137, in launch 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] return self._domain.createWithFlags(flags) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] result = proxy_call(self._autowrap, f, *args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] rv = execute(f, *args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] six.reraise(c, e, tb) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] rv = meth(*args, **kwargs) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1110, in createWithFlags 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self) 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] libvirtError: internal error: qemu unexpectedly closed the monitor: 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] (process:51935): GLib-WARNING **: 06:57:57.413: gmem.c:489: custom memory allocation vtable not supported 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] 2019-04-11T21:57:57.529392Z qemu-kvm: CPU feature arat not found 2019-04-12 06:57:57.825 10877 ERROR nova.compute.manager [instance: 77553db8-8258-4e53-b63c-1e79271ab089] ```
Web调用ATL ActiveX控件,IE8无法打开网页,IE7可以运行,但提示内存访问冲突!
我的参考文章http://blog.csdn.net/u010258235/article/details/16823543,自己按照这个步骤试了一下,但是打开html网页时提示如下: Internet Explorer 已经为了帮助保护您的计算机而关闭此网页 运行不正常的加载项或恶意加载项导致 Internet Explorer 关闭此网页。 您可以执行以下操作: 转到主页 尝试返回查看的页面 更多信息 我在工具-〉Internet选项-〉安全中将安全级别中所有ActiveX相关的选项都启用了以后,IE仍然提示“当前安全设置会使计算机有风险”,继续运行后还是提示修复设置,网页上仍然显示上面的“关闭网页”,上面的示例还有网上其他文章里不是说用IObjectSafety就可以了吗?可我将IE安全级别设到最低还是无法打开网页!换成IE7后没有安全问题了,可以运行,但是提示内存访问冲突,断点在调用外部DLL时: 我的源代码如下: // DTUTest.h : CDTUTest 的声明 #pragma once #include "resource.h" // 主符号 #include "windows.h" #include "AOETest_i.h" #include "_IDTUTestEvents_CP.h" #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) #error "Windows CE 平台(如不提供完全 DCOM 支持的 Windows Mobile 平台)上无法正确支持单线程 COM 对象。定义 _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA 可强制 ATL 支持创建单线程 COM 对象实现并允许使用其单线程 COM 对象实现。rgs 文件中的线程模型已被设置为“Free”,原因是该模型是非 DCOM Windows CE 平台支持的唯一线程模型。" #endif // CDTUTest class ATL_NO_VTABLE CDTUTest : public IObjectSafetyImpl<CDTUTest, INTERFACESAFE_FOR_UNTRUSTED_CALLER| INTERFACESAFE_FOR_UNTRUSTED_DATA>, // 安全提示解除,--当运行浏览器调用时,不会提示安全问题。 public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CDTUTest, &CLSID_DTUTest>, public IConnectionPointContainerImpl<CDTUTest>, public CProxy_IDTUTestEvents<CDTUTest>, public IObjectWithSiteImpl<CDTUTest>, public IDispatchImpl<IDTUTest, &IID_IDTUTest, &LIBID_AOETestLib, /*wMajor =*/ 1, /*wMinor =*/ 0> { public: typedef BOOL (*DTUStartServiceFunc)(USHORT); // 定义一个指向DSStartService函数地址的指针类型。 HMODULE hDllModule; // 指向动态库的句柄 DTUStartServiceFunc _DTUStartServiceFunc; CDTUTest() { hDllModule = LoadLibrary((LPCWSTR) "DTUdll.dll"); // 装载动态库 if(hDllModule != NULL) // 成功调用动态库 _DTUStartServiceFunc = (DTUStartServiceFunc)GetProcAddress(hDllModule,"DSStartService"); // 从动态库中取得DSStartService函数的地址 else FreeLibrary(hDllModule); // 未成功调用动态库,释放资源 } DECLARE_REGISTRY_RESOURCEID(IDR_DTUTEST) BEGIN_COM_MAP(CDTUTest) COM_INTERFACE_ENTRY(IDTUTest) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(IConnectionPointContainer) COM_INTERFACE_ENTRY(IObjectWithSite) COM_INTERFACE_ENTRY(IObjectSafety) // 安全提示解除,--当运行浏览器调用时,不会提示安全问题。 END_COM_MAP() BEGIN_CONNECTION_POINT_MAP(CDTUTest) CONNECTION_POINT_ENTRY(__uuidof(_IDTUTestEvents)) END_CONNECTION_POINT_MAP() // STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: STDMETHOD(DTUStart)(USHORT DTUListenPort); }; OBJECT_ENTRY_AUTO(__uuidof(DTUTest), CDTUTest) ------------------------------------------------------------------------------------------------------------------------------ // DTUTest.cpp : CDTUTest 的实现 #include "stdafx.h" #include "DTUTest.h" // CDTUTest STDMETHODIMP CDTUTest::DTUStart(USHORT DTUListenPort) { // TODO: 在此添加实现代码 if(_DTUStartServiceFunc != NULL) // 是否成功取得函数地址 { BOOL StartRes = this->_DTUStartServiceFunc(DTUListenPort); // 错误在这一行,IE提示内存访问冲突 } else { } this->_AtlFinalRelease(); return S_OK; } 调用的DLL中DSStartService函数的声明: BOOL DSStartService(u16t uiListenPort);
ATL COM组件开发 遇到 ATL::CComContainedObject不能实例化抽象类
idl定义类型库 ``` // ATLProject2.idl : ATLProject2的 IDL 源 // // 此文件将由 MIDL 工具处理以 // 产生类型库(ATLProject2.tlb)和封送处理代码。 import "oaidl.idl"; import "ocidl.idl"; import "Application.idl"; import "Document.idl"; [ object, uuid(a817e7a2-43fa-11d0-9e44-00aa00b6770a), dual, pointer_default(unique) ] interface IComponentRegistrar : IDispatch { [id(1)] HRESULT Attach([in] BSTR bstrPath); [id(2)] HRESULT RegisterAll(); [id(3)] HRESULT UnregisterAll(); [id(4)] HRESULT GetComponents([out] SAFEARRAY(BSTR)* pbstrCLSIDs, [out] SAFEARRAY(BSTR)* pbstrDescriptions); [id(5)] HRESULT RegisterComponent([in] BSTR bstrCLSID); [id(6)] HRESULT UnregisterComponent([in] BSTR bstrCLSID); }; [ uuid(67E2030B-5BFD-4DF7-8F5F-3FF1EF570E61), version(1.0), custom(a817e7a1-43fa-11d0-9e44-00aa00b6770a,"{13FEC681-4F90-427D-BA2F-CF36E0190E55}") ] library ATLProject2Lib { importlib("stdole2.tlb"); [ uuid(13FEC681-4F90-427D-BA2F-CF36E0190E55) ] coclass CompReg { [default] interface IComponentRegistrar; }; [ uuid(8DAE4A62-CB32-4B6E-B3CF-2F6A8D3DC782) ] coclass XApplication { [default] interface Application; }; [ uuid(D3E42200-28B3-4C47-BB4D-1480BF41477E) ] coclass XDocument { [default] interface _Document; }; }; ``` idl定义Applicatioin接口 ``` import "oaidl.idl"; import "ocidl.idl"; import "Document.idl"; interface _Document; [ object, uuid(73E316A4-83F6-4C62-AB61-994BCF0103C5), dual, nonextensible, pointer_default(unique) ] interface Application : IDispatch { [propget, id(1)] HRESULT ActiveDocument([out, retval] _Document** pVal); }; ``` Application实现类定义 ``` // XApplication.h : CXApplication 的声明 #pragma once #include "resource.h" // 主符号 #include "ATLProject2_i.h" #include "Application.h" #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) #error "Windows CE 平台(如不提供完全 DCOM 支持的 Windows Mobile 平台)上无法正确支持单线程 COM 对象。定义 _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA 可强制 ATL 支持创建单线程 COM 对象实现并允许使用其单线程 COM 对象实现。rgs 文件中的线程模型已被设置为“Free”,原因是该模型是非 DCOM Windows CE 平台支持的唯一线程模型。" #endif using namespace ATL; // CXApplication class ATL_NO_VTABLE CXApplication : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CXApplication, &CLSID_XApplication>, public IDispatchImpl<Application, &IID_Application, &LIBID_ATLProject2Lib, /*wMajor =*/ 1, /*wMinor =*/ 0> { public: CXApplication() { } DECLARE_REGISTRY_RESOURCEID(IDR_XAPPLICATION) BEGIN_COM_MAP(CXApplication) COM_INTERFACE_ENTRY(Application) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: STDMETHOD(get_ActiveDocument)(_Document* pVal); }; OBJECT_ENTRY_AUTO(__uuidof(XApplication), CXApplication) ``` Document接口定义 ``` import "oaidl.idl"; import "ocidl.idl"; import "Application.idl"; interface Application; [ object, uuid(2D856942-3E0B-4E57-AB8C-A504AA6F46CA), dual, nonextensible, pointer_default(unique) ] interface _Document : IDispatch { [propget, id(1)] HRESULT ActiveApplication([out, retval] Application** pVal); }; ``` Docuement类实现定义 ``` // XDocument.h : CXDocument 的声明 #pragma once #include "resource.h" // 主符号 #include "ATLProject2_i.h" #include "Document.h" #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) #error "Windows CE 平台(如不提供完全 DCOM 支持的 Windows Mobile 平台)上无法正确支持单线程 COM 对象。定义 _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA 可强制 ATL 支持创建单线程 COM 对象实现并允许使用其单线程 COM 对象实现。rgs 文件中的线程模型已被设置为“Free”,原因是该模型是非 DCOM Windows CE 平台支持的唯一线程模型。" #endif using namespace ATL; // CXDocument class ATL_NO_VTABLE CXDocument : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CXDocument, &CLSID_XDocument>, public IDispatchImpl<_Document, &IID__Document, &LIBID_ATLProject2Lib, /*wMajor =*/ 1, /*wMinor =*/ 0> { public: CXDocument() { } DECLARE_REGISTRY_RESOURCEID(IDR_XDOCUMENT) BEGIN_COM_MAP(CXDocument) COM_INTERFACE_ENTRY(_Document) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: STDMETHOD(get_Application)(Application* pVal); }; OBJECT_ENTRY_AUTO(__uuidof(XDocument), CXDocument) ```
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
有哪些让程序员受益终生的建议
从业五年多,辗转两个大厂,出过书,创过业,从技术小白成长为基层管理,联合几个业内大牛回答下这个问题,希望能帮到大家,记得帮我点赞哦。 敲黑板!!!读了这篇文章,你将知道如何才能进大厂,如何实现财务自由,如何在工作中游刃有余,这篇文章很长,但绝对是精品,记得帮我点赞哦!!!! 一腔肺腑之言,能看进去多少,就看你自己了!!! 目录: 在校生篇: 为什么要尽量进大厂? 如何选择语言及方...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
Python 编程开发 实用经验和技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法和技巧,包括小数保留指定位小数、判断变量的数据类型、类方法@classmethod、制表符中文对齐、遍历字典、datetime.timedelta的使用等,会持续更新......
YouTube排名第一的励志英文演讲《Dream(梦想)》
Idon’t know what that dream is that you have, I don't care how disappointing it might have been as you've been working toward that dream,but that dream that you’re holding in your mind, that it’s po...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车?某胡同口的煎饼摊一年能卖出多少个煎饼?深圳有多少个产品经理?一辆公交车里能装下多少个乒乓球?一个正常成年人有多少根头发?这类估算问题,被称为费米问题,是以科学家费米命名的。为什么面试会问这种问题呢?这类问题能把两类人清楚地区分出来。一类是具有文科思维的人,擅长赞叹和模糊想象,它主要依靠的是人的第一反应和直觉,比如小孩...
相关热词 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件 c#注册dll文件 c#安装.net
立即提问