Sysprogs forums › Forums › VisualGDB › specify include and static libraries directories
- This topic has 4 replies, 3 voices, and was last updated 11 years, 8 months ago by dadi.
-
AuthorPosts
-
April 7, 2013 at 11:44 #458AnonymousParticipant
Dears,
I try to use VisulaGDB for MSP430 firmware with VS10 and compiling an existing souce code already organized in directories, header files, souce files and static libraries. What should I do to let the #include statements be recognized and linking the libraries (.a files)? By setting the VC++ Directories in the VS Project Property Pages (adding the paths into the Include Directories and Library Directories) the files seems to be accessible inside the “” or <> (maybe via the IntelliSense), but when I compile I get the compile error 1: filename.h: no such file or directory.
For the include files, adding to al #include a “..dirnamesfilname.h”, then it compiles without errors. But it is really hard accept, other than I had to open&modify by hand all header and source files.
I tryied also to modify the flags.mak/INCLUDE_DIRS macro by setting it to:
absoluteCpath/dirs
or only
/relativeDirsStartingFromProjectDir
each other separated by spaces and all without spaces inside the filepath; but again no success.With the linking of the static libraries it is also harder because of the “… not defined” errors that occours and that do not let compile the code and of which I cannot find any solution (like the one used for the includes).
Could anyone help me setting up the project?
Thanks a lot
DavideApril 8, 2013 at 15:26 #2139supportKeymasterHi,
Did you let VisualGDB generate a makefile/flags.mak, or did you reuse an existing makefile?
Does the makefile in your project directory have any comments related to VisualGDB?April 8, 2013 at 17:39 #2140dadiParticipantHello bazis,
I use the VisualGDB MakeFile and I have made no changes on it. I’ve changed only the flags.mak values as explained on your guide:
#Generated by VisualGDB project wizard.
#Feel free to modify any flags you want
#Visit http://visualgdb.com/makefiles for more detailsCC := C:/SysGCC/msp430/bin/msp430-gcc.exe
CXX := C:/SysGCC/msp430/bin/msp430-g++.exe
LD := $(CXX)
AR := C:/SysGCC/msp430/bin/msp430-ar.exe
OBJCOPY := C:/SysGCC/msp430/bin/msp430-objcopy.exe
CP := cpCOMMON_MACROS :=
DEBUG_MACROS := DEBUG
RELEASE_MACROS := NDEBUG RELEASEMCUFLAGS := -mmcu=cc430f5137
INCLUDE_DIRS := /rac /kal /hal /at
LIBRARY_DIRS :=
LIBRARY_NAMES :=CFLAGS := -ggdb -ffunction-sections
DEBUG_CFLAGS := -O0
RELEASE_CFLAGS := -O3CXXFLAGS := $(CFLAGS) -ffunction-sections
DEBUG_CXXFLAGS := $(DEBUG_CFLAGS)
RELEASE_CXXFLAGS := $(RELEASE_CFLAGS)MACOS_FRAMEWORKS :=
LDFLAGS := -Wl,-gc-sections
DEBUG_LDFLAGS :=
RELEASE_LDGLAGS :=START_GROUP := -Wl,–start-group
END_GROUP := -Wl,–end-groupUSE_DEL_TO_CLEAN := 1
GENERATE_BIN_FILE := 0
ADDITIONAL_MAKE_FILES :=
IS_LINUX_PROJECT := 0include $(ADDITIONAL_MAKE_FILES)
April 9, 2013 at 15:24 #2141supportKeymasterHi,
The INCLUDE_DIRS syntax in the makefile you provided looks incorrect. Please use the unix-style relative paths. E.g. if your makefile is in the directory c:projectsproject1 and the include directories are c:projectsproject1rac and c:projectscommon, please specify “rac ../common”. Please ensure that there are no spaces in the project directory. Alternatively you can add absolute paths in MinGW format (e.g. c:/projects/project1/rac).
Regarding the static library names, please first add the library directories to the LIBRARY_DIRS using the same syntax as INCLUDE_DIRS. Then add short library names to LIBRARY_NAMES (e.g. if your library is called libTest1.a, just add Test1 to LIBRARY_NAMES).
If nothing helps, please rebuild your project and post your build log and the build directory name here. The build log should include the G++ command line that specifies the include directories.
April 9, 2013 at 23:41 #2142dadiParticipantHi bazis,
and thanks a lot for your help: the project compiles now well or at least Build Succeeded is now written on the bottom of VS10: now I will strart with download and debug issues using an Olimex. What to do was simply:
1) remove the start path delimiter / of the include files directories
2) do not use “” (quotes) you wrote to surround the example strings
3) specify the name without lib for the libraryByye
Davide -
AuthorPosts
- You must be logged in to reply to this topic.