Inkscape fails to open .eps - inkscape

I need to automate conversion EPS -> SVG. When I open the .eps file from the GUI, it works. When I use the commandline with the -l parameter, it gives me this error:
parser error : Start tag expected, '<' not found
...
(inkscape.exe:8152): WARNING **: 11:18:12.747: Specified document ... cannot be opened (does not exist or not a valid SVG file)
But it shouldn't be trying to parse an SVG file when it has the .eps extension. Why does Inkscape fail to do it correctly when done from the CLI but works when done through the GUI?

In order to be able to open EPS files I needed to get ghostscript and then add it to the PATH variable.
Then instead of using -l TARGETFILE parameter, I used --export-filename=TARGETFILE.
Now it works.

Related

Why my "Reso"(resources) file is not recognized in Clion while trying to run OpenCV?

I'm trying to run a single program that opens a image file in Clion C++:
See image:
As you can see here, i have a file named "Reso" and a image named "test.png", but this code always will promt "Error reading image"
NOTE: I have proven that this does work in Visual Studio perfectly, but for some reason the file is not recognized in Clion
When you run a binary in CLion, your application will have by default the current working directory set to where your binary is located, which is probably somewhere in your cmake-build-debug directory.
In your case you expect a certain directory, because your resource file is somehwere else. You can either change your code to allow passing the path by argument, or you can set the working directory in CLion for your binary.
In the top you have this bar, where you can choose your build target. There is an option Edit configurations and when you open this and select your target, you can see a field Working directory. Set this field appropriate for your project.

g++ is not recognized as an internal or external command Windows 10

First off I would like to say I've seen the previous questions on this site, I've tried every solution but none fit my use case or solves my problem.
I am having trouble with the g++ complier being recognized, I've included this path:
C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin\g++.exe
which is where the current version of mingw is located (recently downloaded). I've also tried other options like changing the path to gcc.exe, and just regular bin. Someone please provide a detailed solution to this problem.
Other things i have tried and looked at closely would be:
http://stephencoakley.com/2015/01/21/guide-setting-up-a-simple-c-development-environment-on-windows
seeing as though I'm working through sublime text 3
Another thing Ive tried:
Ive tried to copy and paste the path into cmd and run it , but i find this error code:
C:\Users\Kxrk>C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin\g++.exe
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
So seeing that, i tried another way , and that is to drag the file and drop it into cmd and get this :
C:\Users\Kxrk>C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin\g++.exe
g++.exe: fatal error no input files
compilation terminated
when u drag and drop the file it has double quotes around it , so i tried editing the path to contain double quotes around it and the path automaticlly changes back after saving.
This was very simple , it was one of those weird cases.
To solve my problem what i did was:
1: uninstall , the current version of the mingw compiler , because i felt as though the one i had was corrupt in a way.
2:Redownloaded it the compiler from the website http://www.mingw.org/
3: set up the new Environmental variable where i save it , witch was C:\MinGW\bin
I had to install g++ from the command line(cmd ,command prompt)
by using this command mingw-get install g++witch is located inside bin on default
now i created one more directory in the environmental variables , C:\MinGW\bin\g++.exe
6.Now everything works , and is normal
If you are trying to run the compiler from the command line then you have to put double quotes around the path, because the path contains two whitespaces (this is the reason for the first error).
The reason for second error is that you didn't specify which C++ program you want to compile. You have to append the filename of your C++ input file to your command:
C:\Users\Kxrk>"C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin\g++.exe" program.cpp
See Barmak Shemiranis answer if don't want to enter the full path all the time. After that you can just use this:
C:\Users\Kxrk>g++ program.cpp
You have to use quotation marks around the path so that is treated as a single path:
c:\>"c:\program files\path\g++.exe"
A better way is to set the environment variables. Open Environment variables windows (in Windows 10 you can type in "environment variables" in search box) or right click on "Computer" in desktop, open "Advanced System Settings" and find the button for "Environment variables"
Go to your command propmpt, type set path, it will show list of directories, copy them,
Now type set path=<data you copied> and then add a semicolon and possible directory to g++ usually C:\MinGW\bin

Error: network 'Scenario' not found

I have installed veins-4.5 and I can run the Erlangen example.
However, when I try to run the example in the subprojects/veins_inet folder it gives "Error: Network 'Scenario' not found, check .ini and .ned files"
However the Scenario.ned is in the same folder as omnetp.ini.
How do I solve this problem?
Many thanks.
If you are using the interface graphic, do it: click in subprojects/veins_inet and next in omnet ++ project -> build all.
Another cause for that error is that the .ini isn't correct.
In particular, if you wish to simulate using Gui (Tkenv), your .ini file should include something like:
[Config MyNetwork]
However, for a command-line simulation (Cmdenv), the .ini file should read instead:
cmdenv-config-name = MyNetwork
in the latter case, you should also add "-u Cmdenv" to your run command.
Confusing between the 2 options above raises the error ""Error: Network '...' not found, check .ini and .ned files".

Inkscape is not recognised as an internal or external command

I am trying to run Inkscape from command prompt however the error occurs. I have added c:/Program Files/ Inkscape/inkscape.com in the PATH but this not working.
Inkscape is not recognised as an internal or external command
I just had this same issue. However my problem was that I didn't add inkscape to the path. Try leaving the inkscape.com off your path and just have it as
C:\Program Files\Inkscape
This worked for me.
I know it is a bit old question but I faced the similar issue so I would like to share how I approach the issue because using Inkscape's command line might be quite useful for various reasons.
Option 1: You might either change the current directory as
cd C:\Program Files\Inkscape\
inkscape
Example scenario can be converting the .svg file to the .pdf which is useful for LaTeX import. To use it for exporting to PDF through Inkscape's command line (assuming that your file is already located in C:\temp\):
inkscape -D -z --file=C:\temp\logo.svg --export-pdf=C:\temp\logo.pdf --export-latex
Option 2 (Cleaner solution): Or you might add
C:\Program Files\Inkscape\
to the PATH environment variable. In Windows see this link. Then you can run inkscape without changing the current directory.
cd C:\temp
inkscape -D -z --file=logo.svg --export-pdf=logo.pdf --export-latex

WAMP: failed to open stream: No such file or directory

I'm trying to upload a file using PHP. My HTML page with the form is stored at
C:\wamp\www\myproject\upload.html
PHP page is
C:\wamp\www\myproject\upload.php,
and the file I'm trying to upload is
C:\wamp\www\myproject\openoffice.txt.
When I try to upload the file, I get the following error:
Warning: move_uploaded_file(/uploads/openoffice.txt) [function.move-uploaded-file]: failed to open stream: No such file or
directory in C:\wamp\www\myproject\upload.php on line 40
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpF66A.tmp' to '/uploads/openoffice.txt'
in C:\wamp\www\myproject\upload.php on line 40 Problem: could not move
file to destination directory
Here are lines 40-43 of upload.php:
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
echo 'Problem: could not move file to destination directory';
exit;
}
The fact that it's looking in upload.php instead of the folder that it's in makes me wonder whether it's a server error or an issue with my PHP.
I Googled and got this advice but I don't know if it's the right advice, or how to implement it. Help?
You should be supplying a file system path for $upFile, not a web based path. try using the full system path to you your uploads directory like C:\path\to\uploads\openoffice.txt. Unless of course youre actually trying to place the file in C:\uploads...
Try this code
$imgName = time();
$imgPath = BASEPATH."../uploads/".$imgName;
$image = base_url().'uploads/'.$imgName;
move_uploaded_file($_FILES["file"]["tmp_name"],$imgPath.".jpg");
$imageNew =$imgName;
Where uploads is the folder name just rename it with your folder name or make your folder as name it as uploads. Its working code.
Thanks
Give your '/uploads/' folder where you are going to upload your file. 777 rights. Give full permission to that directory.