CodeLite配置

CodeLite配置wxWidgets与QT

1.CodeLite配置wxWidgets 

首先保证codelite + MinGW 能正常工作;

2.Build wxWidgets

参考:http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Build_wxWidgets

启动MinGW Shell

cd /D <wxWidgets>\build\msw

Execute the build command. The recommended command to use for MinGW/GCC is:

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

Or

The recommended command to use for MSVC is:

nmake -f makefile.vc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

MinGW下存在文件 c:\MinGW\include\sys\utime.h

wxWidgets 下存在文件 C:\wxWidgets\include\wx\app.h

环境变量设置如下:
c:\CodeLite;c:\MinGW\bin;c:\wxWidgets\lib\gcc_dll;


在C++文件中声明下列两个头文件。
#include "sys\utime.h" //正常,能工作。
#include "wx\app.h" //不正常,错误如下:22: wx\app.h: No such file or directory


codelite 中对Tags setting->including files 进行了设置。 可以直接在IDE中打开utime.h和app.h文件。
问题是编译时通不过。

另:在codelite 中对 Environment Variables 的设置如下:
CodeLiteDir=C:\CodeLite
WXCFG=gcc_dll\mswud
WXWIN=C:\wxWidgets\include

参考:http://www.codelite.org/WxWidgets/GettingReadyForWxWidgetsDevelopmentUnderWindows

如下步骤:

Step 1: Download wxWidgets

  • Download wxWidgets source from here. We recommend you download the zip version of wxMSW.
  • Extract the archive (after extraction, you might want to move the extracted files to a more straight-forward directory name, like c:\wx\wx288 - sub-directories of this folder will be includesrc, and so forth).
 

Step 2: Build wxWidgets

  • Open the command prompt (Start > Run... > cmd).
  • Go to the build\msw folder of your wxWidgets directory, e.g. C:\wx\wx288\build\msw.
  • You can now build the library using, for example:
    mingw32-make -f makefile.gcc UNICODE=1 SHARED=1 MONOLITHIC=1 BUILD=debug
    Notice the various parameters passed to make program. A list of important parameters are available here: wxWidgets Build Parameters.
 

Step 3: Configure CodeLite

    • Open Settings > Environment Variables
    • Add the following variables:
      • WXWIN - this points to your main wxWidgets directory, e.g. C:\wx\wx288
      • WXCFG - this points to the path containing the configuration file for the current build.
        For example, if build.cfg is under C:\wx\wx288\lib\gcc_dll\mswud, you'd need to set WXCFG to gcc_dll\mswud.

 

2.CodeLite配置QT

3.CodeLite配置MinGW

 

Various build options are available when building the wxWidgets libraries. Here are a few important ones:

 

Parameter

Description

UNICODE=1

wxWidgets libraries prior to version 3 (which is yet to be released) can be built in either ANSI or UNICODE mode. CodeLite requires a unicode build.

SHARED=1

Will build the library as a DLL. When specified, your application will only work if the wx DLL is installed on the computer and under a directory that is a part of the path environment variable. If this option is not specified the libraries will be attached to your executable, resulting in a larger file.

MONOLITHIC=1

Can only be used in combination with SHARED=1. Will package the whole wxWidgets library into a single file, instead of several.

BUILD=

Options are either debug or release. Debug builds are larger in size, but enable debugging of the wxWidgets code.

USE_XRC=1

USE_RTTI=1

USE_OPENGL=1

These flags are examples of sub-components of the library that you might want to be included in the build.

 
 

Additional Resources

http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

 

 

 

转载于:https://www.cnblogs.com/panxihua/archive/2012/06/16/2550128.html

<think>好的,我现在需要帮助用户解决在Codelite IDE中设置或使用ARM9开发环境的问题。首先,我应该回忆一下用户提供的引用内容,看看是否有相关的信息。用户提到了三个引用,其中引用[1]提到了嵌入式交叉编译工具链,比如arm-linux-gnueabihf-gcc、arm-linux-gcc、aarch64-linux-gcc等,这可能与ARM9开发相关,因为ARM9通常使用ARMv5架构,可能需要对应的交叉编译器。引用[2]是关于在CLion中配置环境变量的方法,虽然用户问的是Codelite,但配置环境变量的思路可能类似。引用[3]是CodeLite配置的链接,但链接指向了CodeBlocks的Wiki,这可能是个错误,但用户主要需要的是Codelite配置方法。 接下来,我需要结合自己的知识,思考在Codelite配置交叉编译环境的步骤。通常,配置交叉编译环境需要安装交叉编译器,然后在IDE中设置工具链路径,创建新的编译配置,可能需要调整构建命令和链接器设置。另外,可能需要配置调试器,但ARM9通常需要硬件调试器如J-Link,所以可能涉及外部工具配置。 用户的问题是关于ARM9的,因此需要确定合适的交叉编译器。ARM9属于较旧的架构,可能使用arm-linux-gcc(如arm-none-eabi-gcc)而不是aarch64的编译器。需要建议用户安装正确的工具链,例如gcc-arm-embedded或者从ARM官网下载合适的版本。 然后,在Codelite配置编译器和调试器。步骤可能包括:在设置中添加新的编译器,指定路径,创建新的构建配置,修改编译选项,比如指定目标架构(如-march=armv5te)等。同时,可能需要配置环境变量,如引用[2]提到的,在Codelite的构建配置中添加环境变量,例如PATH中包含交叉编译器的路径。 另外,可能需要配置项目的Makefile或使用Codelite的构建系统,生成正确的交叉编译命令。如果用户使用自定义的Makefile,Codelite需要指向该Makefile,并设置正确的参数。 最后,需要测试配置是否正确,比如编写一个简单的程序,编译生成ARM9的可执行文件,并通过调试或运行在目标硬件上验证。 现在需要将这些步骤整理成清晰的指导,分步骤说明,并确保用户能够按照操作。同时,根据用户提供的引用,可能需要指出相关的工具链名称和环境变量配置方法。例如,引用[1]中的arm-linux-gcc可能适用于ARM9,需要用户安装对应的工具链,并在Codelite中设置编译器路径。引用[2]的环境变量配置方法可以类比到Codelite的环境设置中,比如在构建配置中添加PATH变量。 可能的问题点:用户可能不清楚如何找到正确的交叉编译器,或者在配置过程中路径设置错误。需要强调安装工具链的步骤,并提供示例路径。另外,Codelite的具体菜单选项可能需要详细说明,比如如何进入编译器设置,如何添加新的编译器配置等。 总结回答的结构应该是:安装交叉编译工具链 → 配置Codelite的编译器 → 创建构建配置 → 设置项目属性 → 验证配置。同时,生成的相关问题可能涉及交叉编译器的安装、调试配置、环境变量设置等。</think>### 在 Codelite 中设置 ARM9 开发环境的步骤 #### 1. **安装 ARM9 交叉编译工具链** - ARM9 通常基于 ARMv5 架构,推荐使用 `arm-none-eabi-gcc` 或 `arm-linux-gcc` 工具链。例如: ```bash sudo apt-get install gcc-arm-linux-gnueabi # Debian/Ubuntu 系统 ``` 或从 ARM 官网下载预编译工具链[^1]。 #### 2. **配置 Codelite 编译器路径** 1. 打开 Codelite,进入 **`设置 > 构建设置 > 编译器`**。 2. 点击 **`添加编译器`**,输入名称(如 `ARM9 GCC`)。 3. 指定交叉编译器的路径: - **C 编译器**:`/usr/bin/arm-linux-gnueabi-gcc` - **C++ 编译器**:`/usr/bin/arm-linux-gnueabi-g++` ![编译器路径示例](https://via.placeholder.com/600x400?text=Compiler+Path+Example) #### 3. **创建 ARM9 构建配置** 1. 在项目视图中右键项目,选择 **`设置 > 构建设置`**。 2. 添加新配置(如 `ARM9 Release`),选择上一步配置的编译器。 3. 修改编译选项: - 添加架构标志:`-march=armv5te` - 添加链接器选项:`-static`(如需静态链接) #### 4. **设置环境变量(可选)** - 在 **`构建设置 > 环境`** 中添加工具链路径到 `PATH` 变量: ``` PATH=/opt/arm9-toolchain/bin:${PATH} ``` 类似 CLion 的环境配置逻辑[^2]。 #### 5. **配置调试支持** - ARM9 调试通常依赖硬件调试器(如 J-Link)。需安装 `OpenOCD` 或 `GDB` 工具: ```bash sudo apt-get install gdb-multiarch ``` - 在 Codelite 中设置调试器路径为 `gdb-multiarch`,并在启动命令中指定目标设备参数。 #### 6. **验证配置** - 编写简单的 `Hello World` 程序,选择 ARM9 构建配置编译: ```bash file bin/arm9_app # 检查文件类型应为 ARM 可执行文件 ``` --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值