Installing a project in KDevelop fails - kdevelop

I've got a project in KDevelop, but attempting to install if from within the IDE simply gives the following output:
/home/<myusername>/Projects/rect/build/release> kdesu -t -- make -j8 install
*** Failed ***
However, when I run the exact same command from the exact same location in terminal (outside KDevelop), it asks for the root password as it should and installs just fine. All possible solutions for the problem I could find are either for missing kdesu or kdesu installed in a location not on PATH by default; however, I most certainly have kdesu on my system and I have exported its location, and like I said, the exact command that KDevelop appears to be trying to run works beautifully outside the IDE.
So, how would I get the install option working in KDevelop itself?
I'm using Debian Wheezy if this matters.

I got around this by creating a symlink to the kdesu binary in /usr/local/bin, which seems to be working just fine. I'm still curious as to why it didn't work before since the directory containing kdesu was on the PATH, though.

Of course the problem with my PATH was that I was only setting it in the console but the PATH is different for GUI applications (thanks D.J.Duff for pointing that out, can't believe I didn't know this) - I fixed it by adding PATH="$PATH:/usr/lib/kde4/libexec" (the location of these binaries) to my .profile file as suggested here.

Related

Codelite not running C programs

Everytime I try to build and run a program, including the standard 'Hello world!' nothing happens, I get:
==== Program exited with exit code: 0 ====
Time elapsed: 000:00.000 (MM:SS.MS)
Press any key to continue...
At the bottom it says:
'ming32-make' is not recognized as an internal or external command, operable prgram or batch file.
I have Codelite version 16 on Windows 10. I also have MinGW installed to C: and have edited the Environment variables to include C:\MinGW\bin
However, in command prompt gcc --version shows me the gcc version in C:\Users\me> and not C:\MinGW
I don't know if this is relevant or not.
All the other results seem to suggest a compiler not found problem, but this does not seem to be my case. Thanks in advance.
This is what I have installed at the moment. Can I get 'make'from one of the other files?
The Installed files
Looks like you either don't have ming32-make.exe or it can't be found.
Also I notice you still use old MinGW. I would recommend switching to newer MinGW-w64 (which supports both Windows 32-bit and 64-bit).
The standalone build from https://winlibs.com/ does include ming32-make.exe, and since you can just unzip it (no installation needed) you can try it without removing the old MinGW. Just make sure you don't have anything in your PATH variable to avoid running programs from the wrong location.
ming32-make.exe is either not installed or can't be found on your Environment variable PATH.
No, there is no mingw32-make in that bin folder. When I used the Installer originally I only selected: mingw32-gcc-g++-bin although there were other bin files. Where can I get it?
mingw32-make is outdated.
See How to compile makefile using MinGW?
If you are having problems with mingw, I would recommend using MSYS2 or a package manager like Chocolatey.
Just get rid of the previous installation first. Not mandatory but prevents confusion and storage drain due to multiple copies of mingw.
To install MinGw using chocolatey, run cmd as admin and use
choco install mingw
For make
choco install make
What worked for me was also installing mingw32-base-bin from the Installer (see second option in image in the original question).
The installation tutorial I was following did not mention installing this.
I've decided to leave this here as an answer in case someone else runs into a similar problem.
MSYS is a good option for compilers in recent CodeLite or VS-Code installation. https://www.msys2.org/.
Once you downloaded the compiler using the following steps from the installer but still have the problem with the make then follow these steps:
Reopen the MSYS2 terminal from your windows if that is previously installed.
Run the command pacman -S --needed base-devel mingw-w64-x86_64-toolchain
You will be asked to select the option from the list. You should select the option which refers to mingw-w64-x86_64-make.
Once the installation is successfully done, then open CodeLite settings->Buid Settings and check your Make file location. If that is empty or showing an unknown location then click the three dots at the very right of that box. The browse and navigate to location or where you installed the make by pacman. In my case it is C:/msys64/usr/bin/make.exe.
Click Apply and Save.
Now it might be needed to create a fresh workspace and re-run your code.

Mingw gives my a libwinpthread-1.dll was not found error when compiling code

I just downloaded and installed Mingw. I also setup the system environment variables for C:\MinGW\bin and C:\MinGW\msys\1.0\bin. I wanted to test to see if I had installed it correctly (it seemed to be since running gcc --version worked), so I wrote hellow world in c and tried to compile with gcc main.c -o hello_world.exe. However I got the error:
"The code execution cannot proceed because libewinpthread-1.dll" was not found. Reinstalling the program may fix this problem."
I have tired reinstalling it and restarting my computer. I have also tried to see if this problem has occurred to others, and while there are a few places it is mentioned, I can't seem to find a solution mentioned. I have thought about trying to download the dll separately, but if I remember correctly, downloading dlls is a big no no.
Awhile ago I installed mingw though chocolatey and it seemed to be working. I have deleted that download from my computer and removed the paths, since I wanted to try to install it the normal way. Could this be part of the error?
Any ideas what the issue could be? Thanks!
You have built an .exe file that depends on libwinpthread-1.dll.
Solutions to make sure the .exe can run:
Add the MinGW bin path to your PATH so libwinpthread-1.dll - this would only fix it for your own system so I wouldn't recommend this if you want to use the .exe file on other systems.
Copy libwinpthread-1.dll from MinGW in the same folder as your .exe file. This is generally needed for any shared dependancy library your .exe is linked against.
Build a static .exe (--static linker flag) to avoid the shared (.dll) dependancy.
Yes! probably is an error, cause MinGW is a bit stinky when it comes to DLLs
Here are some things you have to check:
Make sure the variable helding the location of MinGW is named "path"
and its pointing at: C:\MinGW64\bin

What to install and how to run an executable file on Mac?

So I'm in terminal, and have a directory called CAPTURE on my desktop, I'm trying to run a program called 'testme'. I read that you need to have build-essential installed but I think that's only on Linux systems and I'm on a Mac so it wasn't necessary because it's already built in (I think). So, I navigated from ~ with:
cd Desktop/CAPTURE
Then, I tried running a bunch of different commands that I found while looking on the internet:
./testme
which returned zsh: exec format error: ./testme
xcode-select --install
which installed properly and I thought I could run the ./testme command but I got the same error as before. Then I tried navigating to the directory again and used
chmod +x ./testme
./testme
which also did not work. I've never run executables before so I really have no familiarity with these commands so they might be super wrong. If anyone can help me run the file properly, that would be much appreciated.
Since your question is tagged as C and Clang, and you are talking about build-essential, I will assume that you are attempting to build an application from source code.
Instead of build-essential, in macOS, you need Xcode. The Xcode CLI tools will work if the application is text-only or Curses, but you will need the entire Xcode IDE for any graphical application.
If running ./testme is telling you Executable format error is probably because it's a prebuilt executable, very likely a Linux ELF executable that will not run in macOS.
My suggestion is to try to build the software. Most C applications will build if you run make inside the directory. make is installed by default by Xcode. Other applications may need a third-party build system, such as CMake, but I do not know if that's the case.

I can't find /rootfs on Windows 10

I'm very confused with the whole WSL situation. Sometimes I feel like I get it but in reality, I don't. My main confusion is where does Ubuntu (I use Ubuntu 20.04) save files? And how do they intertwine with files I install with Windows Command Line? All installations I have done via Ubuntu have been a waste of time, I can't find packages or libraries I install for any programming language. If someone knows of a course or video that could help me understand, I would appreciate it if you share it as well.
The specific situation of this question is caused because I installed a package for C with Ubuntu (the cs50 one) but I can't get VS Code to recognize it. I tried adding /usr/local path to the c_cpp_properties.json but it doesn't find this path.
I go to this folder in the explorer and I don't find anything, as expected.
Thanks in advance.
The file ext4.vhdx is the complete filesystem for the Linux subsystem. However, you can't (or shouldn't) access it directly from Windows 10.
Instead (within the Linux subsystem) you can access your C: drive through mount point /mnt/c (E.g. ls -l /mnt/c/Users ), and that way copy files between the two file systems.
If you want to user Windows explorer (again within the Linux subsystem), use following command:
/mnt/c/Windows/explorer.exe .
Just found out. You can access the files directly from Windows 10. E.g:
dir \\wsl$\Ubuntu-20.04\home
I faced the same problem. I was trying to reach rootfs but couldn't and as you have shown, I was reaching a dead end at "ext4.vhdx". After looking at articles, I found the home directory is found within the Linux subsystem, and to reach there you can use the following path to Linux and go to Linux > Ubuntu > home > user/admin and you'll be in your home directory.
You can directly type \\\\wsl$ in the directory path and then you can see the below image to access the file directory of ubuntu.
File Directory
Then, You can navigate here to see all the files as same as rootfs.`
\Ubuntu-22.04\home\user-name
`
I had the same issue and this is how I figured it out:
first, open PowerShell and type: wsl -d Ubuntu
then, go to your file explorer and type: \\wsl$
this will open the Ubuntu folder and you can access all your files

How to build OpenEXR using cmake for windows 7 VS2013

I have encountered problem in building a solution of OpenEXR using Cmake for VS2013.
FYI, i have installed the prerequisite of OpenEXR, ILMBase and specify the path in system path variables. However, when i configure Cmake to produce solution for VS2013, the ILMBase package prefix cant be located.
Is there any solution to this??
if you still have the problem: Follow the readme, so don't use the cmake gui, but type everything in the command line (which includes specifying ILMBASE_PACKAGE_PREFIX)

Resources