Compiling and linking with G++

Apr 18, 2007 at 2:32pm

Compiling and linking with G++

Hi all,

I usually work on OS-X, but I’ve been trying to build a Windows version of one of my objects that was written in C++ using G++ in Cygwin. There are instructions on how to do this in the Windows SDK for gcc but not for g++. Um… I had no problem figuring out which command I needed to use to get g++ to compile the files, but when I tried to link the files, unfortunately g++ is unable to find the Max libraries that I gave as arguments.

For example when trying to compile the example MSP application plussz~ with the command:

g++ -shared -mno-cygwin -L../../c74support/max-includes -lMaxAPI -L../../c74support/msp-includes -lMaxAudio -o plussz~.mxe plussz~.o plussz~.def

I got the error message:
Cannot export ⌂MaxAudio_NULL_THUNK_DATA: symbol not found
plussz~.o:plussz~.c:(.text+0x4e): undefined reference to `_z_dsp_free’

plussz~.o:plussz~.c:(.text+0×62): undefined reference to `_setup’
plussz~.o:plussz~.c:(.text+0×86): undefined reference to `_addmess’
… and so on…

I’m sure that I’m going some little thing wrong. Missing some flag or something along those lines. Does anyone know what it is that I might have done wrong here?

Thanks,
Greg

#31451
Apr 18, 2007 at 2:53pm

Greg –

You might take a look at the Makefiles I used to compile rtcmix~ for
windows (source is here, down towards the bottom of the page):

http://rtcmix.org/rtcmix~

I was able to use g++ to compile the main RTcmix code and then drag
it into the rtcmix~ object. It’s pretty grungy code, though.

brad

http://music.columbia.edu/~brad

Quoting Greg Kellum :

>
> Hi all,
>
> I usually work on OS-X, but I’ve been trying to build a Windows
> version of one of my objects that was written in C++ using G++ in
> Cygwin. There are instructions on how to do this in the Windows
> SDK for gcc but not for g++. Um… I had no problem figuring
> out which command I needed to use to get g++ to compile the
> files, but when I tried to link the files, unfortunately g++ is
> unable to find the Max libraries that I gave as arguments.
>
> For example when trying to compile the example MSP application
> plussz~ with the command:
>
> g++ -shared -mno-cygwin -L../../c74support/max-includes -lMaxAPI
> -L../../c74support/msp-includes -lMaxAudio -o plussz~.mxe
> plussz~.o plussz~.def
>
> I got the error message:
> Cannot export ⌂MaxAudio_NULL_THUNK_DATA: symbol not found
> plussz~.o:plussz~.c:(.text+0x4e): undefined reference to
> `_z_dsp_free’

> plussz~.o:plussz~.c:(.text+0×62): undefined reference to `_setup’
> plussz~.o:plussz~.c:(.text+0×86): undefined reference to
> `_addmess’
> … and so on…
>
> I’m sure that I’m going some little thing wrong. Missing some
> flag or something along those lines. Does anyone know what it is
> that I might have done wrong here?
>
> Thanks,
> Greg
>
>

#102348
Apr 19, 2007 at 5:23pm

Hi,

Thanks, Brad. After looking at your makefile I was able to figure out what I did wrong. I didn’t create a def file, and my arguments were apparently ordered incorrectly.

Best,
Greg

#102349

You must be logged in to reply to this topic.