Skip to content

Windows build with forced x64 arch can not find any symbols and symbols check fails #28

Open
@blacklion

Description

@blacklion

I have gradle 7.3.3, and I have this definition of JNI library:

    // Sorry, ARM, I don't understand how to fix this
    platforms {
        x64 {
            architecture "x86_64"
        }
    }
    components {
        jniwrapper(JniNativeLibrarySpec) {
            // Default is 32 bit in 2022, crazy
            targetPlatform "x64"
            enableCheckTask true
            javaCompileTasks << compileJava
            sources {
                c {
                    source {
                        srcDirs 'src/main/native'
                        include '**/*.c'
                    }
                }
            }
        }
    }

I need to define platform, as by default gradle builds 32 bit DLL on 645 bit windows ith 64-bit-only JDK 17 (which is crazy, IMHO).

This config fails to find ANY symbols in resulting DLL. DLL is built successfully, no problems, and it is 64 bit, with proper symbols.

If I omit all this "platform" dance everything works, but resulting DLL is 32 bit one, which is, of course, unusable :-)

I have MSVC Community installed at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions