linker

Building and linking test code for Crypto++

早过忘川 提交于 2019-12-25 00:19:54
问题 I'm trying to write some simple test code for the Crypto++ library for a project. I have yet to manage to get my own code to build though. It compiles fine, the problem comes in linking. I'm still pretty new to Visual Studios, but I'm using VS10. The errors I'm getting are: 1>sec_test.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CryptoPP::DES::Base::ProcessAndXorBlock(unsigned char const *,unsigned char const *,unsigned char *)const " (?ProcessAndXorBlock

Multiple definition of lots of std:: functions when linking

人走茶凉 提交于 2019-12-24 22:35:14
问题 I am trying to integrate some external code into my application. My code was pure C, but the new code is C++, so I simply renamed my C files to .cc and compiled the whole thing with g++. It compiles fine, but I get a crapton of link errors : CMakeFiles/svrt.dir/svrtH_generator.cc.o: In function `operator new(unsigned long, void*)': svrtH_generator.cc:(.text+0x0): multiple definition of `operator new(unsigned long, void*)' CMakeFiles/svrt.dir/svrt_generator.cc.o:svrt_generator.cc:(.text+0x0):

How can I resolve LNK4254 warnings in link.exe?

☆樱花仙子☆ 提交于 2019-12-24 22:23:54
问题 I'm trying to compile an open-source project. One of the steps involves running a .mak file which has the following line: kbddvp32.dll: kbddvp32.obj kbddvp.res $(LINK32) -nologo -dll -base:0x5FFF0000 -subsystem:native -def:kbddvp.def -noentry \ -merge:.edata=.data -merge:.rdata=.data -merge:.text=.data -merge:.bss=.data \ -ignore:4078,4070 -section:.data,re -opt:nowin98 -stack:0x40000,0x1000 -opt:ref,icf \ -release -out:$@ $** ... that becomes: link -machine:ix86 -nologo -dll -base:0x5FFF0000

C++ linker strange behavior: static member variable

南楼画角 提交于 2019-12-24 21:37:53
问题 I'm stuck in a linker error and need some help. I'm using MSVC. At the beginning, I made this: /* graphics_app.h */ #ifndef DK_GRAPHICS_APP_H #define DK_GRAPHICS_APP_H ... class GraphicsApp { private: static GraphicsApp* self; ... }; GraphicsApp* GraphicsApp::self = nullptr; #endif /* DK_GRAPHICS_APP_H */ This header used to work... and I made some improvements, but nothing about that static member changed. but unexpectedly I got this linker error message: LNK2005 "private: static class

What am I missing from my environment variables for my linker to fail with LNK1181?

拈花ヽ惹草 提交于 2019-12-24 21:23:10
问题 I have a Qt project which I have had a debug console displayed whilst I am developing, I am about to ship the product to I removed the qmake console command: CONFIG += console However when I do that I get the following error: link /LIBPATH:"c:\Qt\4.5.0\lib" /NOLOGO /INCREMENTAL:NO /LTCG /MANIFEST /MANIFESTFILE:"./_obj/win32\Lynx.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken=

Static Global variable in Obj-C?

隐身守侯 提交于 2019-12-24 19:39:57
问题 // in ClassA.h static NSString *globalStr = @"HelloWorld"; @interface ClassA ... @end // in ClassB.h #include "ClassA.h" // in ClassB.m ... NSLog(@"The global string: %@", globalStr); ... In C++, "static" should mean the variable or function has a internal linkage. But it is used to share the variable in this case, error will occur without the static keyword. I'm confused, could someone tell me the concept behind? Thanks! 回答1: static means exactly the same thing in Objective-C that in means

Link error in Borland 6.0

拥有回忆 提交于 2019-12-24 18:20:27
问题 Got Link error (Fatal: Access violation. Link terminated) in Borland 6.0. How do I know what is the cause of it ? Is there any output file that I can open and get more informative message ? 回答1: You should be able to use the command line that gets passed to the linker to determine which .obj files are being passed to the linker. You can then include/exclude files to see when the error occurs. A number of linker problems have been fixed since BCB6, you may want to try the linker from a demo of

Can Xcode tell me if I forget to include a category implementation in my target?

北慕城南 提交于 2019-12-24 18:19:10
问题 I have a category that I import in a .m thusly: #import "UIView+Additions.h" If I forget to add UIView+Additions.m to my target, I won't know until runtime when the runtime can't find my selector. Is there a way to find out at compile time (or probably link time) that I forgot to include a category's implemtation? 回答1: This macro works! #ifndef HJBObjCCategory_h #define HJBObjCCategory_h #define HJBObjCCategoryInterface( c , n ) \ \ extern int c##n##Canary; \ \ __attribute__((constructor))

Build Python package with C bindings in Windows (VC90) causes LNK1181 fatal error

徘徊边缘 提交于 2019-12-24 18:05:35
问题 I'm trying to build a Python package (pyspotify) with bindings to a C library (libspotify). I'm using Python 2.7.5 and have installed VS2008 Express for some required commandline tools. When I call python setup.py build from the Command Prompt (with Admin rights) I get the following output: running build running build_py running build_ext building 'spotify._spotify' extension And then ~18 of these, one for each .c file in the package: c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN

No need to manually specify input libs for Boost. How is this achieved?

荒凉一梦 提交于 2019-12-24 17:43:37
问题 When using Boost with Visual C++, you can simply include the headers without ever bothering specifying which input libs to link. At build time, the IDE will somehow figure out the appropriate libs to link, be it release or debug, statically linking to CRT or dynamically linking to CRT. This makes using Boost quite convenient. I'm wondering how this is achieved. As an example, with a Multi-threaded Debug DLL (/MDd) configuration, the lib libboost_system-vc80-mt-gd-1_53.lib will be chosen and