This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello, I am new with ccs and launchpad .
My Os is Windows 10 and using ccsv6 for my launchpad tm4c123gxl
while trying to compile a simple example project for display, I am getting the error " #1965 cannot open source file "display.h"
Even though I have the header file for display in C:\ti\TivaWare_C_Series-2.1.3.156\driverlib
what might be the reason for the error?
**** Console Build of configuration Debug for project Display_example ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me --include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" --include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" --include_path="C:/ti/TivaWare_C_Series-2.1.3.156" -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="main.d" "../main.c"
>> Compilation failure
subdir_rules.mk:7: recipe for target 'main.obj' failed
"../main.c", line 51: fatal error #1965: cannot open source file "display.h"
1 catastrophic error detected in the compilation of "../main.c".
Compilation terminated.
gmake: *** [main.obj] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
Best regards
John
Hello John,
Sijo John said:while trying to compile a simple example project for display, I am getting the error " #1965 cannot open source file "display.h"
Even though I have the header file for display in C:\ti\TivaWare_C_Series-2.1.3.156\driverlib
Sijo John said:--include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" --include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" --include_path="C:/ti/TivaWare_C_Series-2.1.3.156"
You will need to add "C:\ti\TivaWare_C_Series-2.1.3.156\driverlib" to the list of include search paths.
Did you create display.h and copy it to C:\ti\TivaWare_C_Series-2.1.3.156\driverlib? I do not see it with my installation.
Thanks
ki
Hi Ki,
still with new errors
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "Display_example.out" not built
gmake: *** [Display_example.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build of configuration Debug for project Display_example ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building target: Display_example.out'
'Invoking: ARM Linker'
"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -g --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi -z -m"Display_example.map" --stack_size=512 --heap_size=0 -i"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/lib" -i"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" --reread_libs --diag_wrap=off --warn_sections --display_error_number --xml_link_info="Display_example_linkInfo.xml" --rom_model -o "Display_example.out" "./main.obj" "./tm4c123gh6pm_startup_ccs.obj" "../tm4c123gh6pm.cmd" -llibc.a -l"C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/ccs/Debug/driverlib.lib"
<Linking>
undefined first referenced
symbol in file
--------- ----------------
clearLCD ./main.obj
initLCD ./main.obj
printLCD ./main.obj
setCursorPositionLCD ./main.obj
>> Compilation failure
makefile:142: recipe for target 'Display_example.out' failed
I wish to add the .h and .c file here display.h
/* * LCD Library for Stellaris/Tiva launchpads * All rights reserved. * Distributed under the BSD License * Copyright (c) 2015, Manolis Kiagias * * Based on ideas and code of the MSP430 Launchpad LCD Library * published in Co-Random thoughts blog: * http://cacheattack.blogspot.gr/2011/06/quick-overview-on-interfacing-msp430.html * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * --/COPYRIGHT--*/ /*******************************************************************************/ #include "display.h" // // Pulse the EN bit LOW - HIGH - LOW // To signal the LCD to accept the data/cmd // void pulseLCD() { // Go Low -> High -> Low GPIOPinWrite(CMD_PORT_BASE, EN, 0); GPIOPinWrite(CMD_PORT_BASE, EN, EN); GPIOPinWrite(CMD_PORT_BASE, EN, 0); } // // Set the RS to LOW // Indicating incoming command // void setCmd() { GPIOPinWrite(CMD_PORT_BASE, RS,0); } // // Set the RS to HIGH // Indicating incoming data // void setData() { GPIOPinWrite(CMD_PORT_BASE, RS,RS); } // // Send data byte in 4 bit mode // High nibble is sent first // void sendByte(char byteToSend, int isData) { if (isData) setData(); else setCmd(); SysCtlDelay(400); GPIOPinWrite(DATA_PORT_BASE, ALLDATAPINS, byteToSend >>4); pulseLCD(); GPIOPinWrite(DATA_PORT_BASE, ALLDATAPINS, byteToSend); pulseLCD(); } // // For 16 columns, 2 rows LCD // Select row / column for next character output // Initial values are 0,0 // void setCursorPositionLCD(char row, char col) { char address; if (row == 0) address = 0; else if (row==1) address = 0x40; else if (row==2) address = 0x14; else if (row==3) address = 0x54; else address = 0; address |= col; sendByte(0x80 | address, FALSE); } // // Clear the LCD // and return to home position (0,0) // void clearLCD(void) { sendByte(0x01, FALSE); // Clear screen sendByte(0x02, FALSE); // Back to home SysCtlDelay(30000); } // // Return to home position (0,0) // void homeLCD(void) { sendByte(0x02, FALSE); SysCtlDelay(30000); } // // Make block cursor visible // void setBlockCursorLCD(void) { sendByte(0x0F, FALSE); } // // Make line cursor visible // void setLineCursorLCD(void) { sendByte(0x0E, FALSE); } // // Display cursor on screen // void cursorOnLCD(void) { sendByte(0x0E, FALSE); } // // Hide cursor from screen // void cursorOffLCD(void) { sendByte(0x0C, FALSE); } // // Turn off LCD // void displayOffLCD(void) { sendByte(0x08, FALSE); } // // Turn on LCD // void displayOnLCD(void) { sendByte(0x0C, FALSE); } // // Initialize the LCD // Performs the following functions: // Activates selected ports // Designates ports as outputs // Pulls all output pins to low // Waits for LCD warmup // Sets LCD for 4 pin communication // Sets two lines display // Hides the cursor // Sets insert mode // Clears the screen // void initLCD(void) { // // set the MSP pin configurations // and bring them to low // SysCtlPeripheralEnable(DATA_PERIPH); SysCtlPeripheralEnable(CMD_PERIPH); GPIOPinTypeGPIOOutput(DATA_PORT_BASE, ALLDATAPINS); GPIOPinTypeGPIOOutput(CMD_PORT_BASE, ALLCONTROLPINS); GPIOPinWrite(DATA_PORT_BASE, ALLDATAPINS ,0); GPIOPinWrite(CMD_PORT_BASE, ALLCONTROLPINS ,0); // // wait for the LCM to warm up and reach // active regions. Remember MSPs can power // up much faster than the LCM. // SysCtlDelay(10000); // // initialize the LCM module // Set 4-bit input // setCmd(); SysCtlDelay(15000); GPIOPinWrite(DATA_PORT_BASE, ALLDATAPINS, 0b0010); pulseLCD(); GPIOPinWrite(DATA_PORT_BASE, ALLDATAPINS, 0b0010); pulseLCD(); sendByte(0x28,FALSE); // Set two lines cursorOffLCD(); // Cursor invisible sendByte(0x06, FALSE); // Set insert mode clearLCD(); } // // Print the text // on the screen // void printLCD(char *text) { char *c; c = text; while ((c != 0) && (*c != 0)) { sendByte(*c, TRUE); c++; } }
Hello,
Sijo John said:undefined first referenced
symbol in file
--------- ----------------
clearLCD ./main.obj
initLCD ./main.obj
printLCD ./main.obj
This error is documented in the link below:
http://processors.wiki.ti.com/index.php/Build_Errors_in_CCS#Error:_unresolved_symbols_remain
In you case, you need to find where those unresolved symbols (clearLCD, initLCD, printLCD) are defined and make sure the source or library for it is included into your project.
I'm not familiar with TivaWare to know myself. Perhaps you need grlib, so you can try including that. Someone in the Tiva forums would know best.
Thanks
ki