compilation

Statically linking against LAPACK

我是研究僧i 提交于 2019-12-17 21:06:06
问题 I'm attempting to do a release of some software and am currently working through a script for the build process. I'm stuck on something I never thought I would be, statically linking LAPACK on x86_64 linux. During configuration AC_SEARCH_LIB([main],[lapack]) works, but compilation of the lapack units do not work, for example undefiend reference to 'dsyev_' --no lapack/blas routine goes unnoticed. I've confirmed I have the libraries installed and even compiled them myself with the appropriate

Shouldn't decltype Trigger Compilation of its Argument?

亡梦爱人 提交于 2019-12-17 21:02:06
问题 So I'm perplexed as to how this works. Given: template <typename T> int foo(T t) { t.foo(); } It seems like this call should fail: decltype(foo(int{ 13 })) fail = 42; cout << fail << endl; Instead it just prints: 42 It works this way on all the compilers I have access to. Is this correct behavior? I request a quote from the C++ Standard. 回答1: In [dcl.spec] : For an expression e, the type denoted by decltype(e) is defined as follows: if e is an unparenthesized id-expression naming an lvalue or

Dynamically create a compiled .NET exe from source code?

泄露秘密 提交于 2019-12-17 20:56:11
问题 I need to inject a custom, unique, static string into my .NET based EXE. For all intents and purposes, assume that this is my Private key of a PKI. I have a few ideas on how I'll approach protecting the Private key within the C# source code, my question is how do I take my .CS files and create an executable based off it? 回答1: Take a look at CSharpCodeProvider, which can essentially be used take a string containing source code and compile it to an assembly (EXE or DLL), or if you require, an

Compiling C++ Program Causes “Fatal Error LNK1104”

有些话、适合烂在心里 提交于 2019-12-17 20:51:56
问题 I am trying to compile a c++ application using the following command in command prompt: cl -I"c:\Program files\Java\jdk1.5.0_07\include" -I"c:\program files\java\jdk1.5.0_07\include\win32" -MD -LD HelloWorld.cpp -FeHelloWorld.dll However, this produces the following error: LINK : fatal error LNK1104: cannot open file 'MSVCRT.lib' Have you any ideas of what is causing this and how to fix it? I have visual studio 2005 installed on windows. Thanks, -Pete 回答1: LINK : fatal error LNK1104: cannot

How to partially disabling cmake C/C++ custom compiler checking

谁说我不能喝 提交于 2019-12-17 19:55:32
问题 I am trying to do some crosscompilation using cmake. Some are easy with all the examples on Internet, I managed to crosscompile my library on Linux (x86 and ARM), Windows and Android. But now I would like to do it on a custom platform. The process I need to achieve: Sourcing my environment (this destroy all previous bash classic environment) Compile with cmake Execute what I want But Cmake is testing for symbols in my custom C/C++ libraries which make my library unable to compile. The errors

qt application 64 bit windows

倖福魔咒の 提交于 2019-12-17 19:41:32
问题 Is it possible to compile a 64 bit executable in qt windows? Is it the same process as with 32 bit or any different? 回答1: Have a look at this wiki page. I describes how to build the Qt binaries from source for different configurations. 回答2: I'm not sure if I understand your question completely, but I can tell you about my project and see if it helps your situation. We have: Visual Studio 2008 C++ project Contains both Win32 and x64 platforms (in other words, it can be 32-bits or 64-bits) We

Why is -force_load no longer required for my three20 dependencies in XCode 4.2?

a 夏天 提交于 2019-12-17 19:28:41
问题 I have project with a dependency on a third-party static library and the three20 libraries. In XCode 3.X, in order to get my project to compile, I had to use the -force_load flag in the "Other Linker Flags" build setting, and specify each of the three20 libraries that I wanted to include. When attempting to build an archive in XCode 4.2, I was getting a "duplicate symbol" error. I resolved this by removing the seven separate -force_load flags that referred to each of the three20 libraries on

Why does Go allow compilation of unused function parameters?

泄露秘密 提交于 2019-12-17 19:15:30
问题 One of the more notable aspects of Go when coming from C is that the compiler will not build your program if there is an unused variable declared inside of it. So why, then, is this program building if there is an unused parameter declared in a function? func main() { print(computron(3, -3)); } func computron(param_a int, param_b int) int { return 3 * param_a; } 回答1: There's no official reason, but the reason given on golang-nuts is: Unused variables are always a programming error, whereas it

Compiling C-code from the Command Prompt in Windows?

假如想象 提交于 2019-12-17 18:52:00
问题 I want to compile C code from the Command Prompt in Windows. I have added the environment variable to the PATH and I can compile .cs files with: csc app.cs That's OK, but how do I compile app.c? 回答1: You do this: cl app.c Here's a complete transcript, including setting up the environment for Visual Studio 2005 (change "8" to "9.0" for Visual Studio 2008). C:\src\tests>"\Program Files (x86)\Microsoft Visual Studio 8\vc\bin\vcvars32.bat" Setting environment for using Microsoft Visual Studio

Compile VLCKit on Mac OS 10.9

给你一囗甜甜゛ 提交于 2019-12-17 18:32:08
问题 I'm trying to compile VLCKit on Mac OS 10.9 following this wiki : https://wiki.videolan.org/VLCKit/ I have clone git://git.videolan.org/vlc-bindings/VLCKit.git then open VLCKit.xcodeproj in Xcode 5.1 and finally run "Build Everything". But build failed with thoses issues : Run VLC configure PhaseScriptExecution bootstrap /Users/myname/Library/Developer/Xcode/DerivedData/VLCKit- bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Run\ VLC\ configure.build/Script