When I compile swc, haxe compiler removes all comments. I suppose there should be some compiler parameter, but I can't find any.
No, compiler removes (ignores) comments automatically. As for Asdocs, if you have commented correctly your code those should appear highlighted in any IDE that supports it like FB 4.7 for example.
Related
The problem arises firstly from the "isfinite" function: (undefined reference to isfinite). From google search I find that I must include "math.h" and write three lines of code, like:
ifdef __linux__
define _finite(v) (__builtin_isfinite(v))
endif
But then, there comes the error: (Make:47 missing endif. Stop).
If I comment out those three lines of code, the error becomes: (<math.h> no such file or directory).
My system is OpenSUSE Leap 15.4; gcc version 7; gnu make version 4.2.1-7.3.2.
I think I have installed all the needed packages. However the errors persist. Any help?
I primarily want to address this part of the question, as the underlying issue has been addressed elsewhere, multiple times:
The problem arises firstly from the "isfinite" function: (undefined reference to isfinite). From google search I find that I must include "math.h" and write three lines of code, like:
ifdef __linux__
define _finite(v) (__builtin_isfinite(v))
endif
I started to write "Google led you astray", but I think it's more likely that you seriously misunderstood what it led you to. And perhaps you happened to choose poor results.
The error message indicates that you put those lines in your makefile, but they are wholly inappropriate for that. Don't put them there.
The lines are C preprocessor directives that have been stripped of their leading # characters. You would use them by restoring the # characters ...
#ifdef __linux__
#define _finite(v) (__builtin_isfinite(v))
#endif
... and putting the resulting lines into one or more of your C source files. BUT DON'T! Those lines are unnecessary and at best unhelpful.
You do need to #include <math.h> in each C source file that contains a call to isfinite(), because that is the header that provides a declaration of the function. Since C99, functions must be declared before they are called (and it was good practice well before then).
Other than that, with GCC and many other traditional-style Unix C compilers, you need to explicitly include the math library in your link when you need any of the functions it provides. That would involve adding -lm to your makefile, at the end of the gcc command that builds the final executable. This is covered in gcc will not properly include math.h, and many other duplicates on this site.
I'm not really sure why "cout" and "endl" are not being recognized. Any help would be great!
The error is:
and the code is:
The fact that iostream has a red squiggle underneath it is a near certainty that you have something wrong with your environment (such as compiling with a C compiler rather than a C++ one, for example).
You need to fix that, since cout and endl are defined in that header. I'd start by hovering the mouse over the iostream text and see what the tooltip shows you.
If it cannot find the file iostream then you're either not using a C++ compiler, or your environment is severely damaged.
Either way, it's not a correct C++ environment.
Things to look in to are (to start with):
Examine the file extension. Using *.c instead of *.cpp may use a C compiler rather than a C++ one, for example).
Examine the output of your compilation, if available. You will hopefully be able to tell which compiler is being used.
If you are sure you're using a C++ compiler:
You might have a funny character in your iostream string. You could totally delete that line and retype it (don't edit, it may not get rid of the funny character).
Try a different header (like cstdlib) to see if it has the same problem.
Last-straw solution would be re-installation of your development environment, in case things are so damaged it's unrecoverable.
I have googled extensively, and while I can find many examples of cabal files as well as good tutorials, I would like to have a proper grammar definition for the .cabal file format. Alas, I have not been able to find it. The more recent cabal documentation only mentions that its file format is backwards compatible -- with no links to the 'original' format with which it is compatible! Not useful.
a proper grammar definition for the .cabal file format.
The grammar is defined by its parser. I don't know of a formal specification.
Is this what you want?
Distribution.PackageDiscription
The list of the fields, whether they are required or not, and what goes in them is here https://www.haskell.org/cabal/users-guide/developing-packages.html#package-properties.
Not the most obvious of places, I must admit.
I've started to add some doxygen comments to my code but I see that some comments change object code and also the linked executable in Visual C++.
I used objdump to catch the differences. I expect date and checksum differences but no more. However, adding a comment line to a doxygen style comment on a method changes object code and the executable.
Do you have any idea what can be the cause of this weird behaviour or is there another method that I can verify no changes in executable after adding those comments?
Cheers,
Burak
If you are compiling with debugging symbols, then the comments will cause the line references to move around.
I'm working on getting a Visual C++ 2005 solution to compile in unicode. However, In some of my projects (but not all), I get errors in the form:
1>.\CBitFlags.cpp(25) : error C2065: 'L' : undeclared identifier
and the line of code in question is:
LOGERROR(UTILITY, L"Tried to use object to store %d flags, when max is %d",
I am BAFFLED. It seems to be treating L as an identifier when L is part of the language syntax. Does anyone know if there is some flag somewhere that has to be enabled in the project or compile settings that if not toggled would cause this? The really weird part is it isn't all of the occurrences of this, it's only some of them. It does seem to be consistent within a single project, but I have entire projects compiling fine, and others that fail miserably like this.
The problem is almost certainly inside of the LOGERROR macro. Look at how it treats that second paramater. Expand the macro yourself, it is easy to overlook small errors in macros sometimes.
Visual C++ 2005 does support the L syntax for wide strings, and doesn't need any special flags or anything to support it. So most likely, your problem is elsewhere. Perhaps the definition of LOGERROR or UTILITY. Or a missing semicolon previously, or.... It could be anything which causes the compiler to expect something other than a string literal when it gets to the L.
Since this appears to be something used in a macro, I think you should look at the definition of the LOGERROR and UTILITY macros and at what they expands to in the context of your code. Use the /P compiler option to preprocess your files without proceeding to the compilation step, and then look at the result to see what the compiler's really seeing.
I can reproduce the error you see if I have a space after the L:
wchar_t const* foo = L "foo";
Are you sure you've copied and pasted the actual code that's giving you trouble?