Sign in to follow this  

[.net] Dll exception with P/Invoke

This topic is 3595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create a C# interface to SOIL, and I've got all the code written, but I can't get the application to actually find the libSOIL.a library file. I'm on Mac OS X, using this nant build file
<?xml version="1.0"?>
<project name="Game" default="package">
    
    <target name="clean">
        <delete file="Game.exe" />
        <delete dir="Game.app" />
    </target>
    
    <target name="build" depends="clean">
        <csc target="exe" output="Game.exe">
            <sources>
                <include name="Source/*.cs" />
            </sources>
            <references>
                <include name="Assemblies/*.dll" />
                <include name="System.dll" />
                <include name="System.IO.dll" />
                <include name="System.Text.dll" />
                <include name="System.Runtime.InteropServices.dll" />
            </references>
        </csc>
    </target>
    <target name="package" depends="build">
        
        <exec program="macpack">
            <arg value="-m:cocoa" />
            <arg value="-n:Game" />
            <arg value="-a:Game.exe" />
        </exec>
        
        <copy todir="Game.app/Contents/Resources" flatten="true">
            <fileset>
                <include name="Assemblies/*.dll" />
				<include name="Assemblies/*.a" />
                <include name="Assemblies/*.config" />
				<include name="Data/*.png" />
            </fileset>
        </copy>
        
        <exec program="cp">
            <arg value="-r" />
            <arg value="Frameworks" />
            <arg value="Game.app/Contents" />
        </exec>
        
        <exec program="cp">
            <arg value="-r" />
            <arg value="Libraries" />
            <arg value="Game.app/Contents" />
        </exec>
        <delete file="Game.exe" />
    </target>
</project>
but I must admit, I'm not very familiar with nant or any type of C# build process. How can I get my application to find libSOIL.a at runtime? I tried adding libSOIL.a to the Assemblies folder, which in turn is dumped into the Resources folder of the built Mac application, but that doesn't work.

Share this post


Link to post
Share on other sites

This topic is 3595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this