w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Header file not found during compilation with make (Linux)
The error message is from your compiler. It is saying that the file modGPRS.c (in whatever directory it is in, call it A) has included a file A/../inc/intModGPRS.h, which is itself trying to include a file called datapkt.h, which cannot be found. This is either because your makefiles are not properly telling the compiler where the file datapkt.h is, or (more likely) you have not installed a prerequisite library. Make sure you have installed everything that needs to be installed before trying to build whatever it is that you're trying to build. Without at least telling me what it is you're trying to install I can't help you further.

Categories : Linux

Does a file structure that is mostly Header files slow down anything besides compilation?
This is possibly a duplicate of Benefits of inline functions in C++? The practical performance implication depends on many factors. I would not concern myself with it until you actually have a performance problem, in which case I'm sure bigger gains can be obtained by optimizing other things. Don't keep all your code in headers - if you continue with this trend you will hate yourself later because you will be waiting for your compiler most of the time. LTO is a better approach if you are looking for similar optimizations, and has less of an impact on compile time.

Categories : C++

Moving definition to it's own compilation unit, while keeping declaration in header file?
in header: extern decltype(generic_type_test<const type_expression_base>)* is_base_type; in cpp: auto is_base_type = generic_type_test<const type_expression_base>;

Categories : C++

C Header files and Compilation/Linking
It's the linker that handles all that. The compiler just emits a special sequence in the object file saying "I have this external symbol func, please resolve it" for the linker. Then linker sees that, and searches all other object files and libraries for the symbol.

Categories : C

In objective C should i group 10 different protocols in a single header file or every protocol should be placed in it's class header file
There's no right or wrong answer to this. My personal preference is generally one protocol per header. However, if there are two or more protocols that go logically go together and will usually be imported together, you might put them in the same header file. If your protocols form an API for a framework, that is another reason to put them together so classes that use the framework API can just do one import. But I would recommend not using a generic name like protocol.h, try to think up something more descriptive of what the protocols are actually for e.g. all the protocols and class interfaces for Cocoa are logically imported (nested imports are used) in one header called Cocoa.h. On the second part, I find it generally better to keep protocols and class interfaces in separate heade

Categories : IOS

Capybara: is it possible to tag `@javascript` only one step in a scenario? Not the whole scenario?
It seems no. I got Gherkin::Parser::ParseError: ../features/deleting_tickets.feature: Parse error at ../features/deleting_tickets.feature:17. Found step when expecting one of: examples, feature, scenario, scenario_outline, tag. (Current state: tag). (Gherkin::Parser::ParseError) So one more disadvantage met.

Categories : Ruby On Rails

Does PHP offer file concurrency in this scenario?
Basically, you should lock the file while writing or reading. At least, it guarantees that there is no problem. It is the way of good programming!. The example is shown below. <?php $fp = fopen("/tmp/lock.txt", "w+"); if (flock($fp, LOCK_EX)) { // do an exclusive lock fwrite($fp, "Write something here "); flock($fp, LOCK_UN); // release the lock } else { echo "Couldn't lock the file !"; } fclose($fp); ?> More information

Categories : PHP

How Can I Save my Header File in the standard gallery of header files (or whatever it's called)?
Create a library, add the directory of the library and the header file to "path". the header file do not have to have a ".h" extension. This is the vecotr file for stl: #ifndef __SGI_STL_VECTOR #define __SGI_STL_VECTOR #include <stl_range_errors.h> #include <stl_algobase.h> #include <stl_alloc.h> #include <stl_construct.h> #include <stl_uninitialized.h> #include <stl_vector.h> #include <stl_bvector.h> #endif /* __SGI_STL_VECTOR */ you can just create a header file named as "prime" and #include <primes>

Categories : C++

Unix:merge multiple CSV files with same header by keeping the header of the first file
awk 'FNR==1 && NR!=1{next;}{print}' *.csv tested on solaris unix: > cat file1.csv Id,city,name ,location 1,NA,JACK,CA > > cat file2.csv ID,city,name,location 2,NY,JERRY,NY > > nawk 'FNR==1 && NR!=1{next;}{print}' *.csv Id,city,name ,location 1,NA,JACK,CA 2,NY,JERRY,NY >

Categories : Unix

How to use a function from a header file without including the header in C?
But this would fail for most of the cases where the header has been pre-compiled into object files This sentence makes no sense. A header can be used to compile an object file, but they never get compiled into object files; they are always used externally.

Categories : C

Wordpress compilation of a "complete" .htaccess file
Declaring "RewriteEngine On" twice will not hurt For Question2 You do not need start or end with WP I am using some extra codes for security # Disable server signature ServerSignature Off #Protect some files from direct access <FilesMatch "^(wp-config.php|php.ini|php5.ini|install.php|php.info|readme.html|bb-config.php|.htaccess|readme.txt|timthumb.php|error_log|error.log|PHP_errors.log|.svn)"> Deny from all </FilesMatch> # Disable trace track requests RewriteEngine On RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] # Deny some known bad bots RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] RewriteCond %{HTTP_USER_AGENT} ^Bot mailto:craftbot@yahoo.com [OR] RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR] RewriteCond %{HTTP_USER_AGENT} ^

Categories : Wordpress

Assembly code compilation error: file not recognized
in driver.c you probably have a call to asm_main, try adding extern return_type asm_main(Type1 name1, ..., Typen namen); where return_type is replaced by the return type of the function and typei is the TYPE of the parameter numbered i passed.

Categories : Gcc

Compilation error (g++, bison, flex) when main is in another file
You need to declare the yyparse function in the testlex.cc file: int yyparse(); This is what is known as a function prototype, and tells the compiler that the function exists and can be called. After looking a little closer at your source I now know the reason why the existing prototype didn't work: It's because you declared it as extern "C" but compiled the file as a C++ source. The extern "C" told the compiler that the yyparse function was an old C style function but then you continued to compile the source with a C++ compiler. This caused a name mismatch.

Categories : C++

Generated thrift file giving me compilation error - C#
You need to add reference to Thrift.dll located under thrift/lib/csharp/src/bin/Debug/Thrift.dll You better read the documentation http://wiki.apache.org/thrift/ThriftUsageCSharp OR you can download it as nuget package, check this https://www.nuget.org/packages/Thrift/ To install Thrift, run the following command in the Package Manager Console PM> Install-Package Thrift

Categories : C#

Objective-C++ compilation errors due to Xcode not respecting file type
Header files are not compiled. Header files are used by the preprocessor — anywhere you have a #include or a #import the actual text of the original is treated as though you'd copied and pasted it into the original. Hence it doesn't matter if your file is called .hpp, .h or anything else. If a .m file imports a .h file that includes a .hpp file then the .hpp code will be compiled as part of the .m file, i.e. as Objective-C. I am therefore going to guess that you've got GLView.m. If that's going to import a .hpp file, whether directly or indirectly, it needs to be compiled as Objective-C++. One way to do it is to rename it .mm, the other is to tell the project not to try to guess language types by file extension.

Categories : Xcode

Clojure: War Compilation Failure with Missing Data File Dependency
Compiling a Clojure source file involves evaluating all top-level forms. This is in fact strictly necessary to support the expected semantics -- most notably, macros couldn't work properly otherwise1. If you AOT compile your code, top-level forms will be evaluated at compile time, and then again at run time as your compiled code is loaded. For this reason, it is generally not a good idea to cause side effects in code living at top level. If an app requires initialization, it should be performed by a function (typically -main). 1 A macro is a function living in a Var marked as a macro (with :macro true in the Var's metadata; there's a setMacro method on clojure.lang.Var which adds this entry). Macros must clearly be available to the compiler, so they must be loaded at compile time. Fur

Categories : Clojure

How do I get the currently matched line from a compilation-error-regexp-alist file function?
Opening compile.el and then searching with C-s (funcall jumped me to: (setq file (if (functionp file) (funcall file) (match-string-no-properties file)))) which seems to be the relevant spot and shows that the functions is indeed called with no arguments and that the match-data is still very much valid, so you can extract the file name with (match-string <the-file-sub-group>).

Categories : Emacs

Apache Cross Compilation Error ./gen_test_char: cannot execute binary file
I searched and searched and found several tries to patch but none of them worked. Most of these were patches suggested directly from the Apache dev group. But I finally came across this Apache mail list. It suggests a straight forward solution that the patches could not provide. Compile the gen_test_char app before trying to cross-compile Apache. So I did. And followed the suggestions and it worked like a charm. instead just compile gen_test_char.c 1st with something like: gcc -Wall -O2 -DCROSS_COMPILE gen_test_char.c -s -o gen_test_char then run it and put its output into the include folder (or where its placed normaly); and after this compilation run it to get the desired output with: ./gen_test_char > test_char.h

Categories : C++

Include template implementation cpp file in header file and link confusion
It is normal that you do not get any error. Because your definition and implementation are regarded as one file. Better and usual C++ style is; Header file (myClass.h): You should not include the implementation file (compiler will find it if there is any for you). Implementation (myClass.cpp): #include myClass.h Main program (main.cpp) This will also need #include myClass.h If you implement using this usual style you are expected to get a linkage error only because you shouldn't have separated the definition and implementation of template functions/classes. Author might be referring to this.

Categories : C++

Spring Batch - Validate Header Lines in input csv file and skip the file if it invalidates
Looking code of FlatFileItemReader file stop condition is managed; with private field boolean noInput with private function readLine() used in protected doRead() IMHO the best solution is to throw a runtime exception from your skippedLineCallback and manage error as reader exhaustion condition. Foe example writing your delegate in this way class SkippableItemReader<T> implements ItemStreamReader<T> { private ItemStreamReader<T> flatFileItemReader; private boolean headerError = false; void open(ExecutionContext executionContext) throws ItemStreamException { try { flatFileItemReader.open(executionContext); } catch(MyCustomExceptionHeaderErrorException e) { headerError = true; } } public T read() { if(headerError) return nu

Categories : Spring

Shell script: copying columns by header in a csv file to another csv file
Just figure out the name associated with each column and use that mapping to manipulate the columns. If you're trying to do this in awk, you can use associative arrays to store the column names and the rows those correspond to. If you're using ksh93 or bash, you can use associative arrays to store the column names and the rows those correspond to. If you're using perl or python or ruby or ... you can... Or push the columns into an array to map the numbers to column numbers. Either way, then you have a list of column headers, which can further be manipulated however you need to.

Categories : Shell

How to link main function with header file and create it's dll file?
I'll say more about the DLL further down, but for a start, here is the layout of the source files you'll need to do that. You'll need three files: main.c kmp.h kmp.c. Code structure: File main.c #include <stdio.h> #include "kmp.h" // this will make the kmp() function known to main() int main(int argc, const char *argv[]) { char target[200]; ... same code as you aready have } File kmp.h // prototype to make kmp() function known to external programs (via #include) extern int kmp(char *target, int tsize, char *pattern, int psize); File kmp.c #include <stdio.h> #include <stdlib.h> #include <string.h> // declare kmp prototype as DLL-export _declspec(dllexport) int kmp(char *target, int tsize, char *pattern, int psize); // prototype for inte

Categories : C

PHP, is it acceptable to include a php file not at top of the file to get around the limitations of the header() function?
You can include files wherever you want. The problem is OUTPUT. If you're going to be doing header() calls, you cannot have performed ANY output prior to the call. If your includes are simply spitting out output, and are not just defining functions/vars for later use, then you'll have to have to modify the includes to NOT do that output, or at least buffer/defer the output until later. e.g. <?php include('some_file_that_causes_output_when_loaded.php'); header('This header will not work'); will fail no matter what, because your include did output, and kills the header call. But if you mod the include, so you have something more like: <?php include('file_that_just_defines_functions.php'); header('This header will work'); function_from_include_that_causes_output(); will work jus

Categories : PHP

If no functions included in a header file are used, does the compiler still compile this file?
Use of pre-processor directive #include for a header file with no parseable code will not increase the size of the compiled binary. Typically a header file will only usually include declarations - not definitions. So the inclusion of a C header file will not normally increase the size of the binary anyway. For example - in a header file this statement int maxlines; would create the definition of a variable which would be stored in the compiled binary file. The inclusion of the definition would increase the size of the binary. Function declarations and pre-processor tokens such as int parseFiles(const char *file); and #include MAX_LINES 80 however will not increase the program size. One effect of keeping the #include statement will be to increase the time taken to compile slightly.

Categories : C

Vim c++ generate source file based on header file
Use the xptemplate plugin. Examples: http://www.derekwyatt.org/wp-content/uploads/2009/08/my.cpp.xpt.vim http://www.derekwyatt.org/vim/working-with-vim-and-cpp/cpp-snippets

Categories : C++

Where to find the header file and lib file corresponding to Microsoft DLL (say WTTLog.DLL)?
You're wrong on quite a few points. You're assuming that every DLL has a header file. In reality, there may be 0, 1 or more than 1. You're assuming that 64 bits DLL's have different headers. This is obviously untrue, just think of <windows.h>. You're assuming that DLL versions are in exact sync with headers. Again, think of <windows.h>. You're assuming that function names in a DLL are mangled, in particular re. 32/64 bits. Just think of LoadLibrary(L"MessageBoxW") - that is the mangled name, and "W" only means Unicode. Not 64 bits. You're assuming that every DLL has a .lib file. Equally untrue. Why would a COM component DLL need one?

Categories : C++

g++: Is there a way to warn if header file is not included in file?
Not exactly answering the question, but using forward declarations and keeping includes in headers minimal might help in avoiding such problems. If you only use forward declarations in your hpp files, they would be independent from each other, and you will be forced to include specific .hpp files into each .cpp unit being compiled.

Categories : C++

Divide header from a file and convert that to columns with sequence number including file number in Unix
Although your question is a little lacking in details, I think this might at least approach what you are wanting: filename=allresponses_11.txt filenum=$(echo ${filename} | tr -dc 0-9) echo "seq_num file_num hname" for h in $(head -1 ${filename}) do echo "${filenum} ${h}" done | cat -n

Categories : Unix

Including a C++ header file in a c# file
Unfortunately no, that isn't possible as the C# compiler doesn't understand what to do with .h files. Even it if did, it still illegal to have un-scoped variables declarations (constant or otherwise) in .NET. You'll have to convert the file either by hand, or as mentioned in the comment by Joachim Pileborg, build a utility to auto-convert it to C# code for you.

Categories : C#

php: not getting file what does header() do?
You can use the PHP's readfile (http://php.net/manual/en/function.readfile.php) to force a file download, if that's what you are trying to do. There is an example on that page shows you how to download an image. The PHP header function sends a raw HTTP header to the client. The location header is usually used to redirect the client to a new page in PHP.

Categories : PHP

Should I Add Something To The Header File?
I don't know about that error, but Your second reference to indexPath on this line can't be right: NSString *selectedPhotos = [tagImages[indexPath.section] objectAtIndex:indexPath]; The objectAtIndex parameter needs an integer. You probably meant: NSString *selectedPhotos = [tagImages[indexPath.section] objectAtIndex:indexPath.item]; or, to be more consistent (either use objectAtIndex or use the [] syntax, but using both is a little curious): NSString *selectedPhotos = tagImages[indexPath.section][indexPath.item]; You haven't shown the declaration of tagImages, nor it's initialization, but I assume it is tagImages an array of an array of strings? If so, the above correction should fix it. If not, you should tell us how tabImages is populated/structured. If selectedPhotos is a NS

Categories : Objective C

php download file: header()
Your current code does not output a file, it just sends headers. in order for your script to work add the following code after your fclose statement. $data = file_get_contents($file); echo $data;

Categories : PHP

Identify file header using php
If you set the format parameter to 1, it'll make an associative array of the headers: $headers = get_headers($url, 1); $content_type = $headers['Content-Type']; See the documentation of get_headers for more information.

Categories : PHP

What is the right way to add header file?
random is introduced in C++11 so add this to your g++ option: --std=c++0x or --std=gnu++0x The option is probably in your makefile.

Categories : C++

How to remap a c header file
Alter the include path to use a directory controlled by you before it uses the directory holding "foo.h" In the directory controlled by you make a symlink called "foo.h" which points to "my_foo.h" as the target

Categories : C

Matlab: C++ header file for dll
The only function that you can call is GetTPIErrorDescription_VB. All the others use C++ classes that you cannot access. So I suggest that you do the following: Remove all the other functions from the header file. Remove the #include and the using lines. Remove the #ifdef and replace TRACKERERRORSDLL_VB with __stdcall. Either include windows.h or add some #define statements for the Win32 types. Possibly deal with the bool type depending on whether or not MATLAB knows how to deal with it. If MATLAB won't recognise it, replace bool with int. At that point the call to loadlibrary should work and then you just need to write the code that calls calllib. The resulting header file might look like something this: #define LPSTR char* __declspec(dllimport) bool __stdcall GetTPIErrorDescriptio

Categories : C++

c++ Header file and include
Simple Rule: Include the header file only in those files which need it. If your source or header file does not use any constructs defined/declared in the header file then there is no need to include that header. Doing so only brings unnecessary code in to those translation units thereby corrupting the namespace and possibly increasing the compilation time.

Categories : C++

Interpretation of header file
In the C preprocessor, ## is the token concatenation operator. So lcname##_ can be read as "create a new token by putting _ at the end of lcname". I presume that the quoted preprocessor code is defining a preprocessor macro LAPACK_GLOBAL which is intended to be used as follows: #define LAPACK_something LAPACK_GLOBAL(something, SOMETHING) after which any use of LAPACK_something will be substituted by one of the following: something something_ SOMETHING depending on the environment.

Categories : C++

C++ Header File Interaction
In the header file,you can declare all class fields and functions,that you will implement in the cpp file. You should'nt declare the variables that you will use inside your class functions(because there are like temp variables),But you can declare(and should) const varables,that you will use in your progamm. You should'nt use extern,extern its for variables that you dont define them,and the compiler doesnt bother you about that,because when its extern,that means that the variable is defined somewhere else in your progamm. extern is also used for functions that you want to treat your c++ code,as it were in C. like: extern "C" { //code. } or extern "C" int func(int a); In conclusion- delcare const variables in .h file,and the classes.else - in cpp(unless its inline). in your case: c

Categories : C++

Remove Header From File
What you're looking for is what I call a "lop" operation, which is kind of like a truncate, but at the front of the file. I posted a question about it some time back. Unfortunately, there is no such thing available.

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.