Es ändert sich nichts...
Resumé:
Mein Projekt sieht folgendermaßen aus:
/Projekt
->/functions
  ->CMakeLists.txt
  ->asctecCommIntf.c
  ->asctecCommIntf.h
  ->asctecDefines.h
->main.cpp
->CMakeLists.txt
In dem CMakelists in dem Verzeichnis Functions habe ich folgendes:
| 1 | # Here the file for the Asctec 
 | 
| 2 | set( CMAKE_C_FLAGS -std=c99 )
 | 
| 3 | 
 | 
| 4 | # Define the following files as library
 | 
| 5 | set( asctecLibrary_SRCS asctecCommIntf.c )
 | 
| 6 | 
 | 
| 7 | # Compile as a shared library
 | 
| 8 | add_library( asctecLibrary SHARED ${asctecLibrary_SRCS} )
 | 
während in dem Root Verzeichnis, also die Hauptdatei "CMakeLists":
| 1 | ...
 | 
| 2 | 
 | 
| 3 | add_subdirectory( functions )
 | 
| 4 | 
 | 
| 5 | ## Declare a cpp executable
 | 
| 6 | add_executable( myprog main.cpp )
 | 
| 7 | 
 | 
| 8 | ## Specify libraries to link a library or executable target against
 | 
| 9 | target_link_libraries( myprog
 | 
| 10 |     dynamicLibrary
 | 
| 11 |     asctecLibrary
 | 
| 12 |     ${catkin_LIBRARIES}
 | 
| 13 | )
 | 
| 14 | 
 | 
| 15 | ...
 | 
In mein main.cpp habe ich die folgende Zeile:
| 1 | extern "C" {
 | 
| 2 |     #include "functions/asctecCommIntf.h"
 | 
| 3 | }
 | 
In allen Fällen kriege ich die folgende Fehlermeldung:
| 1 | error: ‘for’ loop initial declarations are only allowed in C99 mode
 | 
| 2 |   for(int i=0;i<aciMagicCodeVarLoaded;i++) {
 | 
| 3 |   ^
 | 
tausende Male wiederholt.
Was mache ich falsch?!?