How do I get project root directory? [closed] - clojure

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
For example, if my project directory is /media/code/clojure/my-project/ and I have a file /media/code/clojure/my-project/src/foo.clj, how can I get "/media/code/clojure/my-project/" from foo.clj?

This is unfortunately not possible because the idea of a "project root" is not well defined in the Java package model. There is a the idea of "the root of the source for this project" though once/if it's compiled into a jar file this concept no longer applies, the jar file could be loaded form anywhere on the system and that location will almost always (in the case of distributed software) be a system package installation directory. This would be an inappropriate place to download files to.

Related

How to use Resources in c++? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 months ago.
Improve this question
I want to put an exe file in my C++ program, but I don't understand how to do it.
I am using Visual Studio 2019. I know that it can be done through project resources, but I don't know how to work with it.
Create an .rc file to refer to the desired embedded .exe as an RCDATA resource, eg:
MYEXE RCDATA "path\to\file.exe"
Add the .rc file to your project.
The referred .exe file will then be compiled into your final executable.
You can then access the MYEXE resource at runtime using the Win32 FindResource()/LoadResource()/LockResource() functions, or higher-level framework equivalent.

How can I convert a .out file in exe on Debian Linux? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I perfectly know that .exe files are not executable under Linux but I need some files to be converted in .exe. Is there a way?
You can cross-compile your source files with special compilers : they are runnable on one platform, but produce executables for another.

How to compile C++ codes in Linux with source files hidden? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is there anyway to compile C++ source files in Linux and make these files unreadable to users? Either have the files encrypted or read them into memory is acceptable.
We are developing a Linux based software and we don't want our users to have direct access to our source code files.
Once a binary is created from C++ source files, the original source files are not needed in order to run the program. You can distribute only the compiled program.
Just build a container image with your software and its dependencies and run it anywhere. No need to distribute sources or compile for specific distributions.
You can use Flatpak or Docker, for example.

How to use a filename other than main.cpp for the main() method in a c++ executable [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm using Eclipse IDE but there is a linking error while trying to build the project without a main.cpp file.
I know that what i'm trying to do is possible because the HelloWorld example has its main() method inside HelloWorld.cpp but i can't find what i need to change inside the eclipse IDE project building parameters.
That being said, is there any drawback in having the main() method in a file different than main.cpp in one project?
Thanks
Edit: After a computer reboot the problem never appeared again. I haven't been able to reproduce it since then so it looks like it wasn't a coding problem or conventional configuration issue. The normal behaviour is as described in the marked answer to this question.
Eclipse will check every file in the project for main, but not your entire harddisk. Did you add the file with main to your project?

Place DLLs in other dir [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to place DLLs of my game to another folder then exe file because it is a huge mess. (I use SDL2 but it is not relevant for this I guess)
Edit: How can I import DLL from another direktory ? (I import them just trought headers)
For this to work you need to specify your libraries as /DELAYLOAD and set the appropriate DLL directories during application startup calling AddDllDirectory (Windows 8 and above) or SetDllDirectory (Windows XP SP1 and above).
Delay loading of DLLs is required in this scenario. Otherwise the loader will try to resolve the import tables before your application gets a chance to set the appropriate directories to search for.
The PATH environment variable should do the trick