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?

Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
  • 1
    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++ – jstedfast Mar 24 '13 at 12:28
  • 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. – Carl Veazey Mar 24 '13 at 17:02
  • @CarlVeazey Thank you. :) I am fairly new to SO so I apologize for offending anyone... Thanks though. :) –  Mar 25 '13 at 05:57
  • @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. –  Mar 25 '13 at 06:03
  • 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. – jstedfast Mar 25 '13 at 12:05
  • @jstedfast : It is still saying "library not found for lMonkeyTalk-1.0.40" Is there a step I completely missed before this...? –  Mar 25 '13 at 17:30
  • EDIT: @jstedfast : 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? –  Mar 25 '13 at 17:36
  • 1
    Unless yours is different it should be `-lsqlite3.0` (missing dot). – poupou Mar 25 '13 at 19:22

1 Answers1

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"
poupou
  • 43,413
  • 6
  • 77
  • 174
  • 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. –  Mar 25 '13 at 06:03