I am compiling my program in ubuntu g++ correctly but it cant find my files? - g++

Here is what I mean
I created a c++ program with two .cpp's and one .h. I downloaded and installed both ubuntu and g++ and both are working. However when I save my work in visual studio and enter it in ubuntu as in the image, it says the file doesnt exist... but it does!
I've looked everywhere on the internet, watched youtube videos, asked classmates, I cannot seem to figure this out. Any help would be appreciated!!!

Related

Trying to install React in Visual studio code?

I am just learning react now. I tried to install react app so many times in my Visual studio but It didn't work. It always shows installing required packages and I've waited so many hours with so many tries it didn't worked as well. I have this issue only and Node install 'my-app' folder with simple json file only. Anyone knows what's the problem here?
enter image description here
I tried to update Node recent version but it was already updated. Even i tried Non LTS supoert Node version it couldn't helped me.
I tried different types of package manager like 'npm' and 'yarn' instead of using 'npx' but then I know these package managers supported before node version 5.2 or 5.8, I think.
I searched for this problem in youtube nothing else there.
I used metered network in my PC but when I used WiFi with stable connection also it didn't install.
I tried so many different extensions in Visual studio, I thought it would be help but none happened.
What are the problems here? and What i want to do pls explain to me, bros.

how to use tesseract on linux (replit)?

pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.
this is the error I get.
the code was working on windows (vs code) but when I published it on Replit.com it gave me this error, I don't know what to do.
I am bad in Linux so I don't know where is the PATH location.
I searched everywhere in google and didn't find anything.
PLS HELP!

Install v4l2loopback in WSL2

I am currently struggling with v4l2loopback installation on WSL2.
Some context:
Recently, I have read about create a virtual video device in Linux and then mock its output from an image or video file.
This is quite important for testing or developing purposes, for example in order to attach a virtual webcam that reproduces a video file as a loop to the android emulator.
After some research I got to the conclusion I don't want to use desktop applications and it might be easy to run even in a CI or similar, therefore v4l2loopback looks nice, but I am currently a Windows user.
I enabled WSL2 on my machine, downloaded the repo, and tried to execute make command like in the repo description.
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/angel/v4l2loopback modules
make[1]: *** /lib/modules/4.19.84-microsoft-standard/build: No such file or directory. Stop.
make: *** [Makefile:43: v4l2loopback.ko] Error 2
I googled a little bit and i found that issue on GitHub where a similar output (for another tool) is mentioned.
There, someone mentioned that WSL2 Kernel Config can be adjusted in order to add more modules ( maybe and hopefully one of them could make work v4l2-loopback 😂 or at least that I think).
I also googled in order to check out custom WSL builds but I am not really sure what I need to make it work or even if I am going in the right direction.
Is there something I 've missed in order to make v4l2loopback work?
In the case only a custom WSL2 build would work, how should I proceed?
Thanks in advance 🤘
I am not familiar with WSL...
-- Ah, it appears WSL doesn't have a linux kernel at all: see
https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules .
So it's useless building the v4l2loopback mod; even if you'd be able to build it, there's nothing, no kernel, to load it!
Maybe an alternative for you might be running Virtualbox (it's free, and available for Windows) on your windows machine, and load a real Linux distro of your own choice in it. Then build the v4l2loop module, after installing the kernel development headers, and install the mod (after building, as root do insmod v4l2loop.ko) and play with it.
Thus, you are on your way. Far more elegant, and far easier. Also will have you make an enormous and important climb on the 'getting familiar with Linux' ladder, as well as maybe familiarize yourself with a virtual machine(?).
I'd definitely go for that.

GNUstep - fatal error: 'objc/objc.h' file not found on Ubuntu 20.04

I have the following problem:
I am on Ubuntu 20.04 and I am trying to set up GNUstep which is required for certain source binaries I want to build
(for the sake of completion, the program I want to build is called Advanced Rendering Toollḱit, information can be found here: https://cgg.mff.cuni.cz/ART/).
When building with the clang-9 compiler, after invoking the make command, I receive this error message:
fatal error: 'objc/objc.h' file not found
I should mention that I am still fairly new to Linux in general. What I did was installing GNUstep via
sudo apt-get install gnustep gnustep-devel
as advised on the website (http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux). It resulted in receiving the mentioned error.
/usr/include/GNUstep/Foundation/Foundation.h:31:9: fatal error: 'objc/objc.h' file not found
The next thing I tried was to download the provided configuration scripts from the same webpage and execute them. When I did, I received the following feedback:
checking whether objc really works... no. I don't seem to be able to use your Objective-C compiler to produce
working binaries! Please check your Objective-C compiler installation.
If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
can be found by the dynamic linker - usually that requires you to play
with LD_LIBRARY_PATH or /etc/ld.so.conf.
Please refer to your compiler installation instructions for more help.
configure: error: The Objective-C compiler does not work or is not installed properly.
Maybe I am getting something wrong, however, my whole intention of installing GNUstep is to make Objective-C programming possible on a non-Apple machine. Therefore I do not understand why it is complaining about a non-working Objective-C compiler (by the way, I end up with the same result when using gcc and g++ as compilers).
I did do some research and I came across some StackOverflow posts, suggesting me to install libobjc2, but I suspect this to be depreciated with Ubuntu 20.04.
I honestly don't know what's wrong and I highly appreciate a little push in the right direction! Many thanks in advance for helping me!
Although I cannot tell what exactly the bug was in my case, I got some external help and together we came up with a solution that worked for me.
For debugging purposes, we created a test user account in my Ubuntu environment and repeated the whole process. It worked flawlessly.
We concluded that something must have been wrong locally with regard to my user account. I am sure there was something wrong with my environment variables, although I failed to clearly identify the bug (I am a Linux beginner). I chose the easy way out, backed up important files, deleted and re-created my root user account and then it worked. I hope, this may help any other who has the same problem.
#skaak, thank you for your help and suggestions!
As people are pointing, if you want to use clang to compile objective C programs in Ubuntu you have to install libobjc2 (mainstream project here) but it's currently not packaged in Ubuntu. It's possible that there was a package with the same or similar name, as you found out, but that was a different thing. This manual installation worked for me:
wget https://github.com/gnustep/libobjc2/archive/v2.0.tar.gz
tar xvzf v2.0.tar.gz
cd libobjc2-2.0
mkdir build
cd build
export CC=`which clang`
export CXX=`which clang++`
cmake ..
make
sudo make install

compiling Objective-C program on Windows

A friend sent me 4 files (two .m files, one .pch file, and one .h file) that he says compile together into an Objective-C program. From what I understand, it's an Apple language, and I use Windows. I've been trying to compile it in a new project on Dev-C++, but haven't had any luck. After some research, I downloaded a special Objective-C library for it and selected "Yes" under "Link an Objective C program," but am getting a build error when I try to compile it.
The code uses Cocoa, but according to my friend, it will work the same in Windows if I import Foundation.h instead of Cocoa.h. I found a tutorial on how to compile Objective-C programs in Windows here, but I don't understand step 2 (which is "Set environment variable for GCC compiler (C:\GNUstep\mingw\bin\gcc.exe)") since that file doesn't exist on my computer. When I follow the compilation instructions, I get this error: sh: gcc: command not found. If possible, I'd rather compile it in a GUI-based compiler, as I hate working with command prompts.
Any help with compiling these files on any program is greatly appreciated!
Time to cowboy up, and learn some command line compiling.
First, you need to install the GNUStep on your machine.
Then, set the appropriate environment variable to point to whereever you installed GNUStep to.
Now you should be able to finish the tutorial.
GNUStep is designed to let developers build cocoa applications on a variety of platforms.
Environment variables are named strings that exist for all processes in Windows. If you open a cmd window and enter the command SET you will see a list of all the currently defined environment variables.
On Windows XP, add a new one by right clicking My Computer and selecting properties. Then hit the advanced tab and click on the environment variables button at the bottom. You can either add the variable for just you or for all users on the system.
I don't know how to set environment variables for later versions of Windows but I expect Google might have some useful links.
From some of your comments, it is clear you haven't installed GNUStep in the same place as the instructions. Just do a file search for gcc.exe to find out where you have installed it.