Additional Mtouch Arguments in iOS
Asked Answered
E

1

7

I have a quick question about a "Additional mtouch arguments"

-gcc_flags "-lstdc++ -L${ProjectDir} -libMonkeyTalk-1.0.40 -lsqlite30 -framework CFNetwork -framework QuartzCore -all_load"

I have that as an additional argument but I am getting the following error when I build my iOS application.

Error MT5201: Native linking failed. Please review user flags provided to gcc: "-lstdc++" "-L/Users/henry/Downloads/HelloWorld_iPhone/HelloWorld_iPhone" "-libMonkeyTalk-1.0.40" "-lsqlite30" "-framework" "CFNetwork" "-framework" "QuartzCore" "-all_load" (MT5201) (HelloWorld_iPhone)

How can I fix this? What is wrong with my argument? Am I missing a step in adding the MonkeyTalk lib or is something else wrong?

Emeric answered 24/3, 2013 at 5:29 Comment(8)
You need to look at the rest of the build log to know what went wrong, exactly. Specifically, you need to look at the errors given by g++Chiachiack
Hi @Henry, the usual style on SO is to avoid putting explicit tags in the question title, and also to keep the 'chattiness' to a minimum, including normal politeness. We just like to assume you are friendly and polite already, and not require you to prove it to us :) I edited your question to bring it in line with the typical style. Hope you get a great answer.Leclerc
@CarlVeazey Thank you. :) I am fairly new to SO so I apologize for offending anyone... Thanks though. :)Emeric
@jstedfast: I looked inside the build output and saw that the error is, ld: library not found for -libMonkeyTalk-1.0.40 I guess I must have missed a first step in the process.Emeric
ah, I think I see the problem: -libMonkeyTalk-1.0.40 should probably be -lMonkeyTalk-1.0.40. You may also need the --cxx flags like poupou suggested.Chiachiack
@Chiachiack : It is still saying "library not found for lMonkeyTalk-1.0.40" Is there a step I completely missed before this...?Emeric
EDIT: @Chiachiack : I have successfully gotten the MonkeyTalk lib to build, but now I am getting a new error, ld: library not found for -lsqlite30 What are the different steps I need to perform for this?Emeric
Unless yours is different it should be -lsqlite3.0 (missing dot).Attendance
A
3

MT5201 errors means the build failed when running the native linker.

One of the most common issue are related to the additional (and unvalidated) arguments given to the linker using -gcc_flags. This is why the error message ask you to review them.

However it's not the only reason why linking can fail. Once reviewed you should look at the build log (inside XS error pad) to see the warnings/errors reported by the linker (and even earlier messages).

If your question provided your full additional mtouch arguments then your issue might be linking with C++ libraries (your "-lstdc++) without telling mtouch to compile using the C++ compiler, using --cxx.

Note that this is a mtouch argument, not a linker argument, so it must not be inside your --gcc_flags. E.g.

--cxx -gcc_flags "-lstdc++ -L${ProjectDir} -libMonkeyTalk-1.0.40 -lsqlite30 -framework CFNetwork -framework QuartzCore -all_load"
Attendance answered 24/3, 2013 at 15:46 Comment(1)
I looked inside the build output and saw that the error is, ld: library not found for -libMonkeyTalk-1.0.40 I guess I must have missed a first step in the process.Emeric

© 2022 - 2024 — McMap. All rights reserved.