[futurebasic] Re: [FB] Incorporating External Frameworks into an FB Project

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2013 : Group Archive : Group : All Groups

From: Deep <Info@...>
Date: Tue, 07 May 2013 07:01:27 +0100
On 06/05/2013 23:10, Brian S wrote:
> On May 6, 2013, at 1:20 PM, Deep <Info@...> wrote:
>
>> To make it compile, some tweaks have been made to the source code and these have been listed in the ReadMe in case anyone wants to see what has been changed.
> I dont see any comments about the tweaks in the ReadMe. This appears to be an Xcode compilation of the .h/.c files from  Kentaro Fukuchithe libqrencode 3.4.2 - QR Code encoding library. Maybe youre referring to tweaks by the libqrencode 3.4.2 authors?
>
>
> Brian S.
>
>
I was referring to changes made by me. These are to get the code to 
compile and were otherwise showing "syntax errors" or other easily-fixed 
errors. The file did not make it to the list so the text is copied below:


Note following changes to become Xcode compatible:


Place downloaded file "qrencode-3.4.2.tar.gz" on desktop.

Open Terminal and enter:

cd ~/Desktop/
tar xvzf qrencode-3.4.2.tar.gz
cd qrencode-3.4.2
export png_CFLAGS="-I /usr/X11/include/"
export png_LIBS="-lpng -L/usr/X11/lib/"
touch pkg-config
chmod +x pkg-config
export PATH=$PATH:.
./configure

The "configure" command makes the relevant C files that need to be 
compiled. With the lack of X11 on Mountain Lion, the next steps like 
"make" and "sudo make install" would fail hence building via Xcode with 
the various changes shown below.

Copy all ".c" and ".h" files from the "qrencode-3.4.2" folder on the 
Desktop into a separate folder. Original folder can then be deleted.

Do not require "config.h" file in the Xcode project but keep for the 
moment to copy some lines into another file mentioned below.

Create a new Xcode C command line project.



Set Xcode Project to build the desired binaries (x86_64 i386 ppc7400 
ppc970) or leave as Current Mac.
Set to Minimum Deployment 10.5 or later
Enabled all usual warnings



Changes in "mask.c"

//#if HAVE_CONFIG_H
//# include "config.h"
//#endif



Changes in "mask.c"

Find: __STATIC
Replace: static



Changes in "qrencode.c"

Find: __STATIC
Replace: static



Changes in "mmask.c"

//#if HAVE_CONFIG_H
//# include "config.h"
//#endif


Changes in "qrencode.c"

Find: __STATIC
Replace: static



Changes in "qrenc.c"

//#if HAVE_CONFIG_H
//# include "config.h"
//#endif



Changes in "qrenc.c":

// Disabled "png.h" as it did not exist in Xcode project folder
// #include <png.h>



Changes in "qrenc.c":

// Added to remove Xcode "implicit declaration of memset" warnings
#include <string.h>



Changes in "qrenc.c":

Remove need for function "writePNG" as lack of "png.h" causes errors, 
disabled many of the PNG functions and structures to avoid compile 
errors. Searching the text for "Xcode" to see the comments where items 
have been "commented-out".



Changes in "qrencode.c"

//#if HAVE_CONFIG_H
//# include "config.h"
//#endif



Changes in "qrencode.c"

Find: __STATIC
Replace: static



Changes in "qrinput.c"

//#if HAVE_CONFIG_H
//# include "config.h"
//#endif



Changes in "qrinput.c"

Find: __STATIC
Replace: static



Changes in "qrencode.h"

Extracted from deleted "config.h" and add to end of file:

/* Major version number */
#define MAJOR_VERSION 3

/* Micro version number */
#define MICRO_VERSION 2

/* Minor version number */
#define MINOR_VERSION 4

/* Version number of package */
#define VERSION "3.4.2"