Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error "Stray '@' in program" in qt
Forum Updated to NodeBB v4.3 + New Features

Error "Stray '@' in program" in qt

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    unnormal
    wrote on last edited by
    #1

    I'm building a Application on mac use Qt 5.0.2 , mac version 10.7.4. I want to use xcode in project. Example "Here ...":http://developer.apple.com/library/mac/#featuredarticles/FileSystemEvents/_index.html but Error display "Stray '@' in program" .This is my code

    Watcher.pro
    @
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = TestWatcherImage
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h
    FileSystemWatcherOSX.h

    FORMS += mainwindow.ui

    OTHER_FILES +=
    FileSystemWatcherOSX.mm

    OBJECTIVE_SOURCES += FileSystemWatcherOSX.mm
    LIBS += -framework AppKit
    LIBS += -framework CoreFoundation
    LIBS += -framework CoreServices
    LIBS += -framework CarbonCore
    @

    FileWatcher.hpp
    @
    #include <QString>

    #include <Foundation/NSString.h>
    #include <Foundation/NSFileManager.h>
    #include <Foundation/NSArray.h>

    class FileSystemWatcherOSX
    {
    private:
    FileSystemWatcherOSX();
    public:
    ~FileSystemWatcherOSX();
    static FileSystemWatcherOSX* singleton();
    private:
    void registerDefaults();
    void initializeEventStream();
    void addModifiedImagesAtPath(NSString* path);
    void updateLastEventId(uint64_t eventId);
    bool fileIsImage(NSString* path);
    void updateLastModificationDateForPath(NSString* path);
    NSDate* lastModificationDateForPath(NSString* path);
    QString qt_mac_NSStringToQString(const NSString* nsstr);
    private:
    NSFileManager* fm;
    IBOutlet NSTableView* table;
    NSMutableArray* images;
    NSMutableDictionary* pathModificationDates;
    NSDate* appStartedTimestamp;
    NSNumber* lastEventId;
    FSEventStreamRef stream;

    private:
    static FileSystemWatcherOSX* _instance;
    };

    @

    Can you help me ?
    Thank a lot.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      butterface
      wrote on last edited by
      #2

      Try to open it in a text editor which is able to display special characters. Sometimes it happens from coping code that you catch not displayable characters which cause such errors.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved