executable

How to implement readlink to find the path

爱⌒轻易说出口 提交于 2019-11-28 08:13:24
Using the readlink function used as a solution to How do I find the location of the executable in C? , how would I get the path into a char array? Also, what do the variables buf and bufsize represent and how do I initialize them? EDIT: I am trying to get the path of the currently running program, just like the question linked above. The answer to that question said to use readlink("proc/self/exe") . I do not know how to implement that into my program. I tried: char buf[1024]; string var = readlink("/proc/self/exe", buf, bufsize); This is obviously incorrect. This Use the readlink() function

How can I creating executable JAR with SWT that runs on all platforms?

微笑、不失礼 提交于 2019-11-28 07:39:53
SWT comes with a base JAR and one specific JAR per platform (Windows, Linux/32bit, Linux/64bit, Mac, AIX, ...). How can I create an executable JAR that will select the correct platform JAR at runtime? [EDIT] I was thinking to supply all platform JARs in a subdirectory and in main() would then modify the class loader. Has anyone already tried this? Matías Look at this, there is a code sample: Create cross platform java swt application For my current job I needed to supply an executable jar that could load jars inside itself and execute a second main(). Basically a bootstrap main() and an

Creating a JAR file which contains other library files

痞子三分冷 提交于 2019-11-28 07:04:37
I want to create one executable JAR file which contains other JAR libraries. But when I execute the JAR, it gives an error of class path problem. How do I solve the class-path problem? Tony I think you can try it like this; Here is a simple example for you question. First, we assume we have a project directory like D:\javademo . In this working directory we then create a main class HelloWorld.java and thtat contains our other JAR files, like commons-lang.jar . Now, we must archive our main classes HelloWorld and commons-lang.jar into test.jar file. First we must edit our manifest file so that

python: Can I run a python script without actually installing python?

帅比萌擦擦* 提交于 2019-11-28 06:48:45
I have some .py files I wrote that I want to run on a different machine. The target machine does not have python installed, and I can't 'install' it by policy. What I can do is copy files over, run my stuff, and then remove them. What I tried was to just take my development python folder over to the target machine and cd to the python folder and run python.exe /path/to/.py/file . It gave me an error saying that python.dll was not registered. If I registered the DLL that is probably going to move me to far across the 'violating policy' line. Is there anyway I can accomplish running python files

How can I create a JAR/exe of a Java project?

风流意气都作罢 提交于 2019-11-28 06:29:08
问题 I have developed a project in Java using NetBeans 6.1. I need to add two third party JARs to it and 2 license files in a JDK/JRE/bin location. Now I want it to distribute it for trials. I have no experience in creating exes of Java projects. Can anybody please explain how to do this? I tried some commands before posting here, but they did not work. 回答1: I need to add 2 third party jar's to it and 2 licence files in a jdk/jre/bin location. You should not be adding anything to that directory.

How can I package my Perl script to run on a machine without Perl?

a 夏天 提交于 2019-11-28 04:34:21
People also often ask "How can I compile Perl?" while what they really want is to create an executable that can run on machines even if they don't have Perl installed. There are several solutions, I know of: perl2exe of IndigoStar It is commercial. I never tried. Its web site says it can cross compile Win32, Linux, and Solaris. Perl Dev Kit from ActiveState. It is commercial. I used it several years ago on Windows and it worked well for my needs. According to its web site it works on Windows, Mac OS X, Linux, Solaris, AIX and HP-UX. PAR or rather PAR::Packer that is free and open source. Based

c# get assembly executable directory

纵饮孤独 提交于 2019-11-28 03:43:42
问题 I have 2 application. Example App1 and App2 When run nomal App1 will show assembly executable location. But when i call App1 from App2, it return App2 start up location. So, how to get App1 start up path when call App1 from App2? 回答1: You can get the directory of the currently executing assembly with this: string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); GetExecutingAssembly() returns the currently executing assembly and Location is the full path or UNC

Compile a Standalone Static Executable

拟墨画扇 提交于 2019-11-28 03:41:16
I'm trying to compile an executable (ELF file) that does not use a dynamic loader. I built a cross compiler that compiles mips from linux to be used on a simulator I made. I asserted the flag -static-libgcc on compilation of my hello.cpp file (hello world program). Apparently this is not enough though. Because there is still a segment in my executable which contains the name/path of the dynamic loader. What flags do I use to generate an executable which contains EVERYTHING needed to be run? Do I need to rebuild my cross compiler? Try using the -static flag? Use the following flags for linking

My iOS app has a + in its name. Bundle is invalid due to this. Need help resolving

被刻印的时光 ゝ 提交于 2019-11-28 03:31:26
问题 I did find a couple of very similar or identical threads here but they seemed to end before full resolution. My app runs fine on my device with no build error. I am trying to submit app for approval and I get the following error, "This bundle is invalid. The executable name, as reported by CFBundleExecutable in the info.plist file may not contain any of these characters ..... +". So I opened my info.plist file and changed the info.plist file executable name from the macro ${EXECUTABLE_NAME}

What are the uses of self modifying code?

五迷三道 提交于 2019-11-28 03:27:30
Is there any real use for self modifying code ? I know that they can be used to build worms/viruses, but I was wondering whether there is some good reason that a programmer may have to use self modifying code. Any ideas? Hypothetical situations are welcome too. Turns out that the Wikipedia entry on " self-modifying code " has a great list: Semi-automatic optimization of a state dependent loop. Runtime code generation , or specialization of an algorithm in runtime or loadtime (which is popular, for example, in the domain of real-time graphics) such as a general sort utility preparing code to