gulp-less undefined variable in the same file, no error running lessc - gulp-less

I am very perplexed...
I am using gulp-less to convert my less file to css. I have the following code:
#node_modules_path: "../../node_modules";
#bower_path: "../../bower_components";
#fonts_path: "../../../public/fonts";
//bootstrap components
#import "overides/bootstrap";
#import "#{node_modules_path}/bootstrap-select/less/bootstrap-select.less";
#import "#{bower_path}/bootstrap.checkbox/css/bootstrap-checkbox.css";
#import "#{bower_path}/bootstrap-vertical-tabs/bootstrap.vertical-tabs.css";
When I execute the gulpfile, I get the following error: Error: variable #bower_path is undefined in file /srv/www/frontend/build2/less/adex/style_default.less line no. 8
For some reason the #node_modules_path variable gives me no error.
Compiling the less file through lessc also works fine....

Seems to be an issue with less 1.7.5, that is used by gulp-less, it doesn't handle so well variables in sub-imports. The file that was giving me the problem was actually imported into another file. I solved it moving the variables definition to the file doing the import, and now all works fine.
Lessc directly from the command line uses version 2, so that's why it worked there.

Related

How may I resolve a file containing 65k lines of code causing a [bcc32 Fatal Error] F1008 Out of memory error?

I'm using Embarcadero C++ Builder 10.1 Berlin Update 2.
I added one file to a project. I tried to build said project and the build failed and reported the following error:
[bcc32 Fatal Error] FileName.cpp(44329): F1008 Out of memory
I have been reading up on errors that can be found via Google and am only finding linker errors. My understanding is that this isn't a linker error as I'm not seeing [ilink32]. I haven't come across any examples of this error.
The file I added has 25 lines in the h file and 64865 lines in the cpp file. The following method takes up 64755 lines of the cpp file.
void __fastcall TFileName::PopulateKeyValueList()
{
SOKeyValueList->Clear();
SOKeyValueList->AddPair("AKey","AValue");
... roughly 64750 more lines like the one above adding pairs to the list
}
This wasn't an issue before I added the file containing 65k lines of code to the project so I believe the appropriate question is, how may I resolve a file containing 65k lines of code causing a [bss32 Fatal Error] F1008 Out of memory error?
It’s generally not a good idea to hard code data (especially so much data in your case) into a source file. You should put key-value pair info in a file and read them out to build the key-value list.
For the error, I guess the compiler you used is just not good enough to handle large source files.

Type 'FILE' has not been declared jpeglib.h

Im using eclipse neon2, Windows 10 and i have compiled jpeglib as following the instructions ( using MinGW) (first answer):
Compiling libjpeg
But in my program after compiling and building im facing this error:
Description Resource Path Location Type 'FILE' has not been
declared MyBilliards line 974, external location:
c:\mingw\include\jpeglib.h C/C++ Problem
Description Resource Path Location Type 'FILE' has not been
declared MyBilliards line 975, external location:
c:\mingw\include\jpeglib.h C/C++ Problem
But if i skip and launch the project with these errors, it seems to work fine...
Also if someone has a tutorial how to make mingw and jpeglib work in eclipse and windows10 would be great.
Thanks
Well if someone has the same problem i solved it including stdio.h BEFORE jpeglib.h ( which is strange as in the main.cpp i didnt get any dependency or syntax error). Then clean project and then Build All....
So
#include<stdio.h>
#include<jpeglib.h>

Xcode noob: Don't understand compiler error message

I'm fairly new to Xcode and have recently gotten an error message that is probably clear to anyone who knows what they're doing, but I am unsure how to react to this one.
I have a project that is mostly C++, with just a few C files in it. Everything was fine until I tried to add some code to find the computer's MAC address. Apple provides a project example (GetPrimaryMACAddress), and I downloaded, built, and tested that. It works just fine.
After that, I simply copied the C source from the Apple example project and included it into my code project. Then I started getting this error message:
I have tried including the IOKit framework explicitly via the linker; no help. I tried adding more #include statement to the Apple example code; no help. I think that I do not understand what the compiler message is telling me regarding importing from module 'Darwin.MacTypes'.
Clicking on the error message took me to a line in usr/include/MacTypes.h:
I'm not clear on how to Import Darwin.MacTypes. I don't really understand how the source code for GetMACAddress could compile so effortlessly in one project and not another. I didn't rearrange nor add nor delete any of the #include statements in the Apple-supplied C file.
I'll bet there is a simple answer that I am just not seeing. How should I react to this error message?
I had a similar problem with types like UInt16 and UInt32. I just included the MacTypes with the following include statement:
#include <MacTypes.h>
This solved all my type-problems for my example c-file.
Let me guess, when you want to compile C++ source, you should create a C++ source file
(On the toolbar: File > New > File.. > Source > C++ File)

expected type-specifier and cannot convert ‘int*’ in initialization

I have a large amount of code, so I have tried to only include the relevant parts of the code here
My cpp files compiled with no problems when they were included in another cpp file.
I have another file called. This compiled fine before, until I tried to include the files above in
I get undefined reference errors, even though they were defined in the cpp file
What is going on? Is there a linkage error? Do I need to make changes in the makefile?
Using
ASp* asp = new ASp(input);
works for me. Not sure why using
ASp* asp = new ASp::ASp(input);
is a problem. Need to dig further to find out.
Update
The same problem was addressed at using declarations in main (C++). The tool chain for that question is MS Visual Studio. The answers there point out the same problem but there is no explanation of why new Asp::Asp(input); would be of type int*. The error message reported by the OP appears to be a g++ specific error message.

Rinside compilation error with kdb

I sucessfully ran the sample codes in the package. Then I copied code from sample1 into another file of mine and set it up to compile using Makefile.
Also copied sample copies into the same directory.
The samples in the directory compile and run fine.
But using R in my already existing code is giving issues. When compiling it gives an error saying expected unqualified-id before âreturnâ. This happens in the line where I declare RInside R(argc, argv).
Another weird thing i noticed is if i include at the bottom of included files, I get a bunch of errors in Rcpp etc. but if i include it at the top, all those errors disappear.
Also, is the default compile option of -O3 required for the package? I have been using -Ofast for most of my codes. Browsing through the questions here I think I need to make changes to CXXFLAGS in Makevars but i can't find out where.
Any help appreciated.
I have boiled down the errors to another file included in my setup which is "k.h". This is a file which is used to interface c++ with kdb+ database. If I include the file before I get errors in Rcpp classes. When included after RInside, I get the earlier error of unqualified id before return.
This is the file in question: k.h
Resolved: It appears it was a variable name conflict. In all examples we have RInside R(argc, argv). As soon as I changed it to RInside L(argc, argv) everything worked fine. Don't know exactly why this was the case but it solves the problem at least. Tested outputs too.