CodeLite Debugger doesn't open files - fopen

My linux executable works fine when I run it directly or using gdb
but when I'm using codelite, at this statement
fp = fopen("../../../../../data/data.csv", "r");
it returns NULL for fp,
looks like CodeLite cannot figure out where the file is,
Do I need to set some kind of an environmental variable ?

Just set the working directory to the same directory where you have the executable

Related

TCL/TK Wish can't find file in the same directory

I am trying to write a TCL/TK Script that accesses an INI File with the command [::ini::open DBW.ini]. I am using the inifile package for this and am trying to run on wish for the gui.
However, wish answers with "couldn't open "DBW.ini": no such file or directory". The odd thing about this is, that I can run this Code in the VSCode extension "Code Runner".
Code Runner is configured to access the same wish Compiler that I'm trying to run on my Windows System.
Why would I be able to run this Code through VSCode, but when im using the wish Compiler directly it throws an error message.
Thank you in advance
Most likely your Tcl code is not being executed in the same directory as where the DBW.ini file is. The Tcl command pwd will return the directory where the code is executing. If this is not where the ini file is, a simple fix would be to specify the whole path to the file when you try to open it, something like:
[::ini::open C:/some/where/DBW.ini]

An error in the running of kotline in vscode

enter image description here
Can anyone say how to debug it
It seems like your kotlin directory is not added to your PATH variable thus the extension/terminal may not know what to execute, when trying to execute kotlinc.
The easiest way to resolve this issue is by adding the path to your kotlin directory (path/to/your/kotlin/bin) to your PATH variable
(see here), if you are on windows, or here, if you are on a linux system.
You can check, if it works by opening a command line window and trying to execute
kotlinc -version
However, as it seems like you are using Code-Runner extension in vscode, you can also update your settings.json file:
reference here.

Run an EXE file from MATLAB 64bit (Windows 8.1 64Bits)

I want to run an EXE file named "LBRM.EXE" by MATLAB.
I try:
dos('lbrm.exe')
and I get error:
'lbrm.exe' is not recognized as an internal or external command,
operable program or batch file.
Exactly the same code works fine in 32bit MATLAB.
mesh -setup did not help!
Since it appears you're not returning any arguments from the call, you could see if you have better luck with the bang operator:
!lbrm.exe
You have to add the EXE in your environmental variables in Windows or to move to the directory of the EXE file.
To move to the directory of the EXE file, use CD('EXE file folder') then you can execute your file by using the system command. system('lbrm.exe')

Can't get eclipse to run terminal command on mac

I have installed swig on my mac and it works in the console just fine. If I type swig -verison in terminal it spits out the version. Eclipse keeps telling me that it can't find swig. I am using the liquidfun library http://google.github.io/liquidfun/SWIG/html/index.html and it told me to put this export SWIG_BIN=$("which" swig) in .bashrc, which I did. This enviroment variable registers through terminal as well. Eclipse STILL won't grab swig properly. What the hell?
Bash reads .bash_profile, .bash_login or .profile. I don't expect the Eclipse process to load such a file (although I could be wrong) nor the SWIG_BIN variable to augment its search path for executables, but if you launch Eclipse from the shell, it should inherit the shell's environment variables.
Try running swig from eclipse using a full absolute path (the one that "which" returns).
The eclipse.ini file can set some startup parameters but perhaps not the path. There might be other eclipse startup files.
Another possibility is to add swig's directory to the path in a login script. (To test that, log out and back in, then start eclipse.)

Using Scrapy with Windows Powershell

I'm unable to use scrapy commands via the Windows Powershell however I can use it via python using execute from scrapy.cmdline.
When I type anything beginning with scrapy, the 'open with' dialogue window pops up asking which program I'd like to use to open the file 'scrapy', which contains the following:
#!C:\Users\User\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe
from scrapy.cmdline import execute
execute()
I've tried:
adding a . ahead of scrapy as suggested here
adding python ahead of commands suggested here
all of the above in cmd instead of PS
When I use scrapy through the Python interpreter everything functions correctly, does anybody have any suggestions as to what I'm doing wrong? Thanks.
I'm using PS version 2.0, Python 2.7.6 on Windows 7.
I'm guessing you have c:\Python27\Scripts\ folder in your PATH environment variable ($env:PATH to find out) - depends on your Python version, of course, it may be in that Enthought Canopy folder path, for instance.
When you type scrapy, Windows is finding the scrapy file (which you don't know exists, and that's why you say "there aren't any files") and trying to run it, but can't because it has no extension.
You are prompted to open it in a program, and you choose a text editor, and see the content (because there is a file). Instead you could choose to open it with Python - e.g. browsing to the C:\Users\User\AppData\Local\Enthought\Canopy32\User\Scripts\python.exe file and choosing that. Or c:\python27\python.exe if you have that.
To fix it without having to choose a file, you need to specify both where the Python interpreter is and where the scrapy file is, e.g.
python scrapy startproject myproject has to become something like
C:\Python27\python.exe C:\Python27\Scripts\scrapy startproject C:\Users\username\Documents\projects\myproject
(You will have to find out where Python.exe and scrapy are on your system. I am deliberately ignoring the Enthought path you show because I don't know anything about how it installs, and what folders it uses).
Edit: I suggest not changing the PATH because it might unintentionally break other things, and instead creating a wrapper for the scrapy launcher:
Rename Scripts\scrapy to Scripts\scrapy-helper
Create a file named Scripts\scrapy.bat with the content
C:\Python27\python.exe c:\Python27\Scripts\scrapy-helper %*
With the correct paths for your system. When you type scrapy at the command prompt, Windows/PowerShell will find it, run it as a batch file, call the right Python to run the right scrapy script, and pass any parameters you used through to Python.