Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Renaming Header File Error

$
0
0

When renaming a header file within the CCS IDE, the new header file name is automatically updated throughout the all project. The IDE also updates the new name at all the c files that has #include on that header file. BUT, when it updates the #include to the new name it moves the #inlcude line to the top of the file. This later causes compile cerrors if the order of including was important.

For example, i was using the TivaWare usb_dev_msc example and renamed usb_msc_structs.c/usb_msc_structs.h to usb_msc_sd_structs.c/usb_msc_sd_structs.h.

The list of includes in the original usb_msc_structs.c file is:

#include<stdint.h>

#include<stdbool.h>

#include"driverlib/usb.h"

#include"usblib/usblib.h"

#include"usblib/usb-ids.h"

#include"usblib/device/usbdevice.h"

#include"usblib/device/usbdmsc.h"

#include"usb_msc_structs.h"

#include"usbdsdcard.h"

this is changed after the renaming to:

#include"usb_msc_sd_structs.h"

#include<stdint.h>

#include<stdbool.h>

#include"driverlib/usb.h"

#include"usblib/usblib.h"

#include"usblib/usb-ids.h"

#include"usblib/device/usbdevice.h"

#include"usblib/device/usbdmsc.h"

#include"usbdsdcard.h"

When compiling the project with this new order of include list, usb_msc_sd_struct.h gets compile error because it uses definitions found in file usbdmsc.h which is now included later.

Note: i also noticed that this happens only if you change the c file name first. if you change the h file name first and then the c file name the new name is updated correctly without moving the #include line to the top of the file.

I am using CCS Version: 6.1.1.00022.

Thanks,

Timor


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>