compilation

MonoDevelop Compilation & GAC

落花浮王杯 提交于 2019-12-24 09:59:55
问题 I'm a bit confused as to what's happening here. My understanding is that when an assembly is required at runtime, the runtime will first try to load the assembly from the executing directory (or the directory where the dependant executable is located). After which it will attempt to find the assembly within the GAC. First of all, I am on Windows. Now, when I'm compiling my solution is VS, everything works fine (as expected), but when I compile the same solution in MonoDevelop, the compilation

How are parse trees used?

♀尐吖头ヾ 提交于 2019-12-24 09:40:38
问题 I'm currently learning about parsers. I've been watching videos and trying to write code, but I'm starting to have a hard time understanding. I thought maybe understand the motivation for a parser could help to understand how they work and how they should be built. So the goal of a parser is to take a string of tokens and create a parse tree. I can understand what a parse tree is , but I just don't see how it's used . Ultimately, a compiler uses a parse tree to create machine code, but

Automatic reference of class files inside App_Code vs reference of class files outside App_Code

我的梦境 提交于 2019-12-24 09:09:42
问题 all questions refer to Web site projects. 1) Why are file classes inside App_Code folder automatically referenced by the rest of application, while file classes created outside App_Code aren’t? 2) I don’t know much about compilation, but why do we need to explicitly reference class files created outside App_Code? Because those files will be compiled into dlls created and named by programmer and as such VS doesn’t know what the names of these dlls and so can’t automatically reference these

Does every .h file have a corresponding object file?

若如初见. 提交于 2019-12-24 08:58:04
问题 I'm trying to write a makefile, but I don't really understand how object files work. There are no .o files in my folder, so how can I be compiling them? Does every .h file have a corresponding .o ? If not, then how do we know if we have to compile an object file or not? Sorry if these are stupid questions, I'm new to programming. Thank you. 回答1: Basically the header (.h) files tell the compiler that things exist when it's generating the object (.o) files. The compiler generates object files

Why do I get different compilation result depending on java imports and static imports sequence order?

余生颓废 提交于 2019-12-24 08:23:57
问题 I've faced an issue with compilation, but cannot understand why it occurs. Actually much time was spent to understand where the reason is (it was far from obvious in a "crap" project), but after reproducing that error I greatly simplifies all the code to show a little example especially for you: Package structure: com.company | ----Main.class | ----maker | ----Maker.class Maker.class package com.company.maker; public interface Maker { } Main.class package com.company; import static com

Why does CMake neglects source files?

萝らか妹 提交于 2019-12-24 07:56:23
问题 The CMakeLists.txt file I wrote, unfortunately, create coverage statistics solely for header files and test scripts, but not for the source files. I would, however, like to heave coverage information for the source files. What am I doing wrong? As an example, here is the header file: class.h #include <string> #include <vector> #include <iostream> class StrVec{ public: StrVec(const std::string&); void print() {std::cout << vec[0] << std::endl;} private: std::vector<std::string> vec; }; The

Compiling expat for iOS - Command /bin/sh failed with exit code 77

試著忘記壹切 提交于 2019-12-24 07:09:09
问题 I am trying to import the libkml library into my iOS project. I realised that expat libraries cannot be linked (?) and so have to build the expat sources for it again. I found a SO link where a gentleman mentions that he could successfully link expat with his iOS SDK 5.1: How to compile expat with iOS SDK 5.1? I tried the same using the script available in github as mentioned in the above link. But, I am getting an error in the Run phase of the script. I could not make the most out of it but

static ints, compilation units and the ternary operator

和自甴很熟 提交于 2019-12-24 06:58:16
问题 // SomeCls.h class SomeCls { static const int PERIOD_ALARM_NORMAL = 5; static const int PERIOD_ALARM_THRESH = 1; void method() { bool b = true; const int d = b ? PERIOD_ALARM_THRESH : PERIOD_ALARM_NORMAL; } } obj; It is going to build ok. Now take out the method() implementation and place it in a cpp file: //SomeCls.cpp #include "SomeCls.h" void SomeCls::method() { bool b = true; const int d = b ? PERIOD_ALARM_THRESH : PERIOD_ALARM_NORMAL; } Why does mr. linker say undefined reference to

Trying to compile program that uses zlib. Link unresolved error

青春壹個敷衍的年華 提交于 2019-12-24 06:45:17
问题 While trying to compile program, that uses zlib, i got following errors: Error 1 error LNK2019: unresolved external symbol _compress referenced in function "void __cdecl save_image_in_pakfile(class std::basic_ofstream > &,struct _IplImage *)" (?save_image_in_pakfile@@YAXAAV?$basic_ofstream@DU?$char_traits@D@std@@@std@@PAU_IplImage@@@Z) buffer_management.obj Error 2 error LNK2001: unresolved external symbol _compress fern_based_point_classifier.obj And two more same errors but related to

Compiling differences in Visual C++ and *nix environments

十年热恋 提交于 2019-12-24 06:25:24
问题 Is there a difference between compiling projects in *nix environments and MS Visual C++? For example, there is a "stdafx.h" file in Visual C++. The reason I'm asking is that I submitted a piece of code which compiled in g++, to refactormycode.com. Then after it got a refactoring, it seemed to include a "stdafx.h", so I figured I'll download Visual C++ 2008 Express but I can't seem to get it to build. What I'm doing is creating a new project > Create a Win32 Console Application, and replacing