Skip to main content



      Home
Home » Newcomers » Newcomers » Location of the exe in Eclipse Luna (C++)(It's in E:/cpp/myproject/bin/Release...not E:/cpp/myproject !!)
Location of the exe in Eclipse Luna (C++) [message #1701404] Mon, 13 July 2015 05:00 Go to next message
Eclipse UserFriend
Working with Luna Release (4.4.0) in C++ and using Qt 5.4 widgets.

I need to have this code tell me the truth.

myproject.exe is located in : E:/cpp/myproject/bin/Release

not in E:/cpp/myproject as Qt QDir objects want to tell me.

I've used :

QString currentPath = QDir::currentPath(); 


and it ignores "bin/Release"

I've also used :

QDir dir;
QString s1 = dir.absolutePath();


and this also ignores "bin/Release"

If I copy the myproject.exe file to X:/a/b/c directory

then these two methods tell the truth that the exe is located in

X:/a/b/c

Why is the development environment so sneaky in this regard?
Re: Location of the exe in Eclipse Luna (C++) [message #1701534 is a reply to message #1701404] Mon, 13 July 2015 21:38 Go to previous messageGo to next message
Eclipse UserFriend
On 07/13/2015 03:00 AM, Sequoia Tree wrote:
> Working with Luna Release (4.4.0) in C++ and using Qt 5.4 widgets.
>
> I need to have this code tell me the truth.
>
> myproject.exe is located in : E:/cpp/myproject/bin/Release
>
> not in E:/cpp/myproject as Qt QDir objects want to tell me.
>
> I've used :
> QString currentPath = QDir::currentPath();
> and it ignores "bin/Release"
>
> I've also used :
>
> QDir dir;
> QString s1 = dir.absolutePath();
>
> and this also ignores "bin/Release"
>
> If I copy the myproject.exe file to X:/a/b/c directory
>
> then these two methods tell the truth that the exe is located in
>
> X:/a/b/c
>
> Why is the development environment so sneaky in this regard?

You'll find more and better help with C/C++ and Eclipse in the Eclipse
CDT forum.
Re: Location of the exe in Eclipse Luna (C++) [message #1701535 is a reply to message #1701404] Mon, 13 July 2015 21:39 Go to previous messageGo to next message
Eclipse UserFriend
You are confusing the current directory with the absolute path to the
executable. These are two different things. The current directory is
the directory where the executable is started. This has nothing to do
with the path to the executable. Eclipse launches executables in the
project directory. This is consistent with what you included in your post.
Re: Location of the exe in Eclipse Luna (C++) [message #1701538 is a reply to message #1701535] Tue, 14 July 2015 00:08 Go to previous messageGo to next message
Eclipse UserFriend
David Wegener wrote on Tue, 14 July 2015 01:39
The current directory is the directory where the executable is started. This has nothing to do with the path to the executable. Eclipse launches executables in the project directory.


...where the exe is started .... has nothing to do with the path to the exe.
Sounds like something a politician would say. Laughing

Does the development environment pick up the SF030.exe and move it to another place before actually executing it??

What are the magic words to intone when I want to have the answer :
"E:/cpp/SF030/bin/Release"
Re: Location of the exe in Eclipse Luna (C++) [message #1701658 is a reply to message #1701538] Tue, 14 July 2015 13:54 Go to previous messageGo to next message
Eclipse UserFriend
It's more of a C++ question. I don't know what their launch
configurations support, but most support settings the working/current
directory for the launched process. So you might use something like
${resource_loc:/SF030/bin/Release} for that value.

On 14/07/2015 6:08 AM, Sequoia Tree wrote:
> David Wegener wrote on Tue, 14 July 2015 01:39
>> The current directory is the directory where the executable is
>> started. This has nothing to do with the path to the executable.
>> Eclipse launches executables in the project directory.
>
>
> ..where the exe is started .... has nothing to do with the path to the
> exe.
> Sounds like something a politician would say. :lol:
> Does the development environment pick up the SF030.exe and move it to
> another place before actually executing it??
>
> What are the magic words to intone when I want to have the answer :
> "E:/cpp/SF030/bin/Release"
>
Re: Location of the exe in Eclipse Luna (C++) [message #1701662 is a reply to message #1701658] Tue, 14 July 2015 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Imagine I have an application executable, someApp.exe installed in C:\Program Files
I can go to C:\temp and execute it using the command line C:\Program Files\someApp.exe
What is the "current working directory" in that scenario?
It's C:\temp (nothing to do with the path to the executable).

That's the situation you're in, only the "current" directory is your Eclipse project root (as Ed and David explained) and the path to the executable is under your project's bin/ folder. Make sense?
Re: Location of the exe in Eclipse Luna (C++) [message #1701799 is a reply to message #1701662] Wed, 15 July 2015 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Eric Rizzo wrote on Tue, 14 July 2015 18:30
under your project's bin/ folder. Make sense?


yes, that makes sense.

What doesn't make sense is that there is no way in the Eclipse working environment to say in the form of an answer :

"your exe is located in E:/cpp/myproject/bin/Release"

that is where the exe is located.

How do I get that info?

Re: Location of the exe in Eclipse Luna (C++) [message #1701807 is a reply to message #1701799] Wed, 15 July 2015 16:12 Go to previous message
Eclipse UserFriend
It depends on where you are asking. If it's in the running environment,
it's a C++ runtime question best asked on the CDT forum. If it's in the
launcher, I've already told you about using variables.

On 15/07/2015 7:59 PM, Sequoia Tree wrote:
> Eric Rizzo wrote on Tue, 14 July 2015 18:30
>> under your project's bin/ folder. Make sense?
>
>
> yes, that makes sense.
>
> What doesn't make sense is that there is no way in the Eclipse working
> environment to say in the form of an answer :
>
> "your exe is located in E:/cpp/myproject/bin/Release"
>
> that is where the exe is located.
>
> How do I get that info?
>
>
Previous Topic:Search and Replace a pattern in eclipse.
Next Topic:Starting Jetty server 9.3 from command line to server static content
Goto Forum:
  


Current Time: Sat May 24 19:58:26 EDT 2025

Powered by FUDForum. Page generated in 0.09667 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top