React-native-rn tailwind doesn't generate tailwind.json - reactjs

I followed all the steps of installing react-native-rn.
Everything worked fine at first, but when I moved input.cssto src/css/input.css,it just generates src/css/tailwind.css, but not the src/css/tailwind.json file
I did modify the lines at package.json so they look like this.
"build:tailwind": "tailwindcss --input ./src/css/input.css -o ./src/css/tailwind.css --no-autoprefixer && tailwind-rn",
"dev:tailwind": "concurrently \"tailwindcss -i ./src/css/input.css -o ./src/css/tailwind.css --no-autoprefixer --watch\" \"tailwind-rn --watch\""
This is basically how my directory looks (I hided folders as node_modules, android, etc)

At the end of either command in package.json you'll see they both have tailwind-rn, basically what the command does is: take this file (tailwind.css) and compile it to (tailwind.json)
So, because you changed the path, default values (react-native-rn --input tailwind.css --output tailwind.json) don't work.
Manually add at the end of the commands react-native-rn --input path/to/the/generated/css.css --output path/to/where/you/want/your/json.json
In this example, it this would be:
-i equals to --input, and -o to --ouput
"build:tailwind": "tailwindcss --input ./src/css/input.css -o ./src/css/tailwind.css --no-autoprefixer && tailwind-rn -i ./src/css/tailwind.css -o ./src/css/tailwind.json",
"dev:tailwind": "concurrently \"tailwindcss -i ./src/css/input.css -o ./src/css/tailwind.css --no-autoprefixer --watch\" \"tailwind-rn -i ./src/css/tailwind.css -o ./src/css/tailwind.json\""
Also remember to edit App.js imports
//from
import utilities from './tailwind.json';
//to
import utilities from './src/css/tailwind.json';

Related

Error trying to compile C file: mkfifo: cannot create fifo 'stderr': Operation not supported

We are trying to compile this by following instructions in the readme. I must say that we are not specialists with C at all, we are students of a web development bootcamp and trying to do our last project.
It's a command line tool to calculate ephemerides of multiple celestial bodies, and as you can read in the setup in the readme file, it need to download certain data from the internet, and then compile.
All is done through the setup.sh script.
So, we have tried:
In Windows 10 ubuntu WSL terminal
If we type $./setup or $./prettymake, after download the data, gives the error:
$mkfifo: cannot create fifo 'stderr': Operation not supported
$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /mnt/d/reboot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\" -D DATE=\"09/06/2019\" -D PATHLINK=\"/\" -D SRCDIR=\"/mnt/d/reboot/ephemeris-compute-de430/src/\" src/ephemCalc/constellations.c -o obj/ephemCalc/constellations.o
If we do it with $sudo ./setup, the error printed is:
$mkfifo: cannot create fifo 'stderr': Operation not supported
$cat: stderr: No such file or directory
$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /mnt/d/reboot/ephemeris-compute-de430/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\" -D DATE=\"09/06/2019\" -D PATHLINK=\"/\" -D SRCDIR=\"/mnt/d/reboot/ephemeris-compute-de430/src/\" src/ephemCalc/constellations.c -o obj/ephemCalc/constellations.o
In macOS terminal
If we type $./prettymake, gives the error:
$mkdir -p obj obj/argparse obj/coreUtils obj/ephemCalc obj/listTools obj/mathsTools obj/settings
cc -Wall -Wno-format-truncation -Wno-unknown-pragmas -g -c -I /Users/rominaelorrietalopez/Documents/Descargas2/ephemeris-compute-de430-master/src -O3 -D DEBUG=0 -D MEMDEBUG1=0 -D MEMDEBUG2=0 -fopenmp -D DCFVERSION=\"2.0\" -D DATE=\"09/06/2019\" -D PATHLINK=\"/\" -D SRCDIR=\"/Users/rominaelorrietalopez/Documents/Descargas2/ephemeris-compute-de430-master/src/\" src/argparse/argparse.c -o obj/argparse/argparse.o
$clang: error: unsupported option '-fopenmp'
$make: *** [obj/argparse/argparse.o] Error 1
We have tried certain things to no avail, like granting permissions and what not, but have no idea what to do next.
It seems that it have something to do with the prettymake file:
mkfifo stderr
cat stderr | sed 's/\(.*\)/\1/' &
make $# 2>stderr | sed 's/\(.*\)/\1/'
rm stderr
It's like its trying to create a pipe to save the errors of the compilation but somehow it fails.
Also possibly worth of mention, it have a Makefile associated.
Since the github project does not have Issues, we've contacted the creator via email, but well, we thought maybe someone could help us here too.
Any kind of help would be honestly appreciated, thanks.
A comment from the OP invites me to answer; here it is.
The prettymake script creates a named fifo in order to receive the messages produced by make on its standard error.
A background process (cat) consumes the data from this fifo and sends them to a sed command (see right after) in order to transform these data before writing to standard output.
(note that cat is useless here since sed could have directly read from the named fifo thanks to <)
However, the two sed commands as shown in the question don't do anything since they just capture each line of text (\(.*\)) and repeat them unchanged (\1), thus they could have been omitted.
In this case, the script could just contain make $# 2>&1, it would have produced the same effect.
On a system where creating the named fifo is problematic (old version of WSL apparently), this change in the script should produce the same effect as expected.
Looking at the link provided in the question, we can see that the original prettymake script actually contains transformations in the sed commands in order to display standard output and standard error of the make command with different colours.

How to specify the location of a header file when building a shared library

I have two folders, each containing a .c .h and makefile. They are libraries and when I build them they produce a .so file.
I want to include one header file in the other header file.
When I am building it with the make file how do I tell it that the header file is in the other folder? Do I specify it in the makefile?
This is on ubuntu.
This is the makefile.
CC=gcc
CFLAGS=-c -Wall -Werror -fPIC
APP1 = tca
all: $(APP1)
$(APP1): $(APP1).c
$(CC) $(CFLAGS) $(APP1).c $(LIBS)
$(CC) -shared -o lib$(APP1).so $(APP1).o
sudo cp $(APP1).h /usr/include/
sudo cp lib$(APP1).so /usr/lib/
sudo chmod 0755 /usr/lib/lib$(APP1).so
sudo ldconfig
sudo ldconfig -p | grep $(APP1)
clean:
rm -rf *.o
rm -rf *.so
rm -rf $(APP1)
Assuming the project directory structure is something like this:
./project_dir
|-src/ //< Source code folder
|-include/ //< Folder containing header files
|-Makefile //< Makefile for the project
Add these change's in the Makefile:
CC=gcc
CFLAGS=-c -Wall -Werror -fPIC -I ./include
APP1 = tca
all: $(APP1)
$(APP1): $(APP1).c
$(CC) $(CFLAGS) $(APP1).c $(LIBS)
$(CC) -shared -o lib$(APP1).so $(APP1).o
sudo cp ./include/$(APP1).h /usr/include/
sudo cp lib$(APP1).so /usr/lib/
sudo chmod 0755 /usr/lib/lib$(APP1).so
sudo ldconfig
sudo ldconfig -p | grep $(APP1)
clean:
rm -rf *.o
rm -rf *.so
rm -rf $(APP1)
You can specify it inside the files only. The place where you are placing your makefile will be your main directory. Now suppose you have two directory A and B and each contain one header file and you need to include these header files. In main directory where ever you want to include header file, just provide the path like this
#include "../A/header_name.h" //If dir A is on just outside main dir.
#include "./B/header_name.h" //If dir B is on inside the main dir.
Similarly,you can include files individually.
If you want to include through makefile the after cc command you can add -idirafter ../A/ parameter. I have not tried through makefile, but this works on command line.So, probably it will work. Let me know :) Thanks
What you're asking is how to tell to your compiler (since what make is doing is just to fire a command line) where the header is.
More specifically, it is the job of the preprocessor.
With gcc, you have two options to do that : -I dir and -iquote dir
The former will add dir to the search path for every #include directive found during the preprocessing, the latter only for the #include directive using quotes.
Here is the documentation about these options.

CS50 library in C

I am new to Ubuntu and new to C programming. Now I am watching cs50 videos to understand better about C and CS all together.
I tried to install this by using these guidelines:
Debian, Ubuntu
First become root, as with:
sudo su -
Then install the CS50 Library as follows:
apt-get install gcc
wget http://mirror.cs50.net/library50/c/library50-c-5.zip
unzip library50-c-5.zip
rm -f library50-c-5.zip
cd library50-c-5
gcc -c -ggdb -std=c99 cs50.c -o cs50.o
ar rcs libcs50.a cs50.o
chmod 0644 cs50.h libcs50.a
mkdir -p /usr/local/include
chmod 0755 /usr/local/include
mv -f cs50.h /usr/local/include
mkdir -p /usr/local/lib
chmod 0755 /usr/local/lib
mv -f libcs50.a /usr/local/lib
cd ..
rm -rf library50-c-5
I used it, and I think everything went as planned, but as soon as I try to run gcc demo.c I get a fatal error message:
adder.c:2:18: fatal error: cs50.h: No such file or directory
#include <cs50.h>
So as it seems that somewhere something went wrong and I don't really know how to fix it. Could anyone guide me a little bit how to fix it or how reinstall everything that C automatically would include that library?
check in the /usr/local/include directory for the cs50.h file
If it was not there, then one or more of the shell commands failed (or was skipped).
have you tried running gcc to compile/link the demo.c file via:
gcc -c -Wall -Wextra -pedantic -Wconversion -std=gnu99 demo.c -o demo.o -I/usr/local/include
gcc demo.o -o demo -L/usr/local/lib -lcs50
If your not sure what the above two lines do, just ask.
<CS50.h> exist on the CS50 IDE only. The functions it contains are string as a type def and the get functions.
If you use char * instead of string type
and
scanf() instead of get_(type)
You do not need it.
If you do need it I would just use the IDE in the course. It's free and halfway through the course they take the training wheels off.
Use -lcs50 in the end. Also specify the file where you want the machine code output using the -o parameter.
Run this to compile the program: gcc demo.c -o demo -lcs50
Run this to execute the program: ./demo

I'd like to create a batch file with certain rules

Hi I would like to create a bat file that executes the following commands:
avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o battery.o battery.c
avr-gcc -mmcu=atmega328p battery.o -o battery
avr-objcopy -O ihex -R .eeprom battery battery.hex
avrdude -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -p ATMEGA328P -c arduino -P COM4 -b 57600 -U flash:w:battery.hex:i
I've ran this as a bat but the commands aren't recognized. Should I move to the directories that has the executables first?
The second command always throw an error in a msgbox that doesn't really matter, can it 'ok' the msgbox by itself and carry on to the next command?
Thank you very much.
Why would you expect that to work. It will work if the batch file is in same directory as the files.
ALWAYS SPECIFY FULL PATHS
%windir%\system32\setx
is one way to do it, above is same as
C:\Windows\system32\setx

How can I properly install cs50.h Library on OS X 10.10.1?

I'm attempting to install the cs50 library
https://manual.cs50.net/library/#mac_os so that I can compile c code for the class on my OS X 10.10.1. Unfortunately, I'm having some problems.
Let me walk you through what I've done so far. As instructed in the above link, I entered the following commands into the bash terminal:
$ ls
cs50.c cs50.h
$ gcc -c -ggdb -std=c99 cs50.c -o cs50.o
$ ar rcs libcs50.a cs50.o
$ rm -f cs50.o
$ chmod 0644 cs50.h libcs50.a
$ sudo mkdir -p /usr/local/include
$ sudo mv -f cs50.h /usr/local/include
$ sudo mkdir -p /usr/local/lib
$ sudo mv -f libcs50.a /usr/local/lib
$ cd ..
$ rm -rf library50-c-5
After seemingly installing the library correctly, I ran gcc generate.c -o generateto compile the file. I got the following error:
$ pwd
home/Developer/pset3/find
$ ls
Makefile find.c generate.c helpers.c helpers.h
$ gcc generate.c -o generate
generate.c:17:10: fatal error: 'cs50.h' file not found
#include <cs50.h>
^
1 error generated.
$
I also got the same error when I ran gcc generate.c -o generate -lcs50
Why is the cs50.h file not being found? Is the file being installed correctly?
I searched for similar questions but others seemed to be experiencing a slightly different problem:
Harvard CS50 Library , Need Help Installing on Mac OS X
Adding a header file to Xcode
cs50 library wont link to file in cs50 appliance
After the installation of the cs50 library I added this to my ~/.bashrc file.
function make50 { gcc "$1".c -o "$1" -I /usr/local/include -L /usr/local/lib -lcs50; }
then start a new terminal or just source the ~/.bashrc file in your current terminal
source ~/.bashrc
Now lets say you have a directory with a file called generate.c in it. You should be able to run make50 generate (without the ".c") and the function should call the compiler with all the arguments needed
user#macbook:~/project$ ls
generate.c
user#macbook:~/project$ make50 generate
user#macbook:~/project$ ls
generate generate.c
You can add more library paths to your function in ~/.bashrc as needed.

Resources