macports


How do I make libgc work in Mac OS X?


I must be missing something. Even the simplest test program using libgc fails. Any clues?
$ cat test.c
#include <gc/gc.h>
int main(void)
{
char *s;
s = GC_MALLOC(1);
return 0;
}
$ cc -ansi -pedantic -Wall -I/opt/local/include -L/opt/local/lib -o test test.c -lgc
$ ./test
Segmentation fault
I'm using libgc version 1 installed with macports.
Apparently I need to call GC_INIT to make libgc work on Mac OS X, so my test program would be:
#include <gc/gc.h>
int main(void)
{
char *s;
GC_INIT();
s = GC_MALLOC(1);
return 0;
}

Related Links

Install an older package through macports [closed]
MacPorts: Installing arm-none-linux-gnueabi-* fails
how to remove +universal
Switched from Ubuntu problems Installing gedit on mac via macports. “Gtk-WARNING **: cannot open display:”
Macport self update fail mountain lion. Earlier it was working fine
How to get the size of the installed package via MacPort?
Why won't mariadb listen on port 3306 after a macports update?
MacPorts is not installing
Edit sources of a port before installing
Osgviewer cow does not view a cow?
Error installing libstdcxx with macports
Instructing Macports to download, but not install, dependencies for a port
homebrew uninstall/move macports UNDO [closed]
installing sets/groups/collections of ports using macports
How to get MacPorts to install something without updating all existing packages
macports on mac os x mountain lion

Categories

HOME
powerbi
generics
xcode
transactions
autocomplete
nsis
amp
bittorrent
capistrano
hspi
eddystone
fasm
alljoyn
responsivevoice
bnf
cocos2d-android
scala-ide
xsl-fo
wsf
android-permissions
stackexchange.redis
batch-rename
generator
amazon-sns
acl
exchange-server-2010
php-5.3
bobo-browse.net
spring-annotations
cube
steam-web-api
xcrun
plantuml
om-next
cloveretl
buildforge
text-decorations
grunt-contrib-watch
slideshow
google-prediction
swift2.3
.net-micro-framework
cloudwatch
ol3-google-maps
knockout-2.0
gnome-terminal
nivo-slider
case-when
front-camera
gawk
dcount
conan
wicked-pdf
ioctl
grinder
outlook.com
perceptron
ibm-was
nastran
jnlp
apple
supercomputers
google-gdk
org-babel
mutators
jolie
uno
microsoft-expression-web
juttle
visual-studio-6
redpitaya
hyperloglog
roxy-fileman
nosql-aggregation
lsa
stty
tnt4j
google-code-prettify
pacman
uitextfielddelegate
cakeyframeanimation
memory-pool
expression-web
datacontracts
ppc
inversion
accumulator
jvm-bytecode

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App