Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

388
Views
¿Cómo crear un paquete C++ usando Swift Package Manager?

Estoy siguiendo este blog para hacer un paquete C++ usando SPM: http://ankit.im/swift/2016/05/21/creating-objc-cpp-packages-with-swift-package-manager/

Pero recibo este error al construir:

 swift build 'SwiftCpp' /home/karthik/Swift_programs/SwiftCpp: error: target at '/home/karthik/Swift_programs/SwiftCpp/Sources' contains mixed language source files; feature not supported

Estoy usando Swift versión 4.2.3 en Ubuntu 18.04 LTS.

Aquí está el código:

principal.cpp

 #include <iostream> #include "cpplib.h" int main() { std::cout << cpplib::five(); return 0; }

cpplib.cpp

 #include "include/cpplib.h" namespace cpplib { int five(){ return 5; } }

cpplib.h

 namespace cpplib{ int five(); }

cwrapper.cpp

 #include "include/cwrapper.h" #include "cpplib.h" int cwrapperfive(){ return cpplib::five(); }

cwrapper.h

 #ifdef __cplusplus extern "C" { #endif int cwrapperfive(); #ifdef __cplusplus } #endif

principal.swift

 import cwrapper print(cwrapperfive())

¿Como puedo resolver esto?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!