Author Topic: freeBSD parametres of llvm/clang  (Read 506 times)

Offline philo_neo

  • Single posting newcomer
  • *
  • Posts: 9
freeBSD parametres of llvm/clang
« on: May 20, 2017, 03:20:38 am »
Hi,
i've installed C::B under freeBSD 10.3, and i use LLVM/clang for the compilator.
i try to parametred the IDE with LLVM/Clang devel ports but i have issue.
after research on internet i intalled LLVM/Clang 3.6, it's better then devel but is not run yet.
i want to know whitch additionnaly parametres toolschain for setting C::B.
1 / user directory == /usr/local/llvm36/bin
2/ setting
-C compiler == clang
-C++ compiler == clang++
-linker for dynamics libs == llvm-link -use-mbpi
-linker for statics libs ==llvm-ar
-resourcecompiler == clang++
-Make program == make

issue >> error expected top-level entity

some one can help me
« Last Edit: May 20, 2017, 03:24:29 am by philo_neo »


Offline philo_neo

  • Single posting newcomer
  • *
  • Posts: 9
Re: freeBSD parametres of llvm/clang
« Reply #2 on: May 20, 2017, 04:26:24 am »
hi,
i anderstand that you want !
version of C::B is 16.01
the test program is "hello world"... new projet .....
C::B not crashed ! so not log file !
build log :
Code: [Select]


-------------- Build: Debug in essai009 (compiler: LLVM Clang Compiler)---------------

llvm-link -use-mbpi  -o bin/Debug/essai009 obj/Debug/main.o   
llvm-link: obj/Debug/main.o:1:1: error: expected top-level entity
ELF         `)444444((22//    !!!!""""####$$$$%%%%&&&&''''(((())))))))UUUnk: error loading file 'obj/Debug/main.o'
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5970
    • My Best Post
Re: freeBSD parametres of llvm/clang
« Reply #3 on: May 20, 2017, 05:57:01 am »
Change "linker for dynamics libs" back to the default of
Code: [Select]
clang++
instead of this which causes the error you got.
Code: [Select]
llvm-link -use-mbpi

Edit: My full build log
Code: [Select]
-------------- Build: Release in clang (compiler: LLVM Clang Compiler)---------------

clang++ -Weverything -fexceptions -O2 -Wno-potentially-evaluated-expression  -c /home/stahta01/devel/open_source_code/no_version_control/CB_wizard_testing/clang/main.cpp -o obj/Release/main.o
clang++  -o bin/Release/clang obj/Release/main.o  -s 
Output file is bin/Release/clang with size 6.24 KB

Tim S.
« Last Edit: May 20, 2017, 06:11:05 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline philo_neo

  • Single posting newcomer
  • *
  • Posts: 9
Re: freeBSD parametres of llvm/clang
« Reply #4 on: May 20, 2017, 04:19:23 pm »
hi,
i do your recommandations, there are no error , but xterm for output doesn't display.

Code: [Select]
-------------- Run: Debug in essai009 (compiler: LLVM Clang Compiler)---------------

Checking for existence: /usr/home/phipo/langage_c++/essai009/bin/Debug/essai009
Executing: xterm -T essai009 -e /usr/home/phipo/langage_c++/essai009/bin/Debug/essai009  (in /usr/home/phipo/langage_c++/essai009/.)
Process terminated with status 0 (0 minute(s), 0 second(s))
 

also i don't have a linker setting : like >> file.a, file.so, file.lib,etc....

it's miss the parametre for open xterm
i have :
shell to run commands in ==/bin/sh -c
terminal to lauch console program==xterm -T $TITLE -e
« Last Edit: May 20, 2017, 05:00:12 pm by philo_neo »

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1542
Re: freeBSD parametres of llvm/clang
« Reply #5 on: May 20, 2017, 05:54:38 pm »
are you sure that it does not display? Or does it display and closes immediately?
What if you call your program from the console? Does it work?

Offline philo_neo

  • Single posting newcomer
  • *
  • Posts: 9
Re: freeBSD parametres of llvm/clang
« Reply #6 on: May 20, 2017, 06:23:53 pm »
hi,
when i start C::B at the first time >>does it display and closes immediately !

but when i load a c++ program a little complex , this is my output of build log:
Code: [Select]
-------------- Build: Release in fonction002 (compiler: LLVM Clang Compiler)---------------

clang++  -o bin/Release/fonction002 obj/Release/main.o  -s 
obj/Release/main.o: In function `main':
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x43): undefined reference to `std::cout'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x48): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x53): undefined reference to `std::cout'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x58): undefined reference to `std::ostream::operator<<(int)'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x72): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0x88): undefined reference to `std::ostream& std::ostream::_M_insert<double>(double)'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0xb4): undefined reference to `std::ctype<char>::_M_widen_init() const'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0xd3): undefined reference to `std::ostream::put(char)'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0xdb): undefined reference to `std::ostream::flush()'
/home/phipo/langage_c++/fonction002/main.cpp:(.text+0xf3): undefined reference to `std::__throw_bad_cast()'
obj/Release/main.o: In function `_GLOBAL__sub_I_main.cpp':
/home/phipo/langage_c++/fonction002/main.cpp:(.text.startup+0xb): undefined reference to `std::ios_base::Init::Init()'
/home/phipo/langage_c++/fonction002/main.cpp:(.text.startup+0x22): undefined reference to `std::ios_base::Init::~Init()'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
Process terminated with status 1 (0 minute(s), 0 second(s))
13 error(s), 0 warning(s) (0 minute(s), 0 second(s))

i don't anderstand but under linux all work fine !

regards
philippe