DDT-IDE / DDT

DDT is an Eclipse-based IDE for the D programming language:
http://ddt-ide.github.io/
102 stars 16 forks source link

Executable in /workspace/[Project Name]/d Doesn't Exist #147

Closed MggMuggins closed 7 years ago

MggMuggins commented 7 years ago

I don't know if this is a problem with the DDT (pretty sure it's not), or just something I did wrong with installation (probably this one, but I figured this was the best place to come for help), but I'm getting an error when I try to launch the project. Error:

'Launching [Project Name] - (default)' has encountered a problem. Executable file (/home/[Me]/workspace/[Project Folder]/d) doesnt exist.

I'm a newbie to Eclipse and D in general, but I think I have enough of a clue that I can get this running. This error happens when I press the "Run" button. I can use eclipse to write my source files, and then compile with the dmd and run with the command line, but that is a pain, and frankly would be nice to see eclipse do what I tell it to. Probably just making some mistake, but enlightenment would be greatly appreciated. (I'm running Ubuntu 16.04, if that changes anything, also (what I think) is the latest version of the DDT (installed it yesterday) and eclipse (Neon 4.6, installed via the installer)). ~Sam

bruno-medeiros commented 7 years ago

After you try to launch the project, check the console view for the D build output, see if there is anything wrong there.

MggMuggins commented 7 years ago

The terminal output is as follows (Quite short): \ Building D project: D **

Running: /usr/bin/dub build Performing "debug" build using dmd for x86_64. d ~master: building configuration "library"... ^^^ Terminated, exit code: 0 ^^^ \ Build terminated. **

Edit: Sorry about the formatting...

bruno-medeiros commented 7 years ago

If it says building configuration "library" then it's not generating any executable. Do you have a main function in your code? DUB needs to find it to be able to generate an executable

MggMuggins commented 7 years ago

void main There are the first few lines of code, including my imports. There is a closing curly brace at the end of the program.

bruno-medeiros commented 7 years ago

Where is that source file located?

MggMuggins commented 7 years ago

in

/home/[My Name]/workspace/[Project Name]/src

where workspace is my eclipse workspace and [Project Name] is my project. I am running on Linux, as you may be able to tell by the path. I did update this workspace from the version of eclipse that is in the Ubuntu repositories, so it might be an issue with that.

bruno-medeiros commented 7 years ago

I can't figure out what's wrong. In any case, if you open the command line and run dub build in the project directory, and you still don't get an executable, it's not a DDT problem any way.

MggMuggins commented 7 years ago

I ran that, and there are some dub files there, but there is no exec in the project directory. I have no idea why this would be. I'm going to try deleting the files I created using the dmd and see if that does anything...

EDIT: Alright, I did that, and nothing. Here is the output from the terminal, and the contents of the .projecct file. The terminal printed the same (what is below) both times I ran the dub command. And I'm having trouble making this code display. Editing my comment should show you everything you need to know.

Terminal Output:

Performing "debug" build using dmd for x86_64. d ~master: building configuration "library"...

.project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>D</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.dsource.ddt.ide.core.DubBuilder</name>
            <triggers>clean,full,incremental,</triggers>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.dsource.ddt.ide.core.nature</nature>
    </natures>
</projectDescription>
MggMuggins commented 7 years ago

Here is some more output:

************  Resolving DUB project: D  ************
>> Running: /usr/bin/dub describe
{
    "rootPackage": "d",
    "configuration": "library",
    "buildType": "debug",
    "compiler": "dmd",
    "architecture": [
        "x86_64"
    ],
    "platform": [
        "linux",
        "posix"
    ],
    "packages": [
        {
            "path": "/home/[username]/workspace/[project]/",
            "name": "d",
            "version": "~master",
            "description": "Hello World - A minimal DUB bundle.",
            "homepage": "",
            "authors": [],
            "copyright": "",
            "license": "",
            "dependencies": [],
            "active": true,
            "configuration": "library",
            "targetType": "library",
            "targetPath": "",
            "targetName": "d",
            "targetFileName": "libd.a",
            "workingDirectory": "",
            "mainSourceFile": "",
            "dflags": [],
            "lflags": [],
            "libs": [],
            "copyFiles": [],
            "versions": [],
            "debugVersions": [],
            "importPaths": [
                "src/"
            ],
            "stringImportPaths": [],
            "preGenerateCommands": [],
            "postGenerateCommands": [],
            "preBuildCommands": [],
            "postBuildCommands": [],
            "buildRequirements": [],
            "options": [],
            "files": [
                {
                    "role": "source",
                    "path": "src/hello.d"
                }
            ]
        }
    ],
    "targets": [
        {
            "rootPackage": "d",
            "packages": [
                "d"
            ],
            "rootConfiguration": "library",
            "buildSettings": {
                "targetType": 6,
                "targetPath": "/home/[username]/workspace/[project]",
                "targetName": "d",
                "workingDirectory": "",
                "mainSourceFile": "",
                "dflags": [],
                "lflags": [],
                "libs": [],
                "linkerFiles": [],
                "sourceFiles": [
                    "/home/[username]/workspace/[project]/src/hello.d"
                ],
                "copyFiles": [],
                "versions": [
                    "Have_d"
                ],
                "debugVersions": [],
                "importPaths": [
                    "/home/[usrname]/workspace/[project]/src/"
                ],
                "stringImportPaths": [],
                "importFiles": [],
                "stringImportFiles": [],
                "preGenerateCommands": [],
                "postGenerateCommands": [],
                "preBuildCommands": [],
                "postBuildCommands": [],
                "requirements": [],
                "options": [
                    "debugMode",
                    "debugInfo",
                    "warningsAsErrors"
                ]
            },
            "dependencies": [],
            "linkDependencies": []
        }
    ]
}
  ^^^ Terminated, exit code: 0 ^^^```
bruno-medeiros commented 7 years ago

.project is an Eclipse / DDT file, and the dub describe output is also related to DDT - but this is irrelevant if when you run dub build on the command-line you don't get an executable. You need to figure out the problem there first, the IDE/editor you are using won't matter.