Questions in category: CodeBlocks (CodeBlocks)
软件 >> C++ >> CodeBlocks

1. 标准库中的hash函数

Posted by haifeng on 2023-05-08 15:13:28 last update 2023-05-08 15:34:15 | Answers (0) | 收藏


CodeBlocks

functional_hash.h 
basic_string.h           (含有 template<>    struct hash<string>{} 函数)

位于

C:\Program Files\CodeBlocks\MinGW\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\bits\

 

hashtable.h,  hash_fun.h,  hash_map,  hash_set

位于

C:\Program Files\CodeBlocks\MinGW\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\backward

2. 使用CodeBlocks编译后的程序(.exe)运行所需要的文件

Posted by haifeng on 2022-06-06 08:26:14 last update 2022-06-06 08:26:14 | Answers (0) | 收藏


使用CodeBlocks编译后的程序(.exe) 在分发给他人时, 可能需要以下三个dll文件:

libgcc_s_seh-1.dll

libstdc++-6.dll

libwinpthread-1.dll

 

如果目标机器已经安装了 CodeBlocks, 并且已经将其安装目录(默认是 C:\Program Files\CodeBlocks)设置到环境变量PATH中, 则可以不必拷贝上面三个 dll 文件.

 

 

3. CodeBlocks 中的快捷键

Posted by haifeng on 2021-03-07 10:01:55 last update 2021-03-07 10:01:55 | Answers (0) | 收藏


CodeBlocks 中的快捷键 

组合键/功能键 功能
F11 在头文件与其实现文件之间进行切换
Alt+G 打开文件
Ctrl+Alt+G 访问哪个函数
Ctrl+PgUp/PgDn 在函数之间进行定位
Ctrl+Tab 在文件之间进行切换

 

4. CodeBlocks中第三方库的添加

Posted by haifeng on 2020-10-18 08:57:06 last update 2020-10-18 08:57:06 | Answers (0) | 收藏


 

Notes


========================================
16.01 太难用了  (目前我安装的是这个版本,2016-11-22)

http://blog.chinaunix.net/uid-26969873-id-5707445.html


1. 第三方库的添加

为了干净的安装,我把原来的Code::Blocks10 完全卸载了,并且彻底删除干净。但是我忘了,有些库我是后来加进去的,时间一长自然也就不知道添加了什么库。只是最近在用 libcurl ,才想到需要重新去下载了。

附: curl 的官方网站 https://curl.haxx.se/
下载 libcurl 的链接 https://curl.haxx.se/dlwiz/?type=lib

关于 libcurl 的安装说明:

解压缩从上面网址下载的 curl-7.40.0-devel-mingw32.zip 文件
(1) 将 curl-7.40.0-devel-mingw32\bin\目录下的 curl.exe 以及六个 dll 等文件拷贝到 C:\Program Files\CodeBlocks\MinGW\bin 中,其中 zlib1.dll 已经存在,就不必覆盖了,因为相比CodeBlocks提供的比较旧。

(2) 将 curl-7.40.0-devel-mingw32\include 下的所有文件拷贝到 C:\Program Files\CodeBlocks\MinGW\include, 当然 README 文件不用拷贝。

(3) 将 curl-7.40.0-devel-mingw32\lib 下的所有文件拷贝到 C:\Program Files\CodeBlocks\MinGW\lib 中。


-------------------

还有哪些库不是 Code::Blocks 自带的?
比如 libsqlite3.a,(D:\download\SQLite\3.12.2\sqlite-dll-win32-x86-3120200) 拷贝到

C:\Program Files\CodeBlocks\MinGW\lib

其他文件是否也要拷贝过去?


(注:如果是64位系统,相应的目录为 C:\Program Files (x86)\CodeBlocks\MinGW 。)

5. 关于 curl 的安装

Posted by haifeng on 2019-02-17 10:03:03 last update 2019-02-17 10:03:03 | Answers (0) | 收藏


curl

https://curl.haxx.se/

6. CodeBlocks 文件编辑和程序编译的编码设置

Posted by haifeng on 2018-04-10 13:16:43 last update 2018-04-14 11:24:50 | Answers (0) | 收藏


如果编码不一致,则在编译时会出现下面的错误:

 

||=== Build: Release in Josephus (compiler: GNU GCC Compiler) ===|
D:\work\cs\c++\datastruct\Exercise\Josephus\main.cpp||In function 'int main()':|
D:\work\cs\c++\datastruct\Exercise\Josephus\main.cpp|34|error: converting to execution character set: Illegal byte sequence|
D:\work\cs\c++\datastruct\Exercise\Josephus\main.cpp|36|error: converting to execution character set: Illegal byte sequence|
D:\work\cs\c++\datastruct\Exercise\Josephus\main.cpp|38|error: converting to execution character set: Illegal byte sequence|
D:\work\cs\c++\datastruct\Exercise\Josephus\main.cpp|40|error: converting to execution character set: Illegal byte sequence|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

 

 

设置办法:

文件编码:
Setting -> Editor ->General settings -> Encoding settings

此处默认Windows-936即gbk

编译编码:
Setting -> Compiler -> Global compiler settings -> other compiler options

在框中输入:
    -finput-charset=GBK
    -fexec-charset=GBK

 

如果需要跨平台, 建议都设置为 UTF-8, 即

-finput-charset=UTF-8
-fexec-charset=UTF-8


References:

这里设置办法参考自

http://www.cnblogs.com/thingk/p/4224186.html

 

7. CodeBlocks中关于 algorithm, vector 等头文件的存放目录

Posted by haifeng on 2018-03-30 23:04:18 last update 2018-03-30 23:04:18 | Answers (0) | 收藏


 

C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.9.2\include\c++

8. undefined reference to wxTaskBarIcon

Posted by haifeng on 2016-09-29 21:44:13 last update 2016-09-29 21:44:13 | Answers (0) | 收藏


编译时如果出现

undefined reference to wxTaskBarIcon::wxTaskBarIcon

的错误提示,

则需要在 codeblocks 的项目编译属性(build option)的 link 设置页面(link setting)中添加 libwxmsw30u_adv.a

9. Codeblocks 命令行启动

Posted by haifeng on 2015-03-11 08:47:12 last update 2015-03-11 09:26:38 | Answers (0) | 收藏


个性化

使用 --personality=myuser 来调用 CodeBlocks, 配置信息将保存到 myuser.conf 中. 如果该文件不存在, 系统将自动创建它.

如果传递参数 ask, 即 --personality=ask, 将会显示当前所有的配置列表, 由用户选择某个配置文件并启动 CodeBlocks.

C:\Program Files\CodeBlocks>codeblocks.exe --personality=ask

 

 


References:

 

http://blog.csdn.net/drbinzhao/article/details/8064049