is the next Chiquita
Join Date: Feb 2005
|
After fooling about with command line gcc and getting some success with compiling some C files, I decided to try it out on Xcode. However, Xcode seems bent on passing flag -dynamiclib when I want to pass another incompatible flag -bundle_loader. I've looked everywhere in the Xcode but can't find any setting that would set the project to be compiled with the unwanted -dynamiclib flag.
From the command line, I'd pass this command: Code:
bash-3.2$ gcc -Wall -bundle -bundle_loader /usr/local/mysql/bin/mysqld -o my_udf.so `/usr/local/mysql/bin/mysql_config --cflags` My_UDF.c (the mysql_config resolves to this:Code:
-I/usr/local/mysql/include/mysql -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL )In XCode, I placed the include path in "Header Search Paths", the path to mysqld for "Bundle_Loader", and the rest of flags as shown in "Other C Flags". This let me compile the C file successfully, but when I try to build the file, Xcode complains that -bundle_loader isn't allowed with -dynamiclib. I've already tried to untick some options such as "Link Shared Library" or something similar to no avail. Searching the properties turns nothing for dyn* and lib* or flags. What am I missing? |
quote |
Member
Join Date: May 2007
|
Can you paste the actual GCC command issued by XCode? You can get it from build results window... it is the center view, but is only shown if you click the little icon that looks like morse code (or tiny lines of text)
|
quote |
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
Quote:
You want a dynamic library, and don't need to futz with these other settings. Where have you been getting these flags / suggestions? EDIT: Bundles are absolutely not what you're building here. On Mac OS X, the extension is ".dylib", but even with .so you're making a dynamic library. A bundle is contained in a directory, i.e. MyFancy.plugin/Contents/MacOS/MyFancy. Apparently I call the cops when I see people litter. |
|
quote |
is the next Chiquita
Join Date: Feb 2005
|
Hey, RobUSVI- thanks for posting and apologies for not posting back- I had lost track.
However, I had later found the answer lies in setting Mach-O type to "Bundle" to get rid of that error from conflicting flags being passed. I tried your suggestion but didn't get anything that resembled a command to gcc; it was usually passed to libtool instead. ShadowOfGed, I got this from this when I was having problems with loading the library. I can compile it successfully as a dynamic library but it just doesn't get loaded whereas bundle seems to work. |
quote |
Travels via TARDIS
Join Date: Aug 2005
Location: Earthsea
|
Quote:
Code:
-undefined dynamic_lookup To your link command in some capacity. If you're linking with GCC, that's "-Wl,-undefined,dynamic_lookup". This will allow your code to link, and cause it to properly bind when MySQL loads your object. However, be aware that it will let you mistakenly use any undefined symbol.Apparently I call the cops when I see people litter. |
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
You've got to be kidding me...another Six Flags "hat retrieval" goes wrong | psmith2.0 | AppleOutsider | 32 | 2008-09-04 23:10 |
Tragic Passing.... | Yontsey | AppleOutsider | 25 | 2008-08-21 14:55 |
Teen decapitated by ride at Six Flags Over Georgia | PKIDelirium | AppleOutsider | 82 | 2008-07-02 23:09 |
Profile Flags | Fahrenheit | Feedback | 77 | 2008-04-17 19:06 |
PHP : Passing declared variables to REQUIRE'd files. | drewprops | Genius Bar | 9 | 2005-01-11 00:03 |