- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我让 DevKitPro 在 Game Boy Advance 上工作,但我遇到了一些问题。我看到的最大的一个是我的代码是在 0x00000000
而不是 ROM 盒带的正常 0x08000000
处组装的。我的理解是 C 编译器不使用 .org
指令在指定的内存位置创建代码;相反,链接器应该为我处理所有这些。但它似乎将代码放在“错误”的地址。游戏将正确运行,但我想这是因为它在模拟器上运行,而模拟器不关心它位于不应该位于的位置。如何在 0x08000000
处“组装”代码?
我对 makefile、编译器、链接器等的概念还很陌生,所以我可能没有把所有东西都设置好。我将展示我的 makefile、运行 makefile 的批处理脚本以及正在编译的 C 代码。我还包含了 objdump 以防相关。
C 代码:
// LIBGBA HEADERS
#include <gba_console.h>
#include <gba_video.h>
#include <gba_interrupt.h>
#include <gba_systemcalls.h>
#include <gba_input.h>
#include <stdio.h>
#include <stdlib.h>
// GAME-SPECIFIC INCLUDES
#include "M:\SrcGBA\PaintBoyAdvance\include\bitmap.h"
#include "M:\SrcGBA\PaintBoyAdvance\include\bitmap.c" //BITMAP SCREEN FUNCTIONS
//---------------------------------------------------------------------------------
// Program entry point
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
// the vblank interrupt must be enabled for VBlankIntrWait() to work
// since the default dispatcher handles the bios flags no vblank handler
// is required
irqInit();
irqEnable(IRQ_VBLANK);
// consoleDemoInit();
REG_DISPCNT = 0x1403;
while (1) {
VBlankIntrWait();
}
}
批处理脚本:
@echo off
set path=C:\devkitPro\;%path%
cd M:\SrcGBA\PaintBoyAdvance
make
if not "%errorlevel%"=="0" goto Abandon
C:\devkitPro\devkitARM\bin\arm-none-eabi-objdump -h M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o
C:\Users\puppy\Documents\VisualBoyAdvance\visualboyadvance-m.exe M:\SrcGBA\PaintBoyAdvance\PaintBoyAdvance.gba
:Abandon
exit
生成文件:
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
include $(DEVKITARM)/gba_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
# DATA is a list of directories containing binary data
# GRAPHICS is a list of directories containing files to be processed by grit
#
# All directories are specified relative to the project directory where
# the makefile is found
#
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source
INCLUDES := include
DATA := data
MUSIC :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -mthumb -mthumb-interwork
SPECS := -specs=gba.specs
CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi\
-ffreestanding \
$(ARCH)
CFLAGS := $(INCLUDE)
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(INCLUDE) -Wl,-Map,$(notdir $@.map)
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lmm -lgba
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(LIBGBA)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
ifneq ($(strip $(MUSIC)),)
export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir))
BINFILES += soundbank.bin
endif
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).gba : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
$(OFILES_SOURCES) : $(HFILES)
#---------------------------------------------------------------------------------
# The bin2o rule should be copied and modified
# for each extension used in the data directories
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
# rule to build soundbank from music files
#---------------------------------------------------------------------------------
soundbank.bin soundbank.h : $(AUDIOFILES)
#---------------------------------------------------------------------------------
@mmutil $^ -osoundbank.bin -hsoundbank.h
#---------------------------------------------------------------------------------
# This rule links in binary data with the .bin extension
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPSDIR)/*.d
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
对象转储的输出:
M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000268 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 0000029c 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 0000029c 2**0
ALLOC
3 .comment 00000024 00000000 00000000 0000029c 2**0
CONTENTS, READONLY
4 .ARM.attributes 0000002a 00000000 00000000 000002c0 2**0
CONTENTS, READONLY
编辑:这里要求的是批处理文件的输出:
\SrcGBA\PaintBoyAdvance\compile.bat paintboyadvance.c M:\SrcGBA\PaintBoyAdvance\source nopause
Process started >>>
paintboyadvance.c
linking cartridge
built ... PaintBoyAdvance.gba
ROM fixed!
M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000280 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 000002b4 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 000002b4 2**0
ALLOC
3 .comment 00000024 00000000 00000000 000002b4 2**0
CONTENTS, READONLY
4 .ARM.attributes 0000002a 00000000 00000000 000002d8 2**0
CONTENTS, READONLY
最佳答案
关键是使用链接描述文件。我将只发布一个完整的工作示例。
启动.s
.cpu arm7tdmi
.code 32
rom_start:
b ram_start
.space 0xA0-0x04,0
.space 0xC0-0xA0,0
ram_start:
b _start
.space 0xE0-0xC4,0
_start:
ldr sp,=0x03008000
bl notmain
hang:
b hang
.globl PUT16
PUT16:
strh r1,[r0]
bx lr
.globl GET16
GET16:
ldrh r0,[r0]
bx lr
.globl PUT32
PUT32:
str r1,[r0]
bx lr
.globl GET32
GET32:
ldr r0,[r0]
bx lr
notmain.c
extern void PUT32 ( unsigned int, unsigned int );
extern unsigned int GET32 ( unsigned int );
extern void PUT16 ( unsigned int, unsigned int );
extern unsigned int GET16 ( unsigned int );
#define DISPCNT 0x04000000
#define BG0CNT 0x04000008
#define PMEM 0x05000000
#define TMEM 0x06000000
#define VMEM 0x06008000
//#define TWIDE 32
//#define THIGH 20
//#define TVISIBLE 30
void notmain ( void )
{
unsigned int ra;
unsigned int rb;
unsigned int rc;
//display control,
//mode 0
//enable BG0
PUT16(DISPCNT,0x0100);
//BG0 control
//256 color palette
//tiles defined at 0x60000000
//screen at 0x60008000
PUT16( BG0CNT,0x1080);
//setup the first 8 colors
PUT16(PMEM+0x0,0x0000); //BLACK
PUT16(PMEM+0x2,0x001F); //RED
PUT16(PMEM+0x4,0x03E0); //GREEN
PUT16(PMEM+0x6,0x03FF); //GREEN+RED
PUT16(PMEM+0x8,0x7C00); //BLUE
PUT16(PMEM+0xA,0x7C1F); //BLUE+RED
PUT16(PMEM+0xC,0x7FE0); //BLUE+GREEN
PUT16(PMEM+0xE,0x7FFF); //BLUE+GREEN+RED (WHITE)
// Let's make a few tiles 64 bytes per tile.
ra=TMEM;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x00010001); ra+=4; PUT32(ra,0x00010001); ra+=4;
PUT32(ra,0x01000100); ra+=4; PUT32(ra,0x01000100); ra+=4;
PUT32(ra,0x00010001); ra+=4; PUT32(ra,0x00010001); ra+=4;
PUT32(ra,0x01000100); ra+=4; PUT32(ra,0x01000100); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x00020002); ra+=4; PUT32(ra,0x00020002); ra+=4;
PUT32(ra,0x02000200); ra+=4; PUT32(ra,0x02000200); ra+=4;
PUT32(ra,0x00020002); ra+=4; PUT32(ra,0x00020002); ra+=4;
PUT32(ra,0x02000200); ra+=4; PUT32(ra,0x02000200); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x00030003); ra+=4; PUT32(ra,0x00030003); ra+=4;
PUT32(ra,0x03000300); ra+=4; PUT32(ra,0x03000300); ra+=4;
PUT32(ra,0x00030003); ra+=4; PUT32(ra,0x00030003); ra+=4;
PUT32(ra,0x03000300); ra+=4; PUT32(ra,0x03000300); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x00040004); ra+=4; PUT32(ra,0x00040004); ra+=4;
PUT32(ra,0x04000400); ra+=4; PUT32(ra,0x04000400); ra+=4;
PUT32(ra,0x00040004); ra+=4; PUT32(ra,0x00040004); ra+=4;
PUT32(ra,0x04000400); ra+=4; PUT32(ra,0x04000400); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x00050005); ra+=4; PUT32(ra,0x00050005); ra+=4;
PUT32(ra,0x05000500); ra+=4; PUT32(ra,0x05000500); ra+=4;
PUT32(ra,0x00050005); ra+=4; PUT32(ra,0x00050005); ra+=4;
PUT32(ra,0x05000500); ra+=4; PUT32(ra,0x05000500); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x00060006); ra+=4; PUT32(ra,0x00060006); ra+=4;
PUT32(ra,0x06000600); ra+=4; PUT32(ra,0x06000600); ra+=4;
PUT32(ra,0x00060006); ra+=4; PUT32(ra,0x00060006); ra+=4;
PUT32(ra,0x06000600); ra+=4; PUT32(ra,0x06000600); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x00070007); ra+=4; PUT32(ra,0x00070007); ra+=4;
PUT32(ra,0x07000700); ra+=4; PUT32(ra,0x07000700); ra+=4;
PUT32(ra,0x00070007); ra+=4; PUT32(ra,0x00070007); ra+=4;
PUT32(ra,0x07000700); ra+=4; PUT32(ra,0x07000700); ra+=4;
//make screen black/clear screen
ra=VMEM;
for(rb=0;rb<(32*20);rb++)
{
PUT16(ra,0x0000);
ra+=2;
}
//put some tiles on the screen
ra=VMEM;
for(rc=0,rb=0;rb<(32*10);rb++,rc++)
{
rc&=7;
if(rc==0) rc=1;
PUT16(ra,rc);
ra+=2;
}
}
内存映射
MEMORY
{
ewram : ORIGIN = 0x02000000, LENGTH = 256K
}
SECTIONS
{
.text : { *(.text*) } > ewram
}
罗马 map
MEMORY
{
rom : ORIGIN = 0x08000000, LENGTH = 32K
}
SECTIONS
{
.text : { *(.text*) } > rom
}
构建
arm-none-eabi-as --warn --fatal-warnings startup.s -o startup.o
arm-none-eabi-gcc -c -mcpu=arm7tdmi -Wall -Werror -O2 -ffreestanding notmain.c -o notmain.o
arm-none-eabi-ld -T rommap startup.o notmain.o -o gbarom.elf
arm-none-eabi-objdump -D gbarom.elf > gbarom.list
arm-none-eabi-objcopy gbarom.elf -O binary notmain.gba
arm-none-eabi-ld -T memmap startup.o notmain.o -o notmain.elf
arm-none-eabi-objdump -D notmain.elf > notmain.list
arm-none-eabi-objcopy notmain.elf -O binary notmain.mb
现在 vba 允许你运行 multiboot 文件和 gba 文件
vba notmain.mb
vba motmain.gba
一个使用 EWRAM,另一个使用 GAME ROM。
您不必在链接描述文件中同时使用 MEMORY 和 SECTIONS,可以在节中硬编码地址,但我建议内存也在那里。我建议不要使用 (rwx) 东西,YMMV。
MEMORY
{
rom : ORIGIN = 0x08000000, LENGTH = 32K
}
SECTIONS
{
.text : { *(.text*) } > rom
}
名字 rom 并不重要——你可以叫它 pickle 就可以了。它只是一个名称,用于将内存范围定义连接到一个或多个部分。 .text* 里面是对象中所有以 .text 开头的东西(.text 是指令)。外面的 *() 表示通过链接器提供的所有对象,您可以为每个条目指定特定对象以进行更好的控制(请注意链接器脚本语言并不像您期望的那样好和完美,有时调出对象不起作用你会怎么想)。
那么前面的 .text 就是输出二进制文件使用的名称,你可以调用它 .baseball 它会工作得很好只是你输入该文件的工具不知道该怎么做所以只使用 .text 是一个好主意。
你添加更多这样的东西
MEMORY
{
ewram : ORIGIN = 0x02000000, LENGTH = 256K
}
SECTIONS
{
.text : { *(.text*) } > ewram
.rodata : { *(.rodata*) } > ewram
.bss : { *(.bss*) } > ewram
.data : { *(.data*) } > ewram
}
它将按顺序处理这些内容,因为 .text 内容首先进入输出,然后是 .rodata,然后是 .bss,最后是 .data。另请注意,由于此处没有调用任何文件或对象,因此命令行也会驱动事物的顺序。
arm-none-eabi-ld -T memmap startup.o notmain.o -o notmain.elf
我们需要将入口点代码放在首位,这样文件才能在命令行中排在首位(比使用编造的节名称等使其复杂化更容易)。
在构建时和尝试将内容提交到 Flash 之前请注意
看反汇编:
Disassembly of section .text:
02000000 <rom_start>:
2000000: ea00002e b 20000c0 <ram_start>
...
020000c0 <ram_start>:
20000c0: ea000006 b 20000e0 <_start>
...
020000e0 <_start>:
20000e0: e59fd024 ldr sp, [pc, #36] ; 200010c <GET32+0x8>
20000e4: eb000009 bl 2000110 <notmain>
020000e8 <hang>:
20000e8: eafffffe b 20000e8 <hang>
如果你在命令行交换文件
Disassembly of section .text:
02000000 <notmain>:
2000000: e92d4070 push {r4, r5, r6, lr}
2000004: e3a01c01 mov r1, #256 ; 0x100
2000008: e3a00301 mov r0, #67108864 ; 0x4000000
200000c: eb00028f bl 2000a50 <PUT16>
2000010: e3a01d42 mov r1, #4224 ; 0x1080
2000014: e59f06bc ldr r0, [pc, #1724] ; 20006d8 <notmai
游戏结束了,那将会崩溃。肯定不会像您希望/期望的那样运行(有时您可能会很幸运,但总的来说这是失败的)。
我在 Bootstrap 中为 Logo 数据留出了空间,这样可以让它作为 mgba 的真正 rom 或带有正确墨盒的真正 gba 工作(有些有菜单,你不需要正确的墨盒头) .在多重引导级别,您不需要拥有所有空间,只需从 Bootstrap 开始即可。
你可以通过 -Ttext=0x08000000
作为一个快速而肮脏的 hack,但是 gnu ld 仍然使用你正在使用的工具链中内置的默认链接器脚本,你是只需调整该部分类型。如果你用更复杂的东西来插入它,你就会开始陷入奇怪的境地。所以你可以看到使用链接描述文件是多么简单,它们不必很复杂。许多人倾向于过度复杂化,老实说,gnu 链接器脚本语言可能会很痛苦,因为它并不总是以一种理智和一致的方式工作。我更喜欢在其他地方而不是在链接描述文件中完成大部分工作。
关于c - (Game Boy Advance) 程序从 0x00000000 而不是 0x08000000 开始。如何告诉 gcc 编译到特定地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69875381/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!