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

How to get MacPorts to install something without updating all existing packages
macports on mac os x mountain lion
Mac port errors on OSX Mountain Lion
Macports warning when installing automake: Warning: Deactivate forced. Proceeding despite dependencies
Macports Selfupdate
How to recompile macport with additional ./configure flag?
Macport self update failed
Is it possible to use MacPorts to distribute custom software?
How do I make libgc work in Mac OS X?
500 OOPS: vsftpd: not configured for standalone, must be started from inetd
Mac Ports Update Failing
Macports ncurses error when trying to upgrade [closed]
macports: list out my own ports
why does macports “--set ipython ipython32” fail?
Prevent MacPorts from installing pre-built package?
Wine is extremely slow, how do I find out why?

Categories

HOME
opengl
rust
systemd
tcsh
material-components
google-search-console
javafx-8
cdi
tweepy
cocotb
jpa-criteria
mutation-testing
reportviewer
yahoo
documentum
chromecast
business-intelligence
jquery-file-upload
vmware-workstation
maven-plugin
cloudsim
clr
akka-persistence
neo4j.rb
connection-refused
channel
ava
cellular-network
fstar
jackrabbit-oak
locks
dotcms
premake
plantuml
knights-tour
sql-execution-plan
image-optimization
nppexec
keyboard-layout
assertions
linq.js
best-buy-api
flowchart
oauth2-playground
access-denied
code-push
libreoffice-writer
uiautomatorviewer
head.js
skip-lists
nivo-slider
test-data
gmaps.js
pbx
ogg
metabase
livereload
livecycle
zynq
perforce-integrate
gdl
lowercase
green-threads
webproject
python-curses
python-c-extension
dos2unix
fasterxml
adhoc-polymorphism
configurable-product
datagridcomboboxcolumn
dc
device-admin
webmethod
.htpasswd
nosql-aggregation
assetic
frontbase
jquery-transit
lru
postgres-xc
html-frames
days
reentrancy
oembed
itunes-sdk
simplecov
stretch
android-dialog
pyjamas
explicit
html-components
database-cloning
code-camp
rootkit
error-detection

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App