thebaselab / codeapp

Building a full-fledged code editor for iPad
https://code.thebaselab.com
MIT License
2.95k stars 202 forks source link

希望支持C++多文件编译 #248

Closed lifeWithBug closed 2 years ago

lifeWithBug commented 3 years ago

例如我在GradeBook.h中声明了GradeBook类的成员函数,在GradeBook.cpp中定义了Book类的成员函数,在main.cpp中(含main函数)运行时发生报错: /usr/bin/ld: /tmp/CCRGiKu0.0: in function 'main': main.cpp: (.text+0x413): undefined reference to 'GradeBook::GradeBook(std:: _cxx11: :basic_string<char, std:: char_traits, std: : allocator > const&, std: :array<int, 10ul> const&) collect2: error: ld returned 1 exit status

希望得到解决😁

bummoblizard commented 3 years ago

这个情况你可以使用内置的clang命令,具体如下: clang++ GradeBook.cpp clang++ main.cpp clang++ GradeBook.o main.o ./a.out

On Thu, 23 Sep 2021 at 14:07, lifeWithBug @.***> wrote:

例如我在GradeBook.h中声明了GradeBook类的成员函数,在GradeBook.cpp中定义了Book类的成员函数,在main.cpp中(含main函数)运行时发生报错: /usr/bin/ld: /tmp/CCRGiKu0.0: in function 'main': main.cpp: (.text+0x413): undefined reference to 'GradeBook::GradeBook(std:: _cxx11: :basic_string<char, std:: char_traits, std: : allocator > const&, std: :array<int, 10ul> const&) collect2: error: ld returned 1 exit status

希望得到解决😁

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE6T24D5Z52RZ6WWYDIHWDUDK73BANCNFSM5ES4X2DQ .

lifeWithBug commented 3 years ago

命令应该没问题,但是其实终端还有部分字符不会显示的bug。😂

发自我的iPad

在 2021年9月23日,下午2:11,Ken Chung @.***> 写道:

 这个情况你可以使用内置的clang命令,具体如下: clang++ GradeBook.cpp clang++ main.cpp clang++ GradeBook.o main.o ./a.out

On Thu, 23 Sep 2021 at 14:07, lifeWithBug @.***> wrote:

例如我在GradeBook.h中声明了GradeBook类的成员函数,在GradeBook.cpp中定义了Book类的成员函数,在main.cpp中(含main函数)运行时发生报错: /usr/bin/ld: /tmp/CCRGiKu0.0: in function 'main': main.cpp: (.text+0x413): undefined reference to 'GradeBook::GradeBook(std:: _cxx11: :basic_string<char, std:: char_traits, std: : allocator > const&, std: :array<int, 10ul> const&) collect2: error: ld returned 1 exit status

希望得到解决😁

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE6T24D5Z52RZ6WWYDIHWDUDK73BANCNFSM5ES4X2DQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

bummoblizard commented 3 years ago

这个要到App Store更新 :)

On Thu, 23 Sep 2021 at 14:22, lifeWithBug @.***> wrote:

命令应该没问题,但是其实终端还有部分字符不会显示的bug。😂

发自我的iPad

在 2021年9月23日,下午2:11,Ken Chung @.***> 写道:

 这个情况你可以使用内置的clang命令,具体如下: clang++ GradeBook.cpp clang++ main.cpp clang++ GradeBook.o main.o ./a.out

On Thu, 23 Sep 2021 at 14:07, lifeWithBug @.***> wrote:

例如我在GradeBook.h中声明了GradeBook类的成员函数,在GradeBook.cpp中定义了Book类的成员函数,在main.cpp中(含main函数)运行时发生报错:

/usr/bin/ld: /tmp/CCRGiKu0.0: in function 'main': main.cpp: (.text+0x413): undefined reference to 'GradeBook::GradeBook(std:: _cxx11: :basic_string<char, std:: char_traits, std: : allocator > const&, std: :array<int, 10ul> const&) collect2: error: ld returned 1 exit status

希望得到解决😁

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJE6T24D5Z52RZ6WWYDIHWDUDK73BANCNFSM5ES4X2DQ>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248#issuecomment-925535351, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE6T25B3KIXR63UGJQ3DZDUDLBRTANCNFSM5ES4X2DQ .

lifeWithBug commented 3 years ago

好像还是不行。。。

发自我的iPad

在 2021年9月23日,下午2:23,Ken Chung @.***> 写道:

 这个要到App Store更新 :)

On Thu, 23 Sep 2021 at 14:22, lifeWithBug @.***> wrote:

命令应该没问题,但是其实终端还有部分字符不会显示的bug。😂

发自我的iPad

在 2021年9月23日,下午2:11,Ken Chung @.***> 写道:

 这个情况你可以使用内置的clang命令,具体如下: clang++ GradeBook.cpp clang++ main.cpp clang++ GradeBook.o main.o ./a.out

On Thu, 23 Sep 2021 at 14:07, lifeWithBug @.***> wrote:

例如我在GradeBook.h中声明了GradeBook类的成员函数,在GradeBook.cpp中定义了Book类的成员函数,在main.cpp中(含main函数)运行时发生报错:

/usr/bin/ld: /tmp/CCRGiKu0.0: in function 'main': main.cpp: (.text+0x413): undefined reference to 'GradeBook::GradeBook(std:: _cxx11: :basic_string<char, std:: char_traits, std: : allocator > const&, std: :array<int, 10ul> const&) collect2: error: ld returned 1 exit status

希望得到解决😁

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJE6T24D5Z52RZ6WWYDIHWDUDK73BANCNFSM5ES4X2DQ>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/248#issuecomment-925535351, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE6T25B3KIXR63UGJQ3DZDUDLBRTANCNFSM5ES4X2DQ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

bummoblizard commented 3 years ago

可以留下截图吗?

lifeWithBug commented 3 years ago

很多命令行我都试过了

发自我的iPad

在 2021年9月23日,下午3:34,Ken Chung @.***> 写道:

 可以留下截图吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

lifeWithBug commented 3 years ago

 很多命令行我都试过了

发自我的iPad

在 2021年9月23日,下午3:34,Ken Chung @.***> 写道:  可以留下截图吗?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

lifeWithBug commented 3 years ago

EF02778A-23F7-4E8A-AEDF-C44140BF9784 之前我是用邮箱发的,不知道为什么没有图片显示。。。

bummoblizard commented 3 years ago

Code App 的 C++ 暂不支持exception,请移除try、catch、throw等关键字。

bummoblizard commented 3 years ago

使用clang++ GradeBook.cpp -fno-exceptions编译代码。然后,您可以使用./a.out运行程序。