danke deine Antwort hat mir sehr geholfen
habe jetzt einiges geändert:
css.cpp
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void libcssread(void)
{
char cssheader;
ifstream cssread;
string csspath;
cssread.open(csspath.c_str());
while (cssread.eof() !=true)
{
cssheader = cssread.get();
cssread.close();
}
}
css.h
Code:
#include <fstream>
#include <string>
using namespace std;
void libcssread(void)
{
char cssheader;
std::ifstream cssread;
std::string csspath;
};
index.cpp
Code:
#include <iostream>
#include "index.h"
#include <dlfcn.h>
using namespace std;
#include "lib/libcss/include/css.h"
int main()
{
cout << "Content-type: text/html" << endl
<< "<html>" << endl
<< "<head>" << endl
<< "<title>Wikommen auf Tuxist Mainbase</title>" << endl
<< "</head>" << endl;
libcssread();
cout << "<body>" << endl
<< "<h1><em>" << endl
<< "Im Aufbau" << endl
<< "</em></h1>" << endl
<< "</body>" << endl
<< "</html>";
}
g++ output:
Code:
/usr/bin/g++ -Wall -fsigned-char -Ilib/libcss/include -Lbin/lib/libcss -llibcss index.cpp
lib/libcss/include/css.h: In function ‘void libcssread()’:
lib/libcss/include/css.h:8: warning: unused variable ‘cssheader’
/usr/bin/ld: cannot find -llibcss
collect2: ld returned 1 exit status
make: *** [all] Fehler 1
makefile index.cpp
Code:
CXX= /usr/bin/g++
CXXOPTFLAGS=
CXXFLAGS=$(CXXOPTFLAGS) -Wall -fsigned-char -Ilib/libcss/include -Lbin/lib/libcss -llibcss
lib_SRC= \
index.cpp
all:
$(CXX) $(CXXFLAGS) $(lib_SRC)
Lesezeichen