Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7847777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:59:56+00:00 2026-06-02T17:59:56+00:00

Here is my compiler part of my config: IF(UNIX) ## Compiler flags # specify

  • 0

Here is my compiler part of my config:

IF(UNIX)
    ## Compiler flags

    # specify the cross compiler
    SET(CMAKE_C_COMPILER   /home/username/projects/buildroot/output/host/usr/bin/arm-linux-gcc)
    SET(CMAKE_CXX_COMPILER /home/username/projects/buildroot/output/host/usr/bin/arm-linux-g++)

    if(CMAKE_COMPILER_IS_GNUCXX)
        set(CMAKE_CXX_FLAGS "-O3")
        set(CMAKE_EXE_LINKER_FLAGS "-lsqlite3 -lrt -lpthread")
    endif()

    target_link_libraries(complex
      ${Boost_FILESYSTEM_LIBRARY}
      ${Boost_SYSTEM_LIBRARY})
ENDIF(UNIX)

There are 3 problems : -lsqlite3 -lrt -lpthread

How must I to make them for my architecture and specify here? How to set (using set?) the path of compiled libraries after I will get them recompiled for my architecture somehow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:59:59+00:00Added an answer on June 2, 2026 at 5:59 pm

    If you want to do cross-compilation with CMake you really should use a toolchain file for that. See the CMake Wiki for an introduction. In order to use third-party libraries (i.e. not included by the cross-compilation toolchain) you need to cross-compile them too.

    Edit: Since you are using the buildroot toolchain, you can use the already included CMake toolchain file. Just pass -DCMAKE_TOOLCHAIN_FILE=/home/username/projects/buildroot/output/toolchainfile.cmake when invoking CMake. No need to set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER in your CMakeLists.txt file. Also, setting CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS is considered to be very bad practice.

    Presumably you have built sqlite3 while building the buildroot toolchain, so you can use it just like any other library. I.e:

    find_path(SQLITE3_INCLUDE_DIR sqlite3.h)
    find_library(SQLITE3_LIBRARY sqlite3)
    if(NOT SQLITE3_INCLUDE_DIR)
      message(SEND_ERROR "Failed to find sqlite3.h")
    endif()
    if(NOT SQLITE3_LIBRARY)
      message(SEND_ERROR "Failed to find the sqlite3 library")
    endif()
    
    find_package(Threads REQUIRED)
    
    # ...
    
    target_link_libraries(complex
      ${Boost_FILESYSTEM_LIBRARY}
      ${Boost_SYSTEM_LIBRARY}
      ${SQLITE3_LIBRARY}
      ${CMAKE_THREAD_LIBS_INIT}
      rt)
    

    Lastly, do not set CMAKE_CXX_FLAGS to -O3. The user should pass -DCMAKE_BUILD_TYPE=Release when configuring the project instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the function where I get the compiler warning, I can't seem to
Here's an interesting puzzle. I downloaded Snippet Compiler to try some stuff out, and
Why is the Visual C++ compiler calling the wrong overload here? I am have
According to here , the C compiler will pad out values when writing a
Can a C++ compiler produce a not so good binary? You can think here
I want to make functor to generic function, but I get compiler error. Here
I am working on an assignment on compiler design. In the code generation part
I'm writing a yacc file as part of a compiler. I have the following
I needed asn1 BER encoder/decoder and found it as a part of asn1c compiler
I was reading intro on gtest and found this part confusing: The compiler complains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.