Xcode에서 .dylib를 만들고 사용하는 가장 기본적인 방법은 무엇입니까?간단한 .dylib 만들기 및 사용
파일 : MyLib.h
#include <string>
namespace MyLib
{
void SayHello(std::string Name);
}
파일 : MyLib.cpp
#include <string>
#include <iostream>
#include "MyLib.h"
void MyLib::SayHello(std::string Name)
{
std::cout << "Hello, " << Name << "!";
}
내가 같이 컴파일 할 프로젝트를 가지고 여기
내가 지금까지 가지고 무엇을 동적 라이브러리이지만 다른 프로젝트에서 어떻게 사용합니까?파일 : 나는이 같은 노력 MyLibTester.cpp
#include "libMyLib.dylib"
int main()
{
MyLib::SayHello("world");
return 0;
}
을하지만 대부분 Stray \123 in program
의 라인을 따라 400 오류 (이상 준 <libMyLib.dylib>
나에게 file not found
오류를 준 사용