* Create and use masm/fasm lib: http://www.purebasic.fr/english/viewtop ... 4&p=489136
* Create and use Visual Studio lib: http://www.purebasic.fr/english/viewtop ... 9&p=486947
im using 5.42LTS-x64 and very recent Linux Mint 64
1. Create mylib.c
Code: Select all
double addnums(double num1, double num2) {
return num1 + num2;
}
Code: Select all
gcc -c -o mylib.o mylib.c -m32/-m64
3. Compile the object to library (mylib.o -> mylib.a) - not really needed unless you want to bundle multiple .o's into a .a:
Code: Select all
ar rcs mylib.a mylib.o
Code: Select all
ImportC "mylib.a" ;ImportC not Import
addnums.d (value1.d, value2.d) As "addnums"
EndImport
MessageRequester("Result", StrD(addnums(5,3)) )
NOTE: The rest of this thread can essentially be disregarded, as it's about a problem i initially had due when i first posted using reserved word "add" for my procedure name which i renamed to "addnums" to fix - thanks to jack for isolating that issue
