<p>Hello,<br>
It is indeed a dirty hack, the <code>stdio.h</code> is already in the include path,  but i realized that in Musl, only the definition of FILE is available in stdio.h, the struct <strong>_IO_FILE</strong>, however, is not publicly defined (i.e. it is not available in the public headers). That cause an error about incomplete type definition when gcc tries to compile the line:</p>
<div class="highlight highlight-source-c"><pre><span class="pl-k">static</span> <span class="pl-c1">FILE</span> stdoutStack[STDOUT_STACK_SZ];</pre></div>
<p>So i put the explicit definition to the <code>sqVirtualMachine.c</code>,  it works for me, but, is indeed not a good solution. What we can do is to put that definition somewhere else, and only include it in <code>sqVirtualMachine.c</code> if we are using Musl as lib implementation.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW3bdxO47wu6oeup-ATXpbViKdwaRks5utfkQgaJpZM4YWPl_">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW8s5rz_TK5ZibuyrmTdsfNO1dZgbks5utfkQgaJpZM4YWPl_.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@lxsang in #304: Hello,\r\nIt is indeed a dirty hack, the ```stdio.h``` is already in the include path,  but i realized that in Musl, only the definition of FILE is available in stdio.h, the struct **_IO_FILE**, however, is not publicly defined (i.e. it is not available in the public headers). That cause an error about incomplete type definition when gcc tries to compile the line:\r\n```c\r\nstatic FILE stdoutStack[STDOUT_STACK_SZ];\r\n```\r\nSo i put the explicit definition to the ```sqVirtualMachine.c```,  it works for me, but, is indeed not a good solution. What we can do is to put that definition somewhere else, and only include it in ```sqVirtualMachine.c``` if we are using Musl as lib implementation.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)",
"sections": [
{
"text": "",
"activityTitle": "**Xuan Sang LE**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@lxsang",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 304,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 304\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 408484223\n}"
}
],
"themeColor": "26292E"
}
]</script>