Skip to content

Compiling with --lib won't create a library on Windows #128

Description

@nachoverdon

The compiler won't create a library on Windows when using the option --lib

I'm trying to build a .dll using kitc mycode.kit --lib, but instead of creating a .dll, it is creating an invalid .exe file. This is the output of the compiler:

[2019-04-28 19:32:06.3972] ===> parsing and building module graph
[2019-04-28 19:32:06.4252] ===> processing C includes
[2019-04-28 19:32:06.7409] ===> expanding macros
[2019-04-28 19:32:06.7439] ===> resolving module types
[2019-04-28 19:32:06.7529] ===> flattening trait implementations
[2019-04-28 19:32:06.7579] ===> typing module content
[2019-04-28 19:32:06.8138] ===> generating intermediate representation
[2019-04-28 19:32:06.8307] ===> generating code
[2019-04-28 19:32:06.8766] ===> compiling
[2019-04-28 19:32:07.9018] ===> linking
[2019-04-28 19:32:08.0046] ===> finished; total time: 1.6073345s

Code used

function hello() {
    printf("%s\n", "Hello from Kit!");
}

Environment

kitc --env

[2019-04-28 19:30:25.1959] ===> kitc version
[2019-04-28 19:30:25.1988] DBG: 0.1.0
[2019-04-28 19:30:25.2018] ===> OS
[2019-04-28 19:30:25.2048] DBG: mingw32
[2019-04-28 19:30:25.2088] ===> Source paths
[2019-04-28 19:30:25.2118] DBG: ["src","C:\\Users\\bazoo\\scoop\\apps\\kitlang-prerelease\\0.1.0-prerelease-0\\std"]
[2019-04-28 19:30:25.2178] ===> Standard prelude location
[2019-04-28 19:30:25.2208] DBG: C:\Users\bazoo\scoop\apps\kitlang-prerelease\0.1.0-prerelease-0\std\prelude.kit
[2019-04-28 19:30:25.2268] ===> ** COMPILER **
[2019-04-28 19:30:25.2298] ===> Toolchain
[2019-04-28 19:30:25.2338] DBG: C:\Users\bazoo\scoop\apps\kitlang-prerelease\0.1.0-prerelease-0\toolchains\windows-mingw
[2019-04-28 19:30:25.2397] ===> Compiler
[2019-04-28 19:30:25.2427] DBG: gcc
gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[2019-04-28 19:30:25.2647] ===> Include paths
[2019-04-28 19:30:25.2677] DBG: []
[2019-04-28 19:30:25.2707] ===> Compiler flags
[2019-04-28 19:30:25.2736] DBG: ["-D__USE_MINGW_ANSI_STDIO","-std=c99","-pedantic","-O3","-Os","-Wno-missing-braces","-Wno-shift-op-parentheses"]
[2019-04-28 19:30:25.2806] ===> Linker flags
[2019-04-28 19:30:25.2836] DBG: ["-std=c99","-pedantic","-O3","-Os","-Wno-missing-braces","-Wno-shift-op-parentheses"]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions