# 64 bit woes

**URL:** <https://forum.juce.com/t/64-bit-woes/2680>\
**Category:** Linux\
**Created:** [March 26, 2008, 4:04pm UTC](https://forum.juce.com/t/64-bit-woes/2680 "2008-03-26T16:04:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 26, 2008, 4:04pm UTC](https://forum.juce.com/t/64-bit-woes/2680/1 "2008-03-26T16:04:53Z")

</div>

Trying to compile juce on gcc with -m64 (x86-IA64) but it fails directly on juce\_linux\_Network.cpp:

`[1%] Building CXX object ext/juce-1.45/CMakeFiles/JUCE_core.dir/build/linux/platform_specific_code/juce_linux_Network.o
/tmp/ccWbhNo7.s: Assembler messages:
/tmp/ccWbhNo7.s:86: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccWbhNo7.s:796: Error: Incorrect register `%rax' used with `l' suffix
make[3]: *** [ext/juce-1.45/CMakeFiles/JUCE_core.dir/build/linux/platform_specific_code/juce_linux_Network.o] Error
make[2]: *** [ext/juce-1.45/CMakeFiles/JUCE_core.dir/all] Error 2
make[1]: *** [mixRenderer/CMakeFiles/mixRenderer.dir/rule] Error 2
make: *** [mixRenderer] Error 2`

Have you tried Jules to compile in 64 bit mode?

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 26, 2008, 8:30pm UTC](https://forum.juce.com/t/64-bit-woes/2680/2 "2008-03-26T20:30:36Z")

</div>

Ok, narrowed it down to FD\_SET and asm-i386/posix\_types.h . Why is that included if the -m64 is set? Shouldn’t asm-x86\_64/posix\_types.h be used instead??

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 27, 2008, 10:36am UTC](https://forum.juce.com/t/64-bit-woes/2680/3 "2008-03-27T10:36:17Z")

</div>

no idea… I’d have expected that sort of thing to just work too…

---

<div class="post-metadata">

**Author:** ![gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gunnar](https://forum.juce.com/u/gunnar)\
**Post date:** [March 27, 2008, 1:53pm UTC](https://forum.juce.com/t/64-bit-woes/2680/4 "2008-03-27T13:53:30Z")

</div>

my try to build svn juce for amd64 on linux just worked.  
well actually somethings did not work correctly.

1. the svg graphics was not drawn correctly, but everytime i check out from svn the graphic is another thing, maybe thats the cause.
2. this is a commmon linux problem i think, my hardy heron beta did not play sound because of error with alsa. i think it conflict with the pulseaudio.  
maybe support for pulseaudio or another lib like libao, which supports pulseaudio could be made.

regards,  
gunnar

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 27, 2008, 1:56pm UTC](https://forum.juce.com/t/64-bit-woes/2680/5 "2008-03-27T13:56:12Z")

</div>

Think its my bad, the ubuntu system is 32 bit (although with a 64-bit CPU) so **x86\_64** is not defined. Not being all that gcc-savvy, I don’t know how to change the configuration. But now I have access to a 64-bit ubuntu machine, so I guess it’ll play nicer.

---

<div class="post-metadata">

**Author:** ![gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gunnar](https://forum.juce.com/u/gunnar)\
**Post date:** [March 27, 2008, 2:03pm UTC](https://forum.juce.com/t/64-bit-woes/2680/6 "2008-03-27T14:03:52Z")

</div>

IA64 is Itanium, and i think this is ONLY 64 bit, so actually i think you have and x64( or AMD64) prozessor like core 2 duo.  
what you want is a 64 bit crosscompile, but the executable would not run on your 32 bit OS.

regards, gunnar

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [March 27, 2008, 2:07pm UTC](https://forum.juce.com/t/64-bit-woes/2680/7 "2008-03-27T14:07:40Z")

</div>

[quote=“gunnar”]IA64 is Itanium, and i think this is ONLY 64 bit, so actually i think you have and x64( or AMD64) prozessor like core 2 duo.  
what you want is a 64 bit crosscompile…[/quote]

Yes, think so to. How to do that eludes me I’m afraid… ☹

---

<div class="post-metadata">

**Author:** ![gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gunnar](https://forum.juce.com/u/gunnar)\
**Post date:** [March 28, 2008, 3:20pm UTC](https://forum.juce.com/t/64-bit-woes/2680/8 "2008-03-28T15:20:01Z")

</div>

Hi Jules.  
your last checkin has messed up the 64 bitbuild for linux.

i am getting errors like this:  
In file included from platform\_specific\_code/juce\_linux\_Files.cpp:68:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘void juce::juce\_fileClose(void\*)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:302: error: cast from ‘void\*’ to ‘int’ loses precision  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘int juce::juce\_fileRead(void\*, void\*, int)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:308: error: cast from ‘void\*’ to ‘int’ loses precision  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘int juce::juce\_fileWrite(void\*, const void\*, int)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:316: error: cast from ‘void\*’ to ‘int’ loses precision  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘juce::int64 juce::juce\_fileSetPosition(void\*, juce::int64)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:323: error: cast from ‘void\*’ to ‘int’ loses precision  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘juce::int64 juce::juce\_fileGetPosition(void\*)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:332: error: cast from ‘void\*’ to ‘int’ loses precision  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp: In function ‘void juce::juce\_fileFlush(void\*)’:  
platform\_specific\_code/…/…/macosx/platform\_specific\_code/juce\_posix\_SharedCode.cpp:340: error: cast from ‘void\*’ to ‘int’

to fix this you have to do something like this:

void juce\_fileClose (void\* handle) throw()

{

```
if (handle != 0)

    close ((int)handle);

```

}

chang into:

void juce\_fileClose (void\* handle) throw()

{

```
if (handle != 0)

    close ((int)(intptr_t) handle);

```

}

maybe you should change these nasty void \* into intptr\_t instead. intpr\_t is a type which can be an int or a ptr. on 32bit and 64 bit platforms. its 4 byte on 32bit and 8 byte on 64 bit platforms . it is castable into an int while void \* is not ( on 64 bit)

regards,  
gunnar

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 28, 2008, 8:36pm UTC](https://forum.juce.com/t/64-bit-woes/2680/9 "2008-03-28T20:36:27Z")

</div>

Thanks, yes, I wrote that stuff on the mac, so didn’t spot the problem. I’ve already got a pointer\_sized\_int type in juce that should work fine for casting these.
