Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path issue while compiling the script #7

Open
ghost opened this issue Sep 9, 2019 · 8 comments
Open

Path issue while compiling the script #7

ghost opened this issue Sep 9, 2019 · 8 comments

Comments

@ghost
Copy link

ghost commented Sep 9, 2019

Screenshot (330)

Any idea what is might be?

@Luca96
Copy link
Owner

Luca96 commented Sep 9, 2019

Hi,
can you tell me the path whence you execute the script?

@PicoisCharlotte
Copy link

Hello !
I've got exactly the same issue ... I tried with both relative path and absolute path ...
I don't know what to do more ....

@harishkandekar
Copy link

same issue i got

@harishkandekar
Copy link

any solution ?? in my project even ccp folder also not getting generated

@Luca96
Copy link
Owner

Luca96 commented Oct 17, 2020

Try to make sure that the path where the .so get created is the same of the script. If not, adjust accordingly.

@ninh-huynh
Copy link

I run into the same problem after compile dlib.
The problem is in this line.
@Luca96 change the working directory when compiling dlib but he forgets to undo it after the compiled finish.

To quick fix, you can comment this line Compile-Dlib and re-run the setup.ps1 again to copy the lib to Android Studio Project.

@Luca96
Copy link
Owner

Luca96 commented Dec 4, 2020

Hi @kim-ninh , thank you very much for the suggestion.

Could you check if the following code solves the issue (replace this code-block):

# Dlib library path:
$DLIB_PATH = 'dlib'

function Compile-Dlib {
    $CWD = Get-Location
    Set-Location $DLIB_PATH
    Make-Dir 'build'

    Write-Host '=> Compiling Dlib...'
    sleep 0.5

    ForEach ($abi in $ABIs) {
        Write-Host
        Write-Host "=> Compiling Dlib for ABI: '$abi'..."
        sleep 0.5

        Make-Dir "build\$abi"
        Set-Location "build\$abi"

        $cmakeArguments = @(
                "-DBUILD_SHARED_LIBS=1",
                "-DANDROID_NDK=$NDK",
                "-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN",
                "-GNinja",
                "-DCMAKE_BUILD_TYPE=Release",
                "-DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions",
                "-DCMAKE_C_FLAGS=-O3",
                "-DANDROID_ABI=$abi",
                "-DANDROID_PLATFORM=android-$MIN_SDK",
                "-DANDROID_TOOLCHAIN=clang",
                "-DANDROID_STL=c++_shared",
                "-DANDROID_CPP_FEATURES=rtti exceptions",
                "-DCMAKE_PREFIX_PATH=..\..\",
                "..\..\"
        )

        $stripArguments = @(
                "--strip-unneeded",
                "dlib/libdlib.so"
        )

        & $AndroidCmake $cmakeArguments
        sleep 0.5

        Write-Host "=> Generating the 'dlib/libdlib.so' for ABI: '$abi'..."
        & $AndroidCmake --build .
        sleep 0.5

        Write-Host "=> Stripping libdlib.so for ABI: '$abi'to reduce space..."
        & $STRIPPERS[$abi] $stripArguments
        sleep 0.5

        Write-Host '=> done.'
        Set-Location $CWD
        sleep 0.5
    }    
}

Thanks in advance

@ninh-huynh
Copy link

Hi @kim-ninh , thank you very much for the suggestion.

Could you check if the following code solves the issue (replace this code-block):

# Dlib library path:
$DLIB_PATH = 'dlib'

function Compile-Dlib {
    $CWD = Get-Location
    Set-Location $DLIB_PATH
    Make-Dir 'build'

    Write-Host '=> Compiling Dlib...'
    sleep 0.5

    ForEach ($abi in $ABIs) {
        Write-Host
        Write-Host "=> Compiling Dlib for ABI: '$abi'..."
        sleep 0.5

        Make-Dir "build\$abi"
        Set-Location "build\$abi"

        $cmakeArguments = @(
                "-DBUILD_SHARED_LIBS=1",
                "-DANDROID_NDK=$NDK",
                "-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN",
                "-GNinja",
                "-DCMAKE_BUILD_TYPE=Release",
                "-DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions",
                "-DCMAKE_C_FLAGS=-O3",
                "-DANDROID_ABI=$abi",
                "-DANDROID_PLATFORM=android-$MIN_SDK",
                "-DANDROID_TOOLCHAIN=clang",
                "-DANDROID_STL=c++_shared",
                "-DANDROID_CPP_FEATURES=rtti exceptions",
                "-DCMAKE_PREFIX_PATH=..\..\",
                "..\..\"
        )

        $stripArguments = @(
                "--strip-unneeded",
                "dlib/libdlib.so"
        )

        & $AndroidCmake $cmakeArguments
        sleep 0.5

        Write-Host "=> Generating the 'dlib/libdlib.so' for ABI: '$abi'..."
        & $AndroidCmake --build .
        sleep 0.5

        Write-Host "=> Stripping libdlib.so for ABI: '$abi'to reduce space..."
        & $STRIPPERS[$abi] $stripArguments
        sleep 0.5

        Write-Host '=> done.'
        Set-Location $CWD
        sleep 0.5
    }    
}

Thanks in advance

Sound great 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants